]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
merge from V5_1_3rc5
authorprascle <prascle>
Mon, 7 Dec 2009 16:20:46 +0000 (16:20 +0000)
committerprascle <prascle>
Mon, 7 Dec 2009 16:20:46 +0000 (16:20 +0000)
297 files changed:
adm_local/unix/config_files/check_qwt.m4
bin/smesh_setenv.py
configure.ac
doc/salome/gui/SMESH/images/2d_from_3d_menu.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/blsurf_parameters.png
doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png
doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png
doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png
doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png
doc/salome/gui/SMESH/images/hypo_quad_params_2.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png [new file with mode: 0644]
doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
doc/salome/gui/SMESH/input/about_hypo.doc
doc/salome/gui/SMESH/input/about_meshes.doc
doc/salome/gui/SMESH/input/basic_meshing_algos.doc
doc/salome/gui/SMESH/input/blsurf_hypo.doc
doc/salome/gui/SMESH/input/building_compounds.doc
doc/salome/gui/SMESH/input/constructing_meshes.doc
doc/salome/gui/SMESH/input/convert_to_from_quadratic_mesh.doc
doc/salome/gui/SMESH/input/editing_groups.doc
doc/salome/gui/SMESH/input/free_faces.doc
doc/salome/gui/SMESH/input/free_nodes.doc
doc/salome/gui/SMESH/input/ghs3d_hypo.doc
doc/salome/gui/SMESH/input/grouping_elements.doc
doc/salome/gui/SMESH/input/make_2dmesh_from_3d.doc [new file with mode: 0644]
doc/salome/gui/SMESH/input/mesh_infos.doc
doc/salome/gui/SMESH/input/modifying_meshes.doc
doc/salome/gui/SMESH/input/netgen_2d_3d_hypo.doc
doc/salome/gui/SMESH/input/prism_3d_algo.doc
doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc
doc/salome/gui/SMESH/input/smeshpy_interface.doc
doc/salome/gui/SMESH/input/translation.doc
doc/salome/gui/SMESH/input/tui_creating_meshes.doc
doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc
doc/salome/gui/SMESH/input/tui_defining_ghs3d_hypotheses.doc [new file with mode: 0644]
doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc
doc/salome/gui/SMESH/input/tui_grouping_elements.doc
doc/salome/gui/SMESH/input/tui_modifying_meshes.doc
doc/salome/gui/SMESH/input/tui_viewing_meshes.doc
doc/salome/gui/SMESH/input/viewing_meshes_overview.doc
idl/SMESH_Mesh.idl
idl/SMESH_MeshEditor.idl
resources/Makefile.am
resources/mesh_2d_from_3d.png [new file with mode: 0644]
src/Controls/SMESH_Controls.cxx
src/Controls/SMESH_ControlsDef.hxx
src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx
src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx
src/DriverDAT/Makefile.am
src/DriverMED/DriverMED_Family.cxx
src/DriverMED/DriverMED_Family.h
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_R_SMESHDS_Mesh.h
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx
src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx
src/DriverUNV/Makefile.am
src/MEFISTO2/aptrte.cxx
src/MEFISTO2/aptrte.h
src/OBJECT/Makefile.am
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_Actor.h
src/OBJECT/SMESH_ActorDef.h
src/OBJECT/SMESH_ActorUtils.cxx
src/OBJECT/SMESH_ActorUtils.h
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_DeviceActor.h
src/OBJECT/SMESH_ExtractGeometry.cxx
src/OBJECT/SMESH_FaceOrientationFilter.cxx
src/OBJECT/SMESH_Object.cxx
src/OBJECT/SMESH_Object.h
src/OBJECT/SMESH_ObjectDef.h
src/OBJECT/SMESH_PreviewActorsCollection.cxx
src/SMDS/SMDS_EdgePosition.cxx
src/SMDS/SMDS_Mesh.hxx
src/SMDS/SMDS_VolumeOfNodes.cxx
src/SMDS/SMDS_VolumeTool.cxx
src/SMDS/SMDS_VolumeTool.hxx
src/SMESH/SMESH_Block.cxx
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Gen.hxx
src/SMESH/SMESH_Hypothesis.cxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MeshEditor.hxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_MesherHelper.hxx
src/SMESH/SMESH_Octree.cxx
src/SMESH/SMESH_Octree.hxx
src/SMESH/SMESH_OctreeNode.cxx
src/SMESH/SMESH_OctreeNode.hxx
src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx
src/SMESHDS/SMESHDS_CommandType.hxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_Mesh.hxx
src/SMESHGUI/Makefile.am
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_ClippingDlg.h
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.h
src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
src/SMESHGUI/SMESHGUI_Dialog.h
src/SMESHGUI/SMESHGUI_Displayer.cxx
src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx
src/SMESHGUI/SMESHGUI_EditMeshDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.h
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx
src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.h
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_GroupUtils.cxx
src/SMESHGUI/SMESHGUI_GroupUtils.h
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_Hypotheses.h
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.h
src/SMESHGUI/SMESHGUI_IdValidator.h
src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.h [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MeshDlg.cxx
src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx
src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/SMESHGUI/SMESHGUI_MeshOp.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshUtils.cxx
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.h
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_Operation.cxx
src/SMESHGUI/SMESHGUI_PatternWidget.cxx
src/SMESHGUI/SMESHGUI_PatternWidget.h
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_SelectionOp.cxx
src/SMESHGUI/SMESHGUI_SelectionOp.h
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SpinBox.cxx
src/SMESHGUI/SMESHGUI_SpinBox.h
src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx
src/SMESHGUI/SMESHGUI_Utils.cxx
src/SMESHGUI/SMESHGUI_Utils.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.h
src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx
src/SMESHGUI/SMESHGUI_XmlHandler.cxx
src/SMESHGUI/SMESHGUI_XmlHandler.h
src/SMESHGUI/SMESH_images.ts
src/SMESHGUI/SMESH_msg_en.ts
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_2smeshpy.hxx
src/SMESH_I/SMESH_DumpPython.cxx
src/SMESH_I/SMESH_Filter_i.cxx
src/SMESH_I/SMESH_Filter_i.hxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_Gen_i_1.cxx
src/SMESH_I/SMESH_Group_i.cxx
src/SMESH_I/SMESH_MEDFamily_i.cxx
src/SMESH_I/SMESH_MEDFamily_i.hxx
src/SMESH_I/SMESH_MEDMesh_i.cxx
src/SMESH_I/SMESH_MEDMesh_i.hxx
src/SMESH_I/SMESH_MEDSupport_i.cxx
src/SMESH_I/SMESH_MEDSupport_i.hxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.hxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx
src/SMESH_I/SMESH_NoteBook.cxx
src/SMESH_I/SMESH_Pattern_i.cxx
src/SMESH_I/SMESH_PythonDump.hxx
src/SMESH_I/SMESH_subMesh_i.cxx
src/SMESH_I/SMESH_subMesh_i.hxx
src/SMESH_I/smeshpy.py
src/SMESH_SWIG/PAL_MESH_041_mesh.py
src/SMESH_SWIG/PAL_MESH_043_2D.py
src/SMESH_SWIG/PAL_MESH_043_3D.py
src/SMESH_SWIG/SMESH_AdvancedEditor.py
src/SMESH_SWIG/SMESH_BelongToGeom.py
src/SMESH_SWIG/SMESH_BuildCompound.py
src/SMESH_SWIG/SMESH_GroupFromGeom.py
src/SMESH_SWIG/SMESH_GroupFromGeom2.py
src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py
src/SMESH_SWIG/SMESH_Nut.py
src/SMESH_SWIG/SMESH_Partition1_tetra.py
src/SMESH_SWIG/SMESH_Sphere.py
src/SMESH_SWIG/SMESH_blocks.py
src/SMESH_SWIG/SMESH_box.py
src/SMESH_SWIG/SMESH_box2_tetra.py
src/SMESH_SWIG/SMESH_box3_tetra.py
src/SMESH_SWIG/SMESH_box_tetra.py
src/SMESH_SWIG/SMESH_controls.py
src/SMESH_SWIG/SMESH_demo_hexa2_upd.py
src/SMESH_SWIG/SMESH_fixation.py
src/SMESH_SWIG/SMESH_fixation_hexa.py
src/SMESH_SWIG/SMESH_fixation_netgen.py
src/SMESH_SWIG/SMESH_fixation_tetra.py
src/SMESH_SWIG/SMESH_flight_skin.py
src/SMESH_SWIG/SMESH_freebord.py
src/SMESH_SWIG/SMESH_hexaedre.py
src/SMESH_SWIG/SMESH_mechanic.py
src/SMESH_SWIG/SMESH_mechanic_editor.py
src/SMESH_SWIG/SMESH_mechanic_netgen.py
src/SMESH_SWIG/SMESH_mechanic_tetra.py
src/SMESH_SWIG/SMESH_reg.py
src/SMESH_SWIG/SMESH_shared_modules.py
src/SMESH_SWIG/SMESH_test.py
src/SMESH_SWIG/SMESH_test0.py
src/SMESH_SWIG/SMESH_test1.py
src/SMESH_SWIG/SMESH_test1_AndDisplay.py
src/SMESH_SWIG/SMESH_test2.py
src/SMESH_SWIG/SMESH_test3.py
src/SMESH_SWIG/SMESH_test4.py
src/SMESH_SWIG/SMESH_test5.py
src/SMESH_SWIG/batchmode_mefisto.py
src/SMESH_SWIG/batchmode_smesh.py
src/SMESH_SWIG/ex00_all.py
src/SMESH_SWIG/ex01_cube2build.py
src/SMESH_SWIG/ex02_cube2primitive.py
src/SMESH_SWIG/ex03_cube2partition.py
src/SMESH_SWIG/ex04_cube5tetraHexa.py
src/SMESH_SWIG/ex05_hole1build.py
src/SMESH_SWIG/ex06_hole1boolean.py
src/SMESH_SWIG/ex07_hole1partition.py
src/SMESH_SWIG/ex08_hole2build.py
src/SMESH_SWIG/ex09_grid4build.py
src/SMESH_SWIG/ex10_grid4geometry.py
src/SMESH_SWIG/ex11_grid3partition.py
src/SMESH_SWIG/ex12_grid17partition.py
src/SMESH_SWIG/ex13_hole1partial.py
src/SMESH_SWIG/ex14_cyl1holed.py
src/SMESH_SWIG/ex15_cyl2geometry.py
src/SMESH_SWIG/ex16_cyl2complementary.py
src/SMESH_SWIG/ex17_dome1.py
src/SMESH_SWIG/ex18_dome2.py
src/SMESH_SWIG/ex19_sphereINcube.py
src/SMESH_SWIG/ex21_lamp.py
src/SMESH_SWIG/ex24_cylinder.py
src/SMESH_SWIG/ex29_refine.py
src/SMESH_SWIG/ex30_groupsOp.py
src/SMESH_SWIG/ex30_tepal.py
src/SMESH_SWIG/ex31_dimGroup.py
src/SMESH_SWIG/smesh.py
src/SMESH_SWIG/smeshDC.py
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
src/StdMeshers/StdMeshers_FaceSide.cxx
src/StdMeshers/StdMeshers_FaceSide.hxx
src/StdMeshers/StdMeshers_Hexa_3D.cxx
src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
src/StdMeshers/StdMeshers_NumberOfSegments.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshersGUI/Makefile.am
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h
src/StdMeshersGUI/StdMeshers_images.ts
src/StdMeshersGUI/StdMeshers_msg_en.ts

index 7fde4754c2bb597fb906957716f800f8715a5a7b..736c5b5c8030cd8abc23a00462aa36163c9e7190 100644 (file)
@@ -44,15 +44,25 @@ AC_ARG_WITH(qwt_inc,
       AC_MSG_RESULT("select $withval as path to QWT includes")
     ])
 
+libqwt_name=qwt
 if test -z $QWTHOME; then
   AC_MSG_RESULT(QWTHOME not defined)
+  AC_MSG_NOTICE(Trying native Qwt...)
   exist_ok=no  
   if test "x$exist_ok" = "xno"; then
-     for d in /usr/local /usr ; do
-        AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exist_ok=yes,exist_ok=no)
+     for d in /usr /usr/local ; do
+        for extension in qwt-qt4 qwt; do
+           AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/lib${extension}.so,exist_ok=yes,exist_ok=no)
+           if test "x$exist_ok" = "xyes"; then
+              QWTHOME=$d
+              AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
+              libqwt_name=${extension}
+              dnl  break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+              break
+           fi
+        done
         if test "x$exist_ok" = "xyes"; then
-           QWTHOME=$d
-           AC_MSG_RESULT(libqwt.so detected in $d/lib)
+           break
         fi
      done
   fi
@@ -69,7 +79,10 @@ if test -z $QWTHOME; then
   fi
   if test "x$exist_ok" = "xyes"; then
      if test -z $QWT_INCDIR; then
-        QWT_INCDIR=$QWTHOME"/include/qwt"
+        QWT_INCDIR=$QWTHOME"/include/qwt-qt4"
+        if test ! -f $QWT_INCDIR/qwt.h ; then
+          QWT_INCDIR=/usr/include/qwt
+        fi
         if test ! -f $QWT_INCDIR/qwt.h ; then
           QWT_INCDIR=$QWTHOME"/include"
         fi
@@ -84,6 +97,7 @@ if test -z $QWTHOME; then
      qwt_ok=no
   fi
 else
+  AC_MSG_NOTICE(Trying Qwt from $QWTHOME ...)
   if test -z $QWT_INCDIR; then
      QWT_INCDIR="$QWTHOME/include"
   fi           
@@ -119,9 +133,9 @@ else
     LIBS_old=$LIBS
     LIBS="$LIBS $QT_LIBS"
     if test "x$QWTHOME" = "x/usr" ; then
-      LIBS="$LIBS -lqwt"
+      LIBS="$LIBS -l${libqwt_name}"
     else
-      LIBS="$LIBS -L$QWTHOME/lib -lqwt"
+      LIBS="$LIBS -L$QWTHOME/lib -l${libqwt_name}"
     fi
 
     CXXFLAGS_old=$CXXFLAGS
@@ -148,9 +162,9 @@ else
     else
       AC_MSG_RESULT(yes)
       if test "x$QWTHOME" = "x/usr" ; then
-        QWT_LIBS=" -lqwt"
+        QWT_LIBS=" -l${libqwt_name}"
       else
-        QWT_LIBS="-L$QWTHOME/lib -lqwt"
+        QWT_LIBS="-L$QWTHOME/lib -l${libqwt_name}"
       fi
     fi
 
index b3240bfa2bd8557ecc7c6566f7cf546cb13cb0ed..a25e5180bb331fbe48af8924c2641ddc8ed999e0 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 59e035781d54095b4f2701a0e1ca0a6d0d25199c..7f5e389b66336dfdb537322d361ff6210c50e11c 100644 (file)
@@ -26,7 +26,7 @@
 # Modified by : Alexander BORODIN (OCN) - autotools usage
 # Created from configure.in.base
 #
-AC_INIT([Salome2 Project SMESH module], [5.1.2], [webmaster.salome@opencascade.com], [SalomeSMESH])
+AC_INIT([Salome2 Project SMESH module], [5.1.3], [webmaster.salome@opencascade.com], [SalomeSMESH])
 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
@@ -87,7 +87,7 @@ dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairie
 
 echo
 echo ---------------------------------------------
-echo Coniguring production
+echo Configuring production
 echo ---------------------------------------------
 echo
 AC_ENABLE_DEBUG(yes)
diff --git a/doc/salome/gui/SMESH/images/2d_from_3d_menu.png b/doc/salome/gui/SMESH/images/2d_from_3d_menu.png
new file mode 100644 (file)
index 0000000..ec51172
Binary files /dev/null and b/doc/salome/gui/SMESH/images/2d_from_3d_menu.png differ
index cfafbc481785660cbda0a73d90770160a318896d..7988a9c85317916bf9b82054ac2793b7708fff22 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/blsurf_parameters.png and b/doc/salome/gui/SMESH/images/blsurf_parameters.png differ
index d29ecc497464f9a0f3106eef1ae8c30009de54a7..d317ced16e2eb9831604ba68d7336469cc8c600d 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png and b/doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png differ
diff --git a/doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png b/doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png
new file mode 100644 (file)
index 0000000..e55dec3
Binary files /dev/null and b/doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png differ
index 0d87e66089ccb6775838a1d640762fda1da21ffc..2b38197590c86d043083e5449add00cd839f55d0 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png and b/doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png differ
diff --git a/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png
new file mode 100644 (file)
index 0000000..c471743
Binary files /dev/null and b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png differ
diff --git a/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png
new file mode 100644 (file)
index 0000000..fc88570
Binary files /dev/null and b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png differ
index 4f36203ba8a7b1b6d20a19b1643853818b35bf3e..1d6b7c7a23c25dac58d3f9677070403c0072f653 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png and b/doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png differ
index 0cce50bb8bf7c93fcbbf19f1eb71c30e1ed7a573..cd92b45fc0317aed0952c14bbdbdf1a2a0850cf9 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png and b/doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png differ
diff --git a/doc/salome/gui/SMESH/images/hypo_quad_params_2.png b/doc/salome/gui/SMESH/images/hypo_quad_params_2.png
new file mode 100644 (file)
index 0000000..9f6fa25
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hypo_quad_params_2.png differ
diff --git a/doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png b/doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png
new file mode 100644 (file)
index 0000000..6dc37e2
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png differ
index c61d388a5d15a69ad2730bd2bf80062e2803acb6..aba2b65986184721dc951a633b2a2e3e97f1ca69 100644 (file)
@@ -199,31 +199,27 @@ minimum and maximum value of this parameter.
 \anchor fixed_points_1d_anchor
 <h2>Fixed points 1D hypothesis</h2>
 
-<b>Fixed points 1D</b> hypothesis allows to split edges into segments
-using set of fixed points given by normalized parameters on edge and
-set of numbers of segments for splitting each sub-segment between
-fixed points. Optionally it is possible to set flag
-<b>Same Nb. Segments for all intervals</b> and
-only one value for mentioned number of segments.
-
-The direction of the splitting is defined by the orientation of the
+<b>Fixed points 1D</b> hypothesis allows splitting edges through a
+set of points parameterized on the edge (from 1 to 0) and a number of segments for each
+interval limited by the points.
+
+\image html hypo_fixedpnt_dlg.png 
+
+It is possible to check in <b>Same Nb. Segments for all intervals</b> 
+option and to define one value for all intervals.
+
+The splitting direction is defined by the orientation of the
 underlying geometrical edge. <b>"Reverse Edges"</b> list box allows to
 specify the edges for which the splitting should be made in the
-direction opposing to their orientation. This list box is enabled only
-if the geometry object is selected for the meshing. In this case the
-user can select edges to be reversed either directly picking them in
-the 3D viewer or by selecting the edges or groups of edges in the
+direction opposite to their orientation. This list box is enabled only
+if the geometrical object is selected for meshing. In this case it is
+possible to select the edges to be reversed either directly picking them in
+the 3D viewer or selecting the edges or groups of edges in the
 Object browser.
 
-Using of this hypothesis for quadrangle face where main mesh is
-created using <b>Quadrangle(Mapping)</b> and <b>NumberOfSegments</b>
-hypothesises. Creation hypothesis <b>FixedPoint_1D</b> for submesh on
-one edge:
+\image html mesh_fixedpnt.png "Example of a submesh on the edge built using Fixed points 1D hypothesis"
 
-\image html hypo_fixedpnt_dlg.png
-
-Resulting 2D mesh:
-
-\image html mesh_fixedpnt.png
+<b>See Also</b> a sample TUI Script of a 
+\ref tui_fixed_points "Defining Fixed Points" hypothesis operation.
 
 */
index c912c568f5d5d84af67094bc7da5c8aba08de6ae..dd42e9962c130c5b30361c1751e2f5a1643db6ef 100644 (file)
@@ -23,6 +23,8 @@ which will compose the mesh of these 2D faces.
 
 \image html a-maxelarea.png
 
+\n
+
 \image html max_el_area.png "In this example, Max. element area is very small compared to the 1D hypothesis"
 
 <b>See Also</b> a sample TUI Script of a 
@@ -52,6 +54,18 @@ used as a degenerated edge.
 
 \image html hypo_quad_params_res.png "The resulting mesh"
 
+This hypothesis can be also used to mesh a segment of a circular face.
+Please, consider that there is a limitation on the selectiion of the degenerated
+vertex for the faces built with the angle > 180 degrees (see the picture).
+
+\image html hypo_quad_params_2.png "3/4 of a circular face"
+
+In this case, selection of a wrong vertex for the <b>Quadrangle parameters</b>
+hypothesis will generate a wrong mesh. The picture below
+shows the good (left) and the bad (right) results of meshing.
+
+\image html hypo_quad_params_res_2.png "The resulting meshes"
+
 <br>
 \anchor quadrangle_preference_anchor
 <h2>Quadrangle Preference</h2>
index 578823bd678e0dcc6ab451c06d55f6a68f90e971..cc8f5fd5287d0f6fce56e615c16c3d3b987a4a97 100644 (file)
@@ -28,6 +28,7 @@ them, you operate numerical values):
 <ul>
 <li>\ref max_element_area_anchor "Max Element Area"</li>
 <li>\ref length_from_edges_anchor "Length from Edges"</li>
+<li>\ref hypo_quad_params_anchor "Quadrangle Parameters"</li>
 <li>\ref quadrangle_preference_anchor "Quadrangle Preference"</li>
 <li>\ref triangle_preference_anchor "Triangle Preference"</li>
 </ul>
index 84e84cdcf3bf6b96f4ffc9268845d2a7646dd936..8a81c7ea0c26383801607913983f7a225a0c7440 100644 (file)
@@ -26,6 +26,7 @@ entities including:
 
 <ul>
 <li>\b Node &mdash; 0D object of a mesh presented by a point with coordinates (x, y, z).</li>
+<li>\b 0D element &mdash; element of a mesh defined by one node.</li>
 <li>\b Edge &mdash; 1D element of a mesh defined by two nodes.</li>
 <li>\b Face &mdash; 2D element of a mesh defined by three or four edges (closed contour).</li>
 <li>\b Volume &mdash; 3D element of a mesh defined by several faces.</li>
index 7549a121e00be21089f43e12901e58a70dbec847..a83a64f9f7f2f02b82e84c65569beae8f2890b9d 100644 (file)
@@ -47,7 +47,7 @@ tetrahedral (pyramidal) elements.</li>
 \image html image126.gif "Example of a hexahedral 3D mesh"
 </ul>
 
-\Note that BLSURF and GHS3D are commercial meshers and require a
+\note BLSURF and GHS3D are commercial meshers and require a
 license to be used within the Mesh module.
 
 There is also a number of more specific algorithms:
@@ -56,8 +56,7 @@ There is also a number of more specific algorithms:
 <li>\subpage radial_prism_algo_page "for meshing geometrical objects with cavities"</li>
 <li>\subpage segments_around_vertex_algo_page "for defining the local size of elements around a certain node"</li>
 <li>\subpage prism_3d_algo_page "for meshing prismatic shapes"</li>
-<li>\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d
-faces (circles and part of circles)"</li>
+<li>\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d faces (circles and part of circles)"</li>
 </ul>
 
 \ref constructing_meshes_page "Constructing meshes" page describes in
index ecbd5a74f0db34bed0bd3615846d91b855fb77da..03c0fc5946a986bff218a70739defc427d09856d 100644 (file)
@@ -5,6 +5,8 @@
 \n BLSURF Parameters hypothesis works only with <b>BLSURF</b> 2d
 algorithm. This algorithm is a commercial software.
 
+<h1>General parameters</h1>
+
 \image html blsurf_parameters.png
 
 <ul>
@@ -53,6 +55,8 @@ two adjacent edges. </li>
 edges are not respected and all geometrical faces are meshed as one
 hyper-face.</li>
 
+<h1>Advanced parameters</h1>
+
 \image html blsurf_parameters_advanced.png
 
 <li><b>Topology</b> - allows creation of a conform mesh on a shell of
@@ -83,12 +87,12 @@ the diagonal of the bounding box of the geometrical object to mesh.
 
 <ul>
 <li><b>topo_eps1</b> (real) - is the tolerance level inside a CAD
-patch. By default is equal to <i>diag</i> × 10-4. This tolerance is used to
+patch. By default is equal to <i>diag</i>  10-4. This tolerance is used to
 identify nodes to merge within one geometrical face when \b Topology
 option is to pre-process. Default is <i>diag</i>/10.0.</li>
 
 <li><b>topo_eps2</b> (real) - is the tolerance level between two CAD
-patches. By default is equal to <i>diag</i> × 10-4. This tolerance is used to
+patches. By default is equal to <i>diag</i>  10-4. This tolerance is used to
 identify nodes to merge over different geometrical faces when
 \b Topology option is to pre-process. Default is <i>diag</i>/10.0.</li>
 
@@ -199,24 +203,37 @@ String variables:
 <li>    import_option  </li>  
 </ul>
 
+<h1>Custom size map</h1>
+
 \image html blsurf_parameters_sizemap.png
 
-It is possible to define user sizes on faces, edges or verteces.
+User sizes can be defined on faces, edges or vertices.
 <ul>
-<li>Those faces, edges and verteces must be sub-shapes (from explode command) of the meshed geometry object.</li>
-<li>Groups are currently not handled.</li>
-<li>Multi-selection is possible.</li>
-<li>The sizes are constant values.</li>
+<li>The faces, edges and vertices can belong to the meshed geometrical
+object or to its sub-shapes (created using <b>Explode</b> command).</li>
+<li>Groups of faces, edges and vertices are also handled.</li>
+<li>It is possible to attribute the same size to several geometries using multi-selection.</li>
+<li>The sizes are constant values or python functions.</li>
+<li>In case of a python function, the following rules must be respected:
+<ul>
+<li>The name of the function is f.</li>
+<li>If geometry is a face or a group of faces, the function is f(u,v).</li>
+<li>If geometry is an edge or a group of edges, the function is f(t).</li>
+<li>If geometry is a vertex or a group of vertices, the function is f().</li>
+<li>The function must return a double.</li>
+</ul></li>
 </ul>
 
 <br><b>See Also</b> a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including size map.
 
 \anchor blsurf_sizemap_computation
 <h2>Computation of the physical size</h2>
-Here is the detail on the calculation of the size (from BLSurf documentation).
 \n
-The size is obtained by querying sizemap functions associated to the input CAD object for surfaces, curves and points.
-Each function can either return a value h (which is then trimmed between the two bounds hphymin and hphymax), or "no answer" (by not assigning a value to h), thus providing great flexibility in the specification of the sizes. The computation depends whether point P is internal to a surface, internal to a curve, or at the end of several curves:
+The physical size is obtained by querying sizemap functions associated to the input CAD object for surfaces, curves and points.
+Each function can either return a value h (which is then trimmed
+between the two bounds hphymin and hphymax), or "no answer" (by not
+assigning a value to h), thus providing great flexibility in the
+specification of the sizes. The computation depends on whether point P is internal to a surface, internal to a curve, or at the end of several curves:
 <ul>
 <li> If point P is internal to a surface, the CAD surface size function is queried. If no answer is returned, one interpolates with the values at the vertices of the discretized interface curves.</li>
 <li> If point P is internal to a curve, the CAD curve size function is queried first. If no answer is returned, the surface size function is queried for every adjacent surface and the mean value of the returned values is computed. If no answer is returned, sizes h1 and h2 at both ends of the curve are considered (see next item) and the interpolated value is computed.</li>
@@ -225,7 +242,23 @@ Each function can either return a value h (which is then trimmed between the two
 In order to compute the mean of several values, the arithmetic mean is used by default, but this can be modified by the parameter \ref blsurf_hmean_flag "hmean flag". In the same way, in order to interpolate two values, a linear interpolation is used by default, but this can be modified by \ref blsurf_hinterpol_flag "hinterpol flag".
 
 
-\n
+<h1>Custom enforced vertices</h1>
+
+\image html blsurf_parameters_enforced_vertices.png
+
+It is possible to define some enforced vertices to BLSurf algorithm
+without creating any vertices by CAD algorithms.
+<ul>
+<li>The enforced vertex is the projection of a point defined by its
+(x,y,z) coordinates on the selected face.</li>
+<li>It is possible to define several enforced vertices on a face or a group of faces.</li>
+<li>If the projected point is on the boundary or outside of the face, it will be ignored.</li>
+</ul>
+
+<br><b>See Also</b> a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including enforced vertices.
+
+<h1>Limitations</h1>
+
 Currently BLSURF plugin has the following limitations.
 <ul>
   <li>The created mesh will contain inverted elements if it is based on a shape,
index faf636b824c7dc934b9c31fa9e4f5b1575d09d16..98a20c470fcfc6443d4b45339683f8151287c8ec 100644 (file)
@@ -47,4 +47,6 @@ for this operation.</li>
 
 \image html image160.gif "Example of a compound of two meshed cubes"
 
+<b>See Also</b> a sample 
+\ref tui_building_compound "TUI Example of building compounds."
 */
index be7def6a80bdd1a879544fd5cb9e7b413bc8d288..625cff3bd1d510418a3a85d2e758cfee0478f724 100644 (file)
@@ -126,7 +126,7 @@ visualizing the geometrical entity that causes it.
 
 \image html failed_computation.png "Example of the invalid input mesh"
 
-\Note Mesh Computation Information box does not appear if you set
+\note Mesh Computation Information box does not appear if you set
 "Mesh computation/Show a computation result notification" preference 
 to the "Never" value. This option gives the possibility to control mesh
 computation reporting. There are the following possibilities: always
index 072a91f7a2340e80faad891b883f5d03e52c2e97..5409f487e78c64c7ae7b030b4c05a36790111a5a 100644 (file)
@@ -37,4 +37,6 @@ The following dialog box will appear:
 <li>Click the \b Apply or \b OK button.</li>
 </ol>
 
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of a \ref tui_quadratic "Convert to/from quadratic" operation.
+
+*/
index b5031468ae0ad0e2387ff0da04a87eaf08439b0a..6cbe5ceb4b0a6482afa6d7e0ddab2135a3965ce6 100644 (file)
@@ -2,7 +2,7 @@
 
 \page editing_groups_page Editing groups
 
-\n <em>To edit an existing group of elements:</em>
+<em>To edit an existing group of elements:</em>
 <ol>
 <li>Select your group in the Object Browser and in the \b Mesh menu click
 the <b>Edit Group</b> item or <em>"Edit Group"</em> button in the toolbar.</li>
@@ -17,11 +17,12 @@ The following dialog box will appear:
 In this dialog box you can modify the name of your group and add or
 remove the elements forming it. For more information see 
 \ref creating_groups_page "Creating Groups" page.
+
 <li>Click the \b Apply or <b>Apply and Close</b> button to confirm modification of the
 group.</li>
 </ol>
 
-\n <em>To convert an existing group on geometry into standalone group
+<em>To convert an existing group on geometry into standalone group
 of elements and modify:</em>
 <ol>
 <li>Select your group on geometry in the Object Browser and in the \b Mesh menu click
@@ -31,11 +32,12 @@ the <b>Edit Group as Standalone</b> item.</li>
 <center><em>"Edit Group as Standalone" button</em></center>
 
 The group on geometry will be converted into standalone group and can
-be modified as group of elements
+be modified as group of elements.
+
 <li>Click the \b Apply or <b>Apply and Close</b> button to confirm modification of the
 group.</li>
+</ol>
 
-<br><b>See Also</b> a sample TUI Script of an 
-\ref tui_edit_group "Edit Group" operation.  
+\sa A sample TUI Script of an \ref tui_edit_group "Edit Group" operation.  
 
 */
index 0c852f32c9e903d02afb0e095103fc80dede0b3b..d35caa9ac459eba2d14e68db3ca128462e1f7b44 100644 (file)
@@ -2,16 +2,17 @@
 
 \page free_faces_page Free faces
 
-\n This mesh quality control highlights the faces connected to
+This mesh quality control highlights the faces connected to
 less than two mesh volume elements. The free faces are shown with a
 color different from the color of shared faces.
 
 \image html free_faces.png
-<center>In this picture some volume mesh elements have been removed, as
+
+In this picture some volume mesh elements have been removed, as
 a result some faces became connected only to one
 volume. i.e. became free.
 
-<br><b>See Also</b> a sample TUI Script of a 
-\ref tui_free_faces "Free Faces quality control" operation.  
+\sa A sample TUI Script of a \ref tui_free_faces "Free Faces quality control"
+operation.
 
 */
index 1caaf9e4ba50aff976e4a0546a37538abe063dfb..8a06fe3de7cc8b100da3d921af7d89dd8eee9eb1 100644 (file)
@@ -2,14 +2,15 @@
 
 \page free_nodes_page Free nodes
 
-\n This mesh quality control highlights the nodes which are not connected
+This mesh quality control highlights the nodes which are not connected
 to any  mesh element. 
 
 \image html free_nodes.png
-<center>In this picture some nodes are not connected to any mesh
+
+In this picture some nodes are not connected to any mesh
 element after deleting some elements and adding several isolated nodes.
 
-<br><b>See Also</b> a sample TUI Script of a 
-\ref tui_free_nodes "Free Nodes quality control" operation.  
+\sa A sample TUI Script of a \ref tui_free_nodes "Free Nodes quality control"
+operation.
 
 */
index 414e342fa454ba5e5681ced54abf96df445dbf0c..eb4b981b65b88bb212bf12111fe486223a77941f 100644 (file)
@@ -5,6 +5,8 @@
 \n GHS3D Parameters hypothesis works only with <b>Tetrahedron (GHS3D)</b> 
 algorithm. This algorithm is a commercial software.
 
+<h1>General parameters</h1>
+
 \image html ghs3d_parameters_basic.png
 
 <ul>
@@ -21,6 +23,8 @@ optimization level: none, light, medium or strong. Higher level of
 optimisation provides better mesh, but can be time-consuming.
 </li>
 
+<h1>Advanced parameters</h1>
+
 \image html ghs3d_parameters_advanced.png
 
 <li><b>Maximum memory size</b> - launches ghs3d software with
@@ -52,6 +56,20 @@ together with the characteristics of the final mesh.
 <li><b>To create new nodes</b> - if this option is checked off, ghs3d
 tries to create tetrahedrons using only the nodes of the 2D mesh.</li>
 
+<li><b>To remove the initial central point</b> TetMesh-GHS3D adds an internal point 
+at the gravity centre of the bounding box to speed up and to simplify 
+the meshing process. However, it is possible to refrain from creating 
+this point by using the command line option -no initial central point. This can be
+particularly useful to generate a volume mesh without internal points at all and in some rare cases
+at the boundary regeneration phase when it is impossible to proceed
+with the standard options
+(for example, when one dimension of the domain is more than 20 times greater than the other two).
+Use this option if the boundary regeneration has failed with the standard parameters and before using
+the recovery version (command line option -C).
+Note: when using this option, the speed of the meshing process may
+decrease, and the quality may change.
+Note: the boundary regeneration may fail with this option, in some rare cases.</li>
+
 <li><b>To use boundary recovery version</b> - enables using a
 boundary recovery module which tries to
 create volume meshes starting from very poor quality surface meshes
@@ -61,9 +79,38 @@ resulting volume mesh will however most likely have a very poor
 quality (poor aspect ratio of elements, tetrahedra with a very small
 positive volume).</li>
 
-<li><b>Option as text</b> - allows input of any text as command line
-for ghs3d. This allows the input of advanced options in a free from. </li>
+<li><b>To use FEM correction</b> - Applies finite-element correction by 
+replacing overconstrained elements where it is possible. At first the process 
+slices the overconstrained edges and at second the overconstrained 
+facets. This ensures that there are no edges with two boundary
+vertices and that there are no facets with three boundary vertices. TetMesh-GHS3D gives the initial 
+and final overconstrained edges and facets. It also gives the facets
+which have three edges on the boundary.
+Note: when using this option, the speed of the meshing process may 
+decrease, quality may change, and the smallest volume may be smaller.
+By default, the FEM correction is not used.</li>
+
+<li><b>Option as text</b> - allows to input in the command line any text
+for ghs3d, for example, advanced options. </li>
+
+</ul>
+
 
+<h1>Enforced vertices</h1>
+
+\image html ghs3d_enforced_vertices.png
+
+GHS3D algorithm can locally make the mesh finer. It is possible to define enforced vertices in the volume where the mesh will be detailed.
+
+A node will be created at the enforced vertex coordinates. There is no need to create a vertex in CAD.
+
+An enforced vertex is defined by:
+<ul>
+<li>The (x,y,z) cartesian coordinates</li>
+<li>A constant physical size</li>
 </ul>
 
-*/
\ No newline at end of file
+<br><b>See Also</b> a sample TUI Script of the \ref tui_ghs3d "creation of a Ghs3D hypothesis", including enforced vertices.
+
+
+*/
index f5c7fed67b091f83a1403ce5b78b796e7a99cb67..638d701123e6c386cd21f8f735d1ea32598c3cde 100644 (file)
@@ -12,19 +12,15 @@ dialog.</li>
 <li> by creating a group of elements of the selected type from all
 such elements of the chosen geometrical object - <b>Group on
 geometry</b> tab of  \ref creating_groups_page "Create group" dialog.</li>
-
 <li> by creating a group including all types of elements from an
 existing geometrical object - using \subpage create_groups_from_geometry_page "Create Groups from Geometry" dialog.</li>
-
 <li> by creating several groups of elements (nodes,
 edges, faces and volumes) from the chosen submesh - using <b>Mesh -> Construct
 Group</b> Menu item. In this case groups of elements are created
 automatically.</li>
-
 <li> by creating groups of entities from existing groups of superior
 dimensions - using \subpage group_of_underlying_elements_page "Create Group of Underlying Elements"
 dialog.</li>
-
 </ul>
 
 
@@ -32,12 +28,12 @@ The created groups can be later:
 
 <ul>
 <li>\subpage editing_groups_page "Edited"</li>
-<li>\subpage using_operations_on_groups_page "Subjected to Boolean operations", or</li>
+<li>\subpage using_operations_on_groups_page "Subjected to Boolean operations"</li>
 <li>\subpage deleting_groups_page "Deleted"</li>
 </ul>
 
 An important tool, providing filters for creation of \b Standalone
-groups is  \subpage selection_filter_library_page</li>.
+groups is \subpage selection_filter_library_page.
 
 
 */
diff --git a/doc/salome/gui/SMESH/input/make_2dmesh_from_3d.doc b/doc/salome/gui/SMESH/input/make_2dmesh_from_3d.doc
new file mode 100644 (file)
index 0000000..f4b5b2b
--- /dev/null
@@ -0,0 +1,22 @@
+/*!
+
+\page make_2dmesh_from_3d_page Generate the skin elements (2D) of a mesh having 3D elements
+
+\n This functionality allows to generate 2D mesh elements as a skin
+on the existing 3D mesh elements.
+
+<em>To generate 2D mesh:</em>
+<ol>
+<li>From the Modification menu choose "Create 2D mesh from 3D"
+item, or choose from the popup menu.
+
+\image html 2d_from_3d_menu.png
+
+The algorithm detects boundary volume faces without connections to
+other volumes and creates 2D mesh elements on face nodes. If the mesh
+already contains 2D elements on the detected nodes, new elements are not
+created. The the resulting dialog shows mesh information statistics
+about the newly created 2D mesh elements.
+</ol>
+
+*/
index 75b934c2e136c94e82f83aa363c81cd5596fd926..7b855c42cf4371aae8974978d475bfbbf741c566 100644 (file)
@@ -44,11 +44,6 @@ The following information will be displayed:
 
 \image html advanced_mesh_infos.png
 
-In case you get Mesh Infos via a \ref tui_viewing_mesh_infos "TUI script", 
-the information is displayed in Python Console.
-
-\image html b-mesh_infos.png
-
 <br>
 \anchor mesh_element_info_anchor
 <h2>Mesh Element Info</h2> 
@@ -61,4 +56,7 @@ the Viewer.
 
 \image html eleminfo2.png 
 
+In case you get Mesh Infos via a TUI script the information is displayed in Python Console.
+<b>See the</b> \ref tui_viewing_mesh_infos "TUI Example", 
+
 */
\ No newline at end of file
index f7a882524d15d3fb60613471d0e450dc7898a8cb..cf63ff5f4a8c346743cea2e952da3d6b4dc253ea 100644 (file)
@@ -45,9 +45,11 @@ of the selected node or edge.</li>
 <li>Apply \subpage pattern_mapping_page "pattern mapping".</li>
 <li>\subpage convert_to_from_quadratic_mesh_page "Convert regular mesh to quadratic", 
 or vice versa.</li>
+<li>\subpage make_2dmesh_from_3d_page "Create 2D mesh from 3D".</li>
+
 </ul>
 
 \note It is possible to use the variables defined in the SALOME \b NoteBook
  to specify the numerical parameters used for modification of any object.
 
-*/
\ No newline at end of file
+*/
index 0c872d32bb780c25ce7332de3469017664243eb2..bbb7c59ff4b8e92c59dc1af89eea92363e6aaaa9 100644 (file)
@@ -2,7 +2,7 @@
 
 \page netgen_2d_3d_hypo_page Netgen 2D and 3D hypotheses
 
-\n <b>Netgen 2D</b> and <b>Netgen 3D</b> hypotheses work only with <b>Netgen 1D-2D</b> and
+<b>Netgen 2D</b> and <b>Netgen 3D</b> hypotheses work only with <b>Netgen 1D-2D</b> and
 <b>Netgen 1D-2D-3D</b> algorithms. These algorithms do not require
 definition of lower-level  hypotheses and algorithms (2D and 1D for
 meshing 3D objects and 1D for meshing 2D objects). They prove to be
@@ -11,68 +11,64 @@ of the meshed object.
 
 \image html netgen2d.png
 
-<ul>
-<li><b>Name</b> - allows to define the name for the algorithm (Netgen
-2D (or 3D) Parameters by default).</li>
-<li><b>Max Size</b> - maximum linear dimensions for mesh cells.</li>
-<li><b>Second Order</b> - if this box is checked in, the algorithm will
+- <b>Name</b> - allows to define the name for the algorithm (Netgen
+2D (or 3D) Parameters by default).
+- <b>Max Size</b> - maximum linear dimensions for mesh cells.
+- <b>Second Order</b> - if this box is checked in, the algorithm will
 create second order nodes on the mesh, which actually will become
-\ref adding_quadratic_elements_page "Quadratic".</li>
-<li><b>Fineness</b> - ranging from Very Coarse to Very Fine allows to set the
+\ref adding_quadratic_elements_page "Quadratic".
+<b>Fineness</b> - ranging from Very Coarse to Very Fine allows to set the
 level of meshing detalization using the three parameters below. You
-can select Custom to define them manually.</li>
-<li><b>Growth rate</b> - allows to define how much the linear dimensions of
-two adjacent cells can differ (i.e. 0.3 means 30%).</li>
-<li><b>Nb. Segs per Edge</b> and <b>Nb Segs per Radius</b> - allows to define the
+can select Custom to define them manually.
+<b>Growth rate</b> - allows to define how much the linear dimensions of
+two adjacent cells can differ (i.e. 0.3 means 30%).
+<b>Nb. Segs per Edge</b> and <b>Nb Segs per Radius</b> - allows to define the
 minimum number of mesh segments in which edges and radiuses will be
-split.</li>
-<li><b>Allow Quadrangles</b> - allows to use quadrangle elements in a
+split.
+<b>Allow Quadrangles</b> - allows to use quadrangle elements in a
 triangle 2D mesh. This checkbox is not present in Netgen 3D parameters
 because currently building a tetrahedral mesh with quadrangle faces is
-not possible.</li>
-<li><b>Optimize</b> - if this box is checked in, the algorithm will try to
-create regular (possessing even sides) elements.</li>
-</ul>
+not possible.
+- <b>Optimize</b> - if this box is checked in, the algorithm will try to
+create regular (possessing even sides) elements.
 
 \image html netgen3d_simple.png
 
-<b>Netgen 2D simple parameters</b> and <b>Netgen 3D simple parameters</b> allow defining the size of elements for each dimension. <br>
+<b>Netgen 2D simple parameters</b> and <b>Netgen 3D simple
+parameters</b> allow defining the size of elements for each
+dimension.
 
 \b 1D group allows defining the size of 1D elements in either of two ways: 
-<ul>
-<li><b>Number of Segments</b> has the same sense as \ref
+- <b>Number of Segments</b> has the same sense as \ref
 number_of_segments_anchor "Number of segments" hypothesis with
-equidistant distribution.</li>
-<li><b>Average Length</b> has the same sense as \ref 
-average_length_anchor "Average Length" hypothesis.</li>
-</ul>
+equidistant distribution.
+- <b>Average Length</b> has the same sense as \ref 
+average_length_anchor "Average Length" hypothesis.
 
 \b 2D group allows defining the size of 2D elements 
-<ul>
-<li><b>Length from edges</b> if checked in, acts like \ref
-length_from_edges_anchor "Length from Edges" hypothesis, else </li>
-<li><b>Max. Element Area</b> defines the maximum element area like \ref
-max_element_area_anchor "Max Element Area" hypothesis. </li>
-</ul>
+- <b>Length from edges</b> if checked in, acts like \ref
+length_from_edges_anchor "Length from Edges" hypothesis, else
+- <b>Max. Element Area</b> defines the maximum element area like \ref
+max_element_area_anchor "Max Element Area" hypothesis.
 
 \b 3D groups allows defining the size of 3D elements.
-<ul>
-<li><b>Length from faces</b> if checked in, the area of sides of
-volumic elements will be equal to an average area of 2D elements, else </li>
-<li><b>Max. Element Volume</b> defines the maximum element volume like
+- <b>Length from faces</b> if checked in, the area of sides of
+volumic elements will be equal to an average area of 2D elements, else
+- <b>Max. Element Volume</b> defines the maximum element volume like
 \ref max_element_volume_hypo_page "Max Element Volume"
-hypothesis.</li>
-<ul>
+hypothesis.
 
-\n Note that Netgen algorithm does not strictly follow the input
-parameters. The actual mesh can be more or less dense than required. There are several factors in it:
-<ol>
-<li> NETGEN does not actually use "NbOfSegments" parameter for discretization of
-edge. This parameter is used  only to define the local element size (size at the given point), so local sizes of adjacent edges influence each other. </li>
-<li> NETGEN additionally restricts the element size according to edge curvature.</li>
-<li> The local size of edges influences the size of close triangles.</li>
-<li> The order of elements and their size in the 1D mesh generated by
+\note Netgen algorithm does not strictly follow the input
+parameters. The actual mesh can be more or less dense than
+required. There are several factors in it:
+- NETGEN does not actually use "NbOfSegments" parameter for discretization of
+edge. This parameter is used  only to define the local element size
+(size at the given point), so local sizes of adjacent edges influence
+each other.
+- NETGEN additionally restricts the element size according to edge curvature.
+- The local size of edges influences the size of close triangles.
+- The order of elements and their size in the 1D mesh generated by
 NETGEN differ from those in the 1D mesh generated by Regular_1D
-algorithm, resulting in different 2D and 3D meshes.</li>
-</ol>
-*/
\ No newline at end of file
+algorithm, resulting in different 2D and 3D meshes.
+
+*/
index 837923ac1ce8afa4432f89c356aa2d5b322a685a..5589ba3a761c8199ea4716deab69ce9cacb9ad88 100644 (file)
@@ -4,9 +4,9 @@
 
 3D extrusion algorithm can be used for meshing prisms, i.e. <b>3D Shapes</b>
 defined by two opposing faces having the same number of vertices and
-edges and meshed using the \ref projection_algos_page "2D Projection"
-algorithm. These two faces should be connected by quadrangle "side"
-faces.
+edges and meshed using, for example,  the \ref projection_algos_page
+"2D Projection" algorithm. These two faces should be connected by
+quadrangle "side" faces.
 
 The opposing faces can be meshed with either quadrangles or triangles,
 while the side faces should be meshed with quadrangles only.
@@ -17,4 +17,8 @@ As you can see, the <b>3D extrusion</b> algorithm permits to build and to
 have in the same 3D mesh such elements as hexahedrons, prisms and
 polyhedrons.
 
-*/
\ No newline at end of file
+\note This algorithm works correctly only if the opposing faces have
+the same (or similar) meshing topography. Otherwise, 3D extrusion
+algorithm can fail to build mesh volumes.
+
+*/
index 4436e092b8eba346290305133d44a6c2638b798d..9f54f3eefae244f7ba3b5dffea4c5e44c9487473 100644 (file)
@@ -2,27 +2,21 @@
 
 \page radial_quadrangle_1D2D_algo_page Radial Quadrangle 1D2D
 
-\n This algorithm applies to the meshing of a 2D shapes.
-Required conditions: Face must be a full circle or part of circle
-(i.e. number of edges <= 3 and one of them must be a circle curve).
-The resulting mesh consists of triangles (near center point) and
+\n This algorithm applies to the meshing of 2D shapes under the
+following conditions: the face must be a full circle or a part of circle
+(i.e. the number of edges is less or equal to 3 and one of them is a circle curve).
+The resulting mesh consists of triangles (near the center point) and
 quadrangles.
 
-This algorithm also requires the information concerning the number and
-distribution of mesh layers alond a radius of circle. Distribution of
-layers can be set with any of 1D Hypotheses.
-
-Creation hypothesis:
+This algorithm requires the hypothesis indicating the number
+of mesh layers along the radius. The distribution of layers can be set with any 1D Hypothesis.
 
 \image html hypo_radquad_dlg.png
 
-Resulting 3D mesh for the cylinder with <b>RadialQuadrangle_1D2D</b>
-hypothesis for top and bottom faces:
-
-\image html mesh_radquad_01.png
+\image html mesh_radquad_01.png "Radial Quadrangle 2D mesh on the top and the bottom faces of a cylinder"
 
-Resulting 2D mesh for the part of circle:
+\image html mesh_radquad_02.png "Radial Quadrangle 2D mesh on a part of circle"
 
-\image html mesh_radquad_02.png
+\sa A sample \ref tui_radial_quadrangle "TUI Script".
 
 */
index efbafc617780272084b5b0428da17f736c7c9cd6..e0fe78ec95ef9110c4548444ac3173422b64ddd5 100644 (file)
 
 \page smeshpy_interface_page Python interface
 
-\n Python package smesh defines several classes, destined for easy and
+Python package smesh defines several classes, destined for easy and
 clear mesh creation and edition.
 
-\n Documentation for smesh package is available in two forms:
-
-\n The <a href="smeshpy_doc/modules.html"> structured
-   documentation for smesh package</a>, where all methods and
-   classes are grouped by their functionality, like it is done in the GUI documentation
-\n and the \ref smeshDC "linear documentation for smesh package"
-   grouped only by classes, declared in the smesh.py file.
-
-\n The main page of the \ref smeshDC "linear documentation for smesh package"
-   contains a list of data structures and a list of
-   functions, provided by the package smesh.py. The first item in
-   the list of data structures (\ref smeshDC::smeshDC "class smesh")
-   also represents documentation for the methods of the package smesh.py itself.
-
-\n The package smesh.py provides an interface to create and handle
-   meshes. Use it to create an empty mesh or to import it from the data file.
-
-\n Once a mesh has been created, it is possible to  manage it via its own
-   methods, described at \ref smeshDC::Mesh "class Mesh" documentation
-   (it is also accessible by the second item "class Mesh" in the list of data structures).
-
-\n Class Mesh allows assigning algorithms to a mesh.
-\n Please note, that some algorithms,
-   included in the standard Salome installation are always available:
-      - REGULAR(1D), COMPOSITE(1D), MEFISTO(2D), Quadrangle(2D), Hexa(3D), etc.
-
-\n There are also some algorithms, which can be installed optionally,
-\n some of them are based on open-source meshers:
-         - NETGEN(1D-2D,2D,1D-2D-3D,3D),
-
-\n others are based on commercial meshers:
-         - GHS3D(3D), BLSURF(2D).
-
-\n    To add hypotheses, use the interfaces, provided by the assigned
+Documentation for smesh package is available in two forms:
+
+The <a href="smeshpy_doc/modules.html"> structured
+documentation for smesh package</a>, where all methods and
+classes are grouped by their functionality, like it is done in the GUI documentation
+and the \ref smeshDC "linear documentation for smesh package"
+grouped only by classes, declared in the smesh.py file.
+
+The main page of the \ref smeshDC "linear documentation for smesh package"
+contains a list of data structures and a list of
+functions, provided by the package smesh.py. The first item in
+the list of data structures (\ref smeshDC::smeshDC "class smesh")
+also represents documentation for the methods of the package smesh.py itself.
+
+The package smesh.py provides an interface to create and handle
+meshes. Use it to create an empty mesh or to import it from the data file.
+
+Once a mesh has been created, it is possible to  manage it via its own
+methods, described at \ref smeshDC::Mesh "class Mesh" documentation
+(it is also accessible by the second item "class Mesh" in the list of data structures).
+
+Class \b Mesh allows assigning algorithms to a mesh.
+Please note, that some algorithms, included in the standard SALOME
+distribution are always available:
+- REGULAR (1D)
+- COMPOSITE (1D)
+- MEFISTO (2D)
+- Quadrangle (2D)
+- Hexa(3D)
+- etc...
+
+There are also some algorithms, which can be installed optionally,
+some of them are based on open-source meshers:
+- NETGEN (1D-2D, 2D, 1D-2D-3D, 3D)
+
+... and others are based on commercial meshers:
+- GHS3D (3D)
+- BLSURF (2D)
+
+To add hypotheses, use the interfaces, provided by the assigned
 algorithms.
 
-\n Below you can see an example of usage of the package smesh for 3d mesh generation. 
+Below you can see an example of usage of the package smesh for 3d mesh generation. 
 
+\anchor example_3d_mesh
 <h2>Example of 3d mesh generation with NETGEN:</h2>
 
-\n from geompy import * 
-\n import smesh 
+\code
+from geompy import * 
+import smesh 
 
-<b># Geometry</b>
-\n <b># an assembly of a box, a cylinder and a truncated cone meshed with tetrahedral</b>. 
+###
+# Geometry: an assembly of a box, a cylinder and a truncated cone
+# meshed with tetrahedral 
+###
 
-<b># Define values</b>
-\n name = "ex21_lamp" 
-\n cote = 60 
-\n section = 20 
-\n size = 200 
-\n radius_1 = 80 
-\n radius_2 = 40 
-\n height = 100 
+# Define values
+name = "ex21_lamp" 
+cote = 60 
+section = 20 
+size = 200 
+radius_1 = 80 
+radius_2 = 40 
+height = 100 
 
-<b># Build a box</b>
-\n box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote) 
+# Build a box
+box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote) 
 
-<b># Build a cylinder</b>
-\n pt1 = MakeVertex(0, 0, cote/3) 
-\n di1 = MakeVectorDXDYDZ(0, 0, 1) 
-\n cyl = MakeCylinder(pt1, di1, section, size) 
+# Build a cylinder
+pt1 = MakeVertex(0, 0, cote/3) 
+di1 = MakeVectorDXDYDZ(0, 0, 1) 
+cyl = MakeCylinder(pt1, di1, section, size) 
 
-<b># Build a truncated cone</b>
-\n pt2 = MakeVertex(0, 0, size) 
-\n cone = MakeCone(pt2, di1, radius_1, radius_2, height) 
+# Build a truncated cone
+pt2 = MakeVertex(0, 0, size) 
+cone = MakeCone(pt2, di1, radius_1, radius_2, height) 
 
-<b># Fuse </b>
-\n box_cyl = MakeFuse(box, cyl) 
-\n piece = MakeFuse(box_cyl, cone) 
+# Fuse
+box_cyl = MakeFuse(box, cyl) 
+piece = MakeFuse(box_cyl, cone) 
 
-<b># Add in study</b>
-\n addToStudy(piece, name) 
+# Add to the study
+addToStudy(piece, name) 
 
-<b># Create a group of faces</b>
-\n group = CreateGroup(piece, ShapeType["FACE"]) 
-\n group_name = name + "_grp" 
-\n addToStudy(group, group_name) 
-\n group.SetName(group_name) 
+# Create a group of faces
+group = CreateGroup(piece, ShapeType["FACE"]) 
+group_name = name + "_grp" 
+addToStudy(group, group_name) 
+group.SetName(group_name) 
 
-<b># Add faces in the group</b>
-\n faces = SubShapeAllIDs(piece, ShapeType["FACE"]) 
-\n UnionIDs(group, faces) 
+# Add faces to the group
+faces = SubShapeAllIDs(piece, ShapeType["FACE"]) 
+UnionIDs(group, faces) 
 
-<b># Create a mesh</b>
+###
+# Create a mesh
+###
 
-<b># Define a mesh on a geometry</b>
-\n tetra = smesh.Mesh(piece, name) 
+# Define a mesh on a geometry
+tetra = smesh.Mesh(piece, name) 
 
-<b># Define 1D hypothesis</b>
-\n algo1d = tetra.Segment() 
-\n algo1d.LocalLength(10) 
+# Define 1D hypothesis
+algo1d = tetra.Segment() 
+algo1d.LocalLength(10) 
 
-<b># Define 2D hypothesis</b>
-\n algo2d = tetra.Triangle() 
-\n algo2d.LengthFromEdges() 
+# Define 2D hypothesis
+algo2d = tetra.Triangle() 
+algo2d.LengthFromEdges() 
 
-<b># Define 3D hypothesis</b>
-\n algo3d = tetra.Tetrahedron(smesh.NETGEN) 
-\n algo3d.MaxElementVolume(100) 
+# Define 3D hypothesis
+algo3d = tetra.Tetrahedron(smesh.NETGEN) 
+algo3d.MaxElementVolume(100) 
 
-<b># Compute the mesh</b>
-\n tetra.Compute() 
+# Compute the mesh
+tetra.Compute() 
 
-<b># Create a groupe of faces</b>
-\n tetra.Group(group)
+# Create a groupe of faces
+tetra.Group(group)
 
-\n Examples of Python scripts for all Mesh operations are available by
-the following links:
+\endcode
 
-<ul>
-<li>\subpage tui_creating_meshes_page</li>
-<li>\subpage tui_viewing_meshes_page</li>
-<li>\subpage tui_defining_hypotheses_page</li>
-<li>\subpage tui_quality_controls_page</li>
-<li>\subpage tui_grouping_elements_page</li>
-<li>\subpage tui_modifying_meshes_page</li>
-<li>\subpage tui_transforming_meshes_page</li>
-<li>\subpage tui_notebook_smesh_page</li>
-</ul>
+Examples of Python scripts for all Mesh operations are available by
+the following links:
 
+- \subpage tui_creating_meshes_page
+- \subpage tui_viewing_meshes_page
+- \subpage tui_defining_hypotheses_page
+- \subpage tui_quality_controls_page
+- \subpage tui_grouping_elements_page
+- \subpage tui_modifying_meshes_page
+- \subpage tui_transforming_meshes_page
+- \subpage tui_notebook_smesh_page
 
 */
index e4589b5a67e964bcc159b34fe0d91514837f1be1..2f0f0743e039e4ff6d08e979d23d951cb15da9db 100644 (file)
@@ -64,13 +64,9 @@ name in the adjacent box);</li>
 </ul>
 </li>
 
-<li>Click \b Apply or <b> Apply and Close</b> button to confirm the
-operation.</li>
-
+<li>Click \b Apply or <b> Apply and Close</b> button to confirm the operation.</li>
 </ol>
 
-
-<br><b>See Also</b> a sample TUI Script of a 
-\ref tui_translation "Translation" operation.  
+<br><b>See Also</b> a sample TUI Script of a \ref tui_translation "Translation" operation.  
 
 */
index 9048afef17fe0fde4852801fdd7e8f45a29ae8bc..87f740e984c5d87f248b062770024bad7978224a 100644 (file)
@@ -2,7 +2,7 @@
 
 \page tui_creating_meshes_page Creating Meshes
 
-\n First of all see \ref introduction_to_mesh_python_page "Example of 3d mesh generation",
+\n First of all see \ref example_3d_mesh "Example of 3d mesh generation",
  which is an example of good python script style for Mesh module.
 
 <br>
index 346e6781c29550bc58528bf9988aa7510aa2ae20..3faba3da55459025e19e5b19e8b6d33a7eb4a50f 100644 (file)
@@ -19,6 +19,11 @@ Face_1   = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
 Edge_1   = geompy.SubShapeAllSorted(box, geompy.ShapeType["EDGE"])[0]
 Vertex_1 = geompy.SubShapeAllSorted(box, geompy.ShapeType["VERTEX"])[0]
 
+# /!\ Geom object with sizemaps on them must be published in study
+geompy.addToStudyInFather(box,Face_1, "Face_1")
+geompy.addToStudyInFather(box,Edge_1, "Edge_1")
+geompy.addToStudyInFather(box,Vertex_1, "Vertex_1")
+
 # create a mesh on the box
 blsurfMesh = smesh.Mesh(box,"box: BLSurf mesh")
 
@@ -43,6 +48,39 @@ BLSURF_Parameters.SetSizeMap(Vertex_1, 'def f(): return 2' )
 
 # compute the mesh
 blsurfMesh.Compute()
+
+# Add enforced vertex for Face_1 on (50, 50, 50)
+# The projection coordinates will be (50, 50, 0)
+BLSURF_Parameters.SetEnforcedVertex(Face_1, 50, 50, 50)
+
+# Add another enforced vertex on (150, 150, 150)
+BLSURF_Parameters.SetEnforcedVertex(Face_1, 150, 150, 150)
+
+# Retrieve and print the list of enforced vertices defines on Face_1
+enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1)
+print "List of enforced vertices for Face_1: "
+print enfList
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# Remove an enforced vertex and print the list
+BLSURF_Parameters.UnsetEnforcedVertex(Face_1, 50, 50, 50)
+enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1)
+print "List of enforced vertices for Face_1: "
+print enfList
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# Remove all enforced vertices defined on Face_1
+BLSURF_Parameters.UnsetEnforcedVertices(Face_1)
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# End of script
+
 \endcode
 
 */
\ No newline at end of file
diff --git a/doc/salome/gui/SMESH/input/tui_defining_ghs3d_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_ghs3d_hypotheses.doc
new file mode 100644 (file)
index 0000000..57a6aaf
--- /dev/null
@@ -0,0 +1,45 @@
+/*!
+
+\page tui_defining_ghs3d_hypotheses_page Defining Hypotheses for Ghs3D Algorithm
+
+\anchor tui_ghs3d
+<h2>Construction of Mesh using Ghs3D algorithm</h2>
+
+\code
+import geompy
+import smesh
+import BLSURFPlugin
+import GHS3DPlugin
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
+geompy.addToStudy(box, "box")
+
+# create a mesh on the box
+ghs3dMesh = smesh.Mesh(box,"box: Ghs3D and BLSurf mesh")
+
+# create a BLSurf algorithm for faces
+BLSURF = ghs3dMesh.Triangle(algo=smesh.BLSURF)
+
+# create a Ghs3D algorithm for volume
+GHS3D = ghs3dMesh.Tetrahedron(algo=smesh.GHS3D)
+
+# get Ghs3D algorithm hypothesis
+GHS3D_Parameters = GHS3D.Parameters()
+
+# define an enforced vertex at (50,50,100) with a physical size of 2
+GHS3D_Parameters.SetEnforcedVertex( 50, 50, 100, 2 )
+
+# define an enforced vertex at (150,150,100) with a physical size of 5
+GHS3D_Parameters.SetEnforcedVertex( 150, 150, 100, 5 )
+
+# compute the mesh
+ghs3dMesh.Compute()
+
+# End of script
+
+\endcode
+
+\image html ghs3d_enforced_vertices_screenshot.png
+
+*/
\ No newline at end of file
index 8c93ca2e38fee16a22b7a7d616afc25f24ae53f6..04725fdc6c56d05882d01f37cf83c644abbbc2f7 100644 (file)
@@ -468,9 +468,83 @@ src_mesh.TranslateObject( src_mesh, MakeDirStruct( 210, 0, 0 ), Copy=False)
 
 \endcode
 
+<br>
+
+\anchor tui_fixed_points
+
+<h2>1D Mesh with Fixed Points example</h2>
+
+\code
+import salome
+import geompy
+import smesh
+import StdMeshers
+
+# Create face and explode it on edges
+face = geompy.MakeFaceHW(100, 100, 1)
+edges = geompy.SubShapeAllSorted(face, geompy.ShapeType["EDGE"])
+geompy.addToStudy( face, "Face" )
+
+# get the first edge from exploded result
+edge1 = geompy.GetSubShapeID(face, edges[0])
+
+# Define Mesh on previously created face
+Mesh_1 = smesh.Mesh(face)
+
+# Create Fixed Point 1D hypothesis and define parameters.
+# Note: values greater than 1.0 and less than 0.0 are not taken into account;
+# duplicated values are removed. Also, if not specified explicitly, values 0.0 and 1.0
+# add added automatically.
+# The number of segments should correspond to the number of points (NbSeg = NbPnt-1);
+# extra values of segments splitting parameter are not taken into account,
+# while missing values are considered to be equal to 1.
+Fixed_points_1D_1 = smesh.CreateHypothesis('FixedPoints1D')
+Fixed_points_1D_1.SetPoints( [ 1.1, 0.9, 0.5, 0.0, 0.5, -0.3 ] )
+Fixed_points_1D_1.SetNbSegments( [ 3, 1, 2 ] )
+Fixed_points_1D_1.SetReversedEdges( [edge1] )
+
+# Add hypothesis to mesh and define 2D parameters
+Mesh_1.AddHypothesis(Fixed_points_1D_1)
+Regular_1D = Mesh_1.Segment()
+Quadrangle_2D = Mesh_1.Quadrangle()
+# Compute mesh
+Mesh_1.Compute()
+\endcode
+
+\anchor tui_radial_quadrangle
+<h2> Radial Quadrangle 1D2D example </h2>
+\code
+import salome
+import geompy
+import smesh
+import StdMeshers
+
+# Create face from the wire and add to study
+WirePath = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WW", [0, 0, 0, 1, 0, 0, 0, 0, 1])
+Face = geompy.MakeFace(WirePath,1)
+geompy.addToStudy(Face,"Face")
+
+# Define geometry for mesh, and 1D parameters
+mesh = smesh.Mesh(Face)
+Wire_discretisation = mesh.Segment()
+Nb_Segments = Wire_discretisation.NumberOfSegments(5)
+Nb_Segments.SetDistrType( 0 )
+
+# Define 2D parameters and Radial Quadrange hypothesis
+Number_of_Layers = smesh.CreateHypothesis('NumberOfLayers2D')
+Number_of_Layers.SetNumberOfLayers( 4 )
+mesh.AddHypothesis(Number_of_Layers)
+RadialQuadrangle_1D2D = smesh.CreateHypothesis('RadialQuadrangle_1D2D')
+mesh.AddHypothesis(RadialQuadrangle_1D2D)
+
+mesh.Compute()
+\endcode
+
+
 \n Other meshing algorithms:
 
 <ul>
 <li>\subpage tui_defining_blsurf_hypotheses_page</li>
+<li>\subpage tui_defining_ghs3d_hypotheses_page</li>
 </ul>
 */
index e03433f1c7a02337adc5db6c5adfdcd2909d6037..b77edd21ed5608368bb7d28438ec0671617b15b2 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+       /*!
 
 \page tui_grouping_elements_page Grouping Elements
 
@@ -318,13 +318,13 @@ salome.sg.updateObjBrowser(1)
 \endcode
 
 \image html dimgroup_tui1.png
-<center>Source groups of faces<\center>
+<center>Source groups of faces</center>
 
 \image html dimgroup_tui2.png
-<center>Result groups of edges and nodes<\center>
+<center>Result groups of edges and nodes</center>
 
 
 
 
 
-*/
\ No newline at end of file
+*/
index bc7b78c89e2da15d8db4ccdb8f1259e74a28f274..66b6361fa0b724214ad4fc2481bc234471388625 100644 (file)
@@ -815,4 +815,48 @@ isDone = pattern.MakeMesh(Mesh_1.GetMesh(), 0, 0)
 if (isDone != 1): print 'MakeMesh :', pattern.GetErrorCode()  
 \endcode
 
-*/
\ No newline at end of file
+<br>
+\anchor tui_quadratic
+<h2>Convert mesh to/from quadratic</h2>
+
+\code
+import geompy
+import smesh
+
+# create sphere of radius 100
+
+Sphere = geompy.MakeSphereR( 100 )
+geompy.addToStudy( Sphere, "Sphere" )
+
+# create simple trihedral mesh
+
+Mesh = smesh.Mesh(Sphere)
+Regular_1D = Mesh.Segment()
+Nb_Segments = Regular_1D.NumberOfSegments(5)
+MEFISTO_2D = Mesh.Triangle()
+Tetrahedron_Netgen = Mesh.Tetrahedron(algo=smesh.NETGEN)
+
+# compute mesh
+
+isDone = Mesh.Compute()
+
+# convert to quadratic
+# theForce3d = 1; this results in the medium node lying at the
+# middle of the line segments connecting start and end node of a mesh
+# element
+
+Mesh.ConvertToQuadratic( theForce3d=1 )
+
+# revert back to the non-quadratic mesh
+
+Mesh.ConvertFromQuadratic()
+
+# convert to quadratic
+# theForce3d = 0; this results in the medium node lying at the
+# geometrical edge from which the mesh element is built
+
+Mesh.ConvertToQuadratic( theForce3d=0 )
+
+\endcode
+
+*/
index 59681c16b856af4458426206528e721d88eb313e..862cb302ecbb9492015fe66cc43cf4d2e819d1f3 100644 (file)
@@ -9,10 +9,12 @@
 \code
 import geompy
 import smesh
+import SMESH
 
 # create a box
 box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
 geompy.addToStudy(box, "box")
+[Face_1,Face_2,Face_3,Face_4,Face_5,Face_5] = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
 
 # create a mesh
 tetra = smesh.Mesh(box, "MeshBox")
@@ -26,10 +28,22 @@ algo2D.MaxElementArea(10.)
 algo3D = tetra.Tetrahedron(smesh.NETGEN)
 algo3D.MaxElementVolume(900.)
 
+# Creation of SubMesh
+Regular_1D_1_1 = tetra.Segment(geom=Face_1)
+Nb_Segments_1 = Regular_1D_1_1.NumberOfSegments(5)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = tetra.Quadrangle(geom=Face_1)
+isDone = tetra.Compute()
+submesh = Regular_1D_1_1.GetSubMesh()
+
 # compute the mesh
 tetra.Compute()
 
-# print information about the mesh
+# Creation of group
+group = tetra.CreateEmptyGroup( SMESH.FACE, 'Group' )
+nbAdd = group.Add( [ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 ] )
+
+# Print information about the mesh
 print "Information about mesh:" 
 print "Number of nodes       : ", tetra.NbNodes()
 print "Number of edges       : ", tetra.NbEdges()
@@ -43,5 +57,30 @@ print "          hexahedrons : ", tetra.NbHexas()
 print "          prisms      : ", tetra.NbPrisms()
 print "          pyramids    : ", tetra.NbPyramids()
 print "          polyhedrons : ", tetra.NbPolyhedrons() 
+
+# Get Information About Mesh by GetMeshInfo
+print "\nInformation about mesh by GetMeshInfo:"
+info = smesh.GetMeshInfo(tetra)
+keys = info.keys(); keys.sort()
+for i in keys:
+  print "  %s   :  %d" % ( i, info[i] )
+  pass
+
+# Get Information About Group by GetMeshInfo
+print "\nInformation about group by GetMeshInfo:"
+info = smesh.GetMeshInfo(group)
+keys = info.keys(); keys.sort()
+for i in keys:
+  print "  %s  :  %d" % ( i, info[i] )
+  pass
+
+# Get Information About SubMesh by GetMeshInfo
+print "\nInformation about Submesh by GetMeshInfo:"
+info = smesh.GetMeshInfo(submesh)
+keys = info.keys(); keys.sort()
+for i in keys:
+  print "  %s  :  %d" % ( i, info[i] )
+  pass
 \endcode
-*/
\ No newline at end of file
+
+*/
index 01a272de29177ca66451801681b6c9135ac3b673..ee4c6dd4a7091a34aa728e96389418c84d5b92c4 100644 (file)
@@ -38,7 +38,7 @@ meshes.</li>
 <li>\subpage transparency_page "Transparency" - allows to change the
 transparency of mesh elements.</li>
 <li>\subpage clipping_page "Clipping" - allows to create cross-sections of the selected objects.</li>
-<li>\ref about_quality_controls_page "Controls" - graphically
+<li>\ref quality_page "Controls" - graphically
 presents various information about meshes.</li>
 <li><b>Hide</b> - allows to hide the selected mesh from the viewer.</li>
 <li><b>Show Only</b> -allows to display only the selected mesh, hiding all other from the viewer.</li>
index fff0c51208e520826e4de5c40fdcfa9b16f73936..8a5c37daa91e4dd4348f67488e87d4b30da0e87c 100644 (file)
@@ -46,7 +46,6 @@ module SMESH
   enum log_command
     {
       ADD_NODE,
-      ADD_ELEM0D,
       ADD_EDGE,
       ADD_TRIANGLE,
       ADD_QUADRANGLE,
@@ -69,7 +68,8 @@ module SMESH
       ADD_QUADTETRAHEDRON,
       ADD_QUADPYRAMID,
       ADD_QUADPENTAHEDRON,
-      ADD_QUADHEXAHEDRON
+      ADD_QUADHEXAHEDRON,
+      ADD_ELEM0D
     };
 
   struct log_block
index 198275ed8d8418d5b1c8eaebdcff39b4b580931d..62623567a5dbede64566b3cb6e3c47ba47870377 100644 (file)
@@ -614,6 +614,18 @@ module SMESH
      */
     long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
 
+    /*!
+     * Return ID of node closest to a given point
+     */
+    long FindNodeClosestTo(in double x, in double y, in double z);
+
+    /*!
+     * Return elements of given type where the given point is IN or ON.
+     *
+     * 'ALL' type means elements of any type excluding nodes and 0D elements
+     */
+    long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
+
     enum Sew_Error {
       SEW_OK,
       SEW_BORDER1_NOT_FOUND,
@@ -684,6 +696,49 @@ module SMESH
     * not creared - returns empty list
     */
     long_array GetLastCreatedElems();
+
+    /*!
+     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+     * \param theNodes - identifiers of nodes to be doubled
+     * \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
+     *        nodes. If list of element identifiers is empty then nodes are doubled but 
+     *        they not assigned to elements
+     *        \return TRUE if operation has been completed successfully, FALSE otherwise
+     * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
+    */
+    boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ); 
+
+    /*!
+    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+    * This method provided for convenience works as DoubleNodes() described above.
+    * \param theNodeId - identifier of node to be doubled.
+    * \param theModifiedElems - identifiers of elements to be updated.
+    * \return TRUE if operation has been completed successfully, FALSE otherwise
+    * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
+    */
+    boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ); 
+
+    /*!
+    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+    * This method provided for convenience works as DoubleNodes() described above.
+    * \param theNodes - group of nodes to be doubled.
+    * \param theModifiedElems - group of elements to be updated.
+    * \return TRUE if operation has been completed successfully, FALSE otherwise
+    * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups()
+    */
+    boolean DoubleNodeGroup( in SMESH_GroupBase theNodes, 
+                             in SMESH_GroupBase theModifiedElems );
+
+    /*!
+    \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+    This method provided for convenience works as DoubleNodes() described above.
+    \param theNodes - list of groups of nodes to be doubled
+    \param theModifiedElems - list of groups of elements to be updated.
+    \return TRUE if operation has been completed successfully, FALSE otherwise
+    \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
+    */
+    boolean DoubleNodeGroups( in ListOfGroups theNodes, 
+                              in ListOfGroups theModifiedElems );
     
     /*!
      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -695,9 +750,9 @@ module SMESH
      * \return TRUE if operation has been completed successfully, FALSE otherwise
      * \sa DoubleNodeGroup(), DoubleNodeGroups()
     */
-    boolean DoubleNodes( in long_array theElems,
-                         in long_array theNodesNot,
-                         in long_array theAffectedElems ); 
+    boolean DoubleNodeElem( in long_array theElems,
+                            in long_array theNodesNot,
+                            in long_array theAffectedElems ); 
 
     /*!
      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -710,9 +765,9 @@ module SMESH
      * \return TRUE if operation has been completed successfully, FALSE otherwise
      * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
     */
-    boolean DoubleNodesInRegion( in long_array theElems,
-                                 in long_array theNodesNot,
-                                 in GEOM::GEOM_Object theShape );
+    boolean DoubleNodeElemInRegion( in long_array theElems,
+                                    in long_array theNodesNot,
+                                    in GEOM::GEOM_Object theShape );
 
     /*!
      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -724,9 +779,9 @@ module SMESH
      * \return TRUE if operation has been completed successfully, FALSE otherwise
      * \sa DoubleNodes(), DoubleNodeGroups()
     */
-    boolean DoubleNodeGroup( in SMESH_GroupBase theElems, 
-                             in SMESH_GroupBase theNodesNot,
-                             in SMESH_GroupBase theAffectedElems );
+    boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems, 
+                                 in SMESH_GroupBase theNodesNot,
+                                 in SMESH_GroupBase theAffectedElems );
 
     /*!
      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -739,7 +794,7 @@ module SMESH
      * \return TRUE if operation has been completed successfully, FALSE otherwise
      * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
     */
-    boolean DoubleNodeGroupInRegion( in SMESH_GroupBase theElems, 
+    boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems, 
                                      in SMESH_GroupBase theNodesNot,
                                      in GEOM::GEOM_Object theShape );
 
@@ -753,9 +808,9 @@ module SMESH
      * \return TRUE if operation has been completed successfully, FALSE otherwise
      * \sa DoubleNodeGroup(), DoubleNodes()
     */
-    boolean DoubleNodeGroups( in ListOfGroups theElems,
-                              in ListOfGroups theNodesNot,
-                              in ListOfGroups theAffectedElems );
+    boolean DoubleNodeElemGroups( in ListOfGroups theElems,
+                                  in ListOfGroups theNodesNot,
+                                  in ListOfGroups theAffectedElems );
 
     /*!
      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -768,9 +823,16 @@ module SMESH
      * \return TRUE if operation has been completed successfully, FALSE otherwise
      * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
     */
-    boolean DoubleNodeGroupsInRegion( in ListOfGroups theElems,
-                                      in ListOfGroups theNodesNot,
-                                      in GEOM::GEOM_Object theShape );
+    boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
+                                          in ListOfGroups theNodesNot,
+                                          in GEOM::GEOM_Object theShape );
+
+    /*!
+     * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+     * The created 2D mesh elements based on nodes of free faces of boundary volumes
+     * \return TRUE if operation has been completed successfully, FALSE otherwise
+     */
+    boolean Make2DMeshFrom3D();
 
   };
 };
index 2ebd83edff16cbd8faf46130d2563fa68c137103..3fb97d2ae91521f311c90b9aa5d283e72b7b810a 100644 (file)
@@ -165,6 +165,7 @@ dist_salomeres_DATA = \
        mesh_tree_mesh_partial.png \
        mesh_extractGroup.png \
        mesh_precompute.png \
+       mesh_2d_from_3d.png \
         mesh_free_faces.png
 
 # VSR: little trick to avoid putting if SMESHCatalog.xml to the distribution archive
diff --git a/resources/mesh_2d_from_3d.png b/resources/mesh_2d_from_3d.png
new file mode 100644 (file)
index 0000000..b0842d3
Binary files /dev/null and b/resources/mesh_2d_from_3d.png differ
index cc390e500d9bb2af21f571d35543b8986f4e3dc4..996cb7604fde9419882e66a14568dd06ccf2ac9c 100644 (file)
@@ -149,21 +149,21 @@ namespace{
 //     SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
 //     if ( anIter != 0 ) {
 //       while( anIter->more() ) {
-//     const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
-//     if ( aNode == 0 )
-//       return 0;
-//     SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
-//     while( anElemIter->more() ) {
-//       const SMDS_MeshElement* anElem = anElemIter->next();
-//       if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
-//         int anId = anElem->GetID();
-
-//         if ( anIter->more() )              // i.e. first node
-//           aMap.Add( anId );
-//         else if ( aMap.Contains( anId ) )
-//           aResult++;
-//       }
-//     }
+//      const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
+//      if ( aNode == 0 )
+//        return 0;
+//      SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
+//      while( anElemIter->more() ) {
+//        const SMDS_MeshElement* anElem = anElemIter->next();
+//        if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
+//          int anId = anElem->GetID();
+
+//          if ( anIter->more() )              // i.e. first node
+//            aMap.Add( anId );
+//          else if ( aMap.Contains( anId ) )
+//            aResult++;
+//        }
+//      }
 //       }
 //     }
 
@@ -476,9 +476,9 @@ namespace{
 
   inline double getArea(double theHalfPerim, double theTria[3]){
     return sqrt(theHalfPerim*
-               (theHalfPerim-theTria[0])*
-               (theHalfPerim-theTria[1])*
-               (theHalfPerim-theTria[2]));
+                (theHalfPerim-theTria[0])*
+                (theHalfPerim-theTria[1])*
+                (theHalfPerim-theTria[2]));
   }
 
   inline double getVolume(double theLen[6]){
@@ -1036,160 +1036,160 @@ double Length2D::GetValue( long theElementId)
     case SMDSAbs_Node:
     case SMDSAbs_Edge:
       if (len == 2){
-       aVal = getDistance( P( 1 ), P( 2 ) );
+        aVal = getDistance( P( 1 ), P( 2 ) );
         break;
       }
       else if (len == 3){ // quadratic edge
-       aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
+        aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
         break;
       }
     case SMDSAbs_Face:
       if (len == 3){ // triangles
-       double L1 = getDistance(P( 1 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 1 ));
-       aVal = Max(L1,Max(L2,L3));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        aVal = Max(L1,Max(L2,L3));
+        break;
       }
       else if (len == 4){ // quadrangles
-       double L1 = getDistance(P( 1 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 4 ));
-       double L4 = getDistance(P( 4 ),P( 1 ));
-       aVal = Max(Max(L1,L2),Max(L3,L4));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 4 ));
+        double L4 = getDistance(P( 4 ),P( 1 ));
+        aVal = Max(Max(L1,L2),Max(L3,L4));
+        break;
       }
       if (len == 6){ // quadratic triangles
-       double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
-       double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
-       double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
-       aVal = Max(L1,Max(L2,L3));
+        double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
+        double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
+        double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
+        aVal = Max(L1,Max(L2,L3));
         //cout<<"L1="<<L1<<" L2="<<L2<<"L3="<<L3<<" aVal="<<aVal<<endl;
-       break;
+        break;
       }
       else if (len == 8){ // quadratic quadrangles
-       double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
-       double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
-       double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
-       double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
-       aVal = Max(Max(L1,L2),Max(L3,L4));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
+        double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
+        double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
+        double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
+        aVal = Max(Max(L1,L2),Max(L3,L4));
+        break;
       }
     case SMDSAbs_Volume:
       if (len == 4){ // tetraidrs
-       double L1 = getDistance(P( 1 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 1 ));
-       double L4 = getDistance(P( 1 ),P( 4 ));
-       double L5 = getDistance(P( 2 ),P( 4 ));
-       double L6 = getDistance(P( 3 ),P( 4 ));
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        double L4 = getDistance(P( 1 ),P( 4 ));
+        double L5 = getDistance(P( 2 ),P( 4 ));
+        double L6 = getDistance(P( 3 ),P( 4 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        break;
       }
       else if (len == 5){ // piramids
-       double L1 = getDistance(P( 1 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 1 ));
-       double L4 = getDistance(P( 4 ),P( 1 ));
-       double L5 = getDistance(P( 1 ),P( 5 ));
-       double L6 = getDistance(P( 2 ),P( 5 ));
-       double L7 = getDistance(P( 3 ),P( 5 ));
-       double L8 = getDistance(P( 4 ),P( 5 ));
-
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       aVal = Max(aVal,Max(L7,L8));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        double L4 = getDistance(P( 4 ),P( 1 ));
+        double L5 = getDistance(P( 1 ),P( 5 ));
+        double L6 = getDistance(P( 2 ),P( 5 ));
+        double L7 = getDistance(P( 3 ),P( 5 ));
+        double L8 = getDistance(P( 4 ),P( 5 ));
+
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(L7,L8));
+        break;
       }
       else if (len == 6){ // pentaidres
-       double L1 = getDistance(P( 1 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 1 ));
-       double L4 = getDistance(P( 4 ),P( 5 ));
-       double L5 = getDistance(P( 5 ),P( 6 ));
-       double L6 = getDistance(P( 6 ),P( 4 ));
-       double L7 = getDistance(P( 1 ),P( 4 ));
-       double L8 = getDistance(P( 2 ),P( 5 ));
-       double L9 = getDistance(P( 3 ),P( 6 ));
-
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       aVal = Max(aVal,Max(Max(L7,L8),L9));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 1 ));
+        double L4 = getDistance(P( 4 ),P( 5 ));
+        double L5 = getDistance(P( 5 ),P( 6 ));
+        double L6 = getDistance(P( 6 ),P( 4 ));
+        double L7 = getDistance(P( 1 ),P( 4 ));
+        double L8 = getDistance(P( 2 ),P( 5 ));
+        double L9 = getDistance(P( 3 ),P( 6 ));
+
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(Max(L7,L8),L9));
+        break;
       }
       else if (len == 8){ // hexaider
-       double L1 = getDistance(P( 1 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 4 ));
-       double L4 = getDistance(P( 4 ),P( 1 ));
-       double L5 = getDistance(P( 5 ),P( 6 ));
-       double L6 = getDistance(P( 6 ),P( 7 ));
-       double L7 = getDistance(P( 7 ),P( 8 ));
-       double L8 = getDistance(P( 8 ),P( 5 ));
-       double L9 = getDistance(P( 1 ),P( 5 ));
-       double L10= getDistance(P( 2 ),P( 6 ));
-       double L11= getDistance(P( 3 ),P( 7 ));
-       double L12= getDistance(P( 4 ),P( 8 ));
-
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
-       aVal = Max(aVal,Max(L11,L12));
-       break;
+        double L1 = getDistance(P( 1 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 4 ));
+        double L4 = getDistance(P( 4 ),P( 1 ));
+        double L5 = getDistance(P( 5 ),P( 6 ));
+        double L6 = getDistance(P( 6 ),P( 7 ));
+        double L7 = getDistance(P( 7 ),P( 8 ));
+        double L8 = getDistance(P( 8 ),P( 5 ));
+        double L9 = getDistance(P( 1 ),P( 5 ));
+        double L10= getDistance(P( 2 ),P( 6 ));
+        double L11= getDistance(P( 3 ),P( 7 ));
+        double L12= getDistance(P( 4 ),P( 8 ));
+
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
+        aVal = Max(aVal,Max(L11,L12));
+        break;
 
       }
 
       if (len == 10){ // quadratic tetraidrs
-       double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
-       double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
-       double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
-       double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       break;
+        double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
+        double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
+        double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
+        double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        break;
       }
       else if (len == 13){ // quadratic piramids
-       double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
-       double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
-       double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
-       double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
-       double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
-       double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       aVal = Max(aVal,Max(L7,L8));
-       break;
+        double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
+        double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
+        double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
+        double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
+        double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
+        double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(L7,L8));
+        break;
       }
       else if (len == 15){ // quadratic pentaidres
-       double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
-       double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
-       double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
-       double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
-       double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
-       double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
-       double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       aVal = Max(aVal,Max(Max(L7,L8),L9));
-       break;
+        double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
+        double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
+        double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
+        double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
+        double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
+        double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
+        double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(Max(L7,L8),L9));
+        break;
       }
       else if (len == 20){ // quadratic hexaider
-       double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
-       double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
-       double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
-       double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
-       double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
-       double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
-       double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
-       double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
-       double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
-       double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
-       double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
-       double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
-       aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-       aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
-       aVal = Max(aVal,Max(L11,L12));
-       break;
+        double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
+        double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
+        double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
+        double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
+        double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
+        double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
+        double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
+        double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
+        double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
+        double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
+        double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
+        double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
+        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+        aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
+        aVal = Max(aVal,Max(L11,L12));
+        break;
 
       }
 
@@ -1467,12 +1467,12 @@ void MultiConnection2D::GetValues(MValues& theValues){
       Value aValue(aNodeId[1],aNodeId[2]);
       MValues::iterator aItr = theValues.find(aValue);
       if (aItr != theValues.end()){
-       aItr->second += 1;
-       //aNbConnects = nb;
+        aItr->second += 1;
+        //aNbConnects = nb;
       }
       else {
-       theValues[aValue] = 1;
-       //aNbConnects = 1;
+        theValues[aValue] = 1;
+        //aNbConnects = 1;
       }
       //cout << "NodeIds: "<<aNodeId[1]<<","<<aNodeId[2]<<" nbconn="<<aNbConnects<<endl;
       aNodeId[1] = aNodeId[2];
@@ -1651,8 +1651,8 @@ bool FreeEdges::Border::operator<(const FreeEdges::Border& x) const{
 }
 
 inline void UpdateBorders(const FreeEdges::Border& theBorder,
-                         FreeEdges::TBorders& theRegistry,
-                         FreeEdges::TBorders& theContainer)
+                          FreeEdges::TBorders& theRegistry,
+                          FreeEdges::TBorders& theContainer)
 {
   if(theRegistry.find(theBorder) == theRegistry.end()){
     theRegistry.insert(theBorder);
@@ -1938,8 +1938,10 @@ bool ElemGeomType::IsSatisfy( long theId )
 {
   if (!myMesh) return false;
   const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
+  if ( !anElem )
+    return false;
   const SMDSAbs_ElementType anElemType = anElem->GetType();
-  if ( !anElem || (myType != SMDSAbs_All && anElemType != myType) )
+  if ( myType != SMDSAbs_All && anElemType != myType )
     return false;
   const int aNbNode = anElem->NbNodes();
   bool isOk = false;
@@ -2412,15 +2414,15 @@ void Filter::SetPredicate( PredicatePtr thePredicate )
 
 template<class TElement, class TIterator, class TPredicate>
 inline void FillSequence(const TIterator& theIterator,
-                        TPredicate& thePredicate,
-                        Filter::TIdSequence& theSequence)
+                         TPredicate& thePredicate,
+                         Filter::TIdSequence& theSequence)
 {
   if ( theIterator ) {
     while( theIterator->more() ) {
       TElement anElem = theIterator->next();
       long anId = anElem->GetID();
       if ( thePredicate->IsSatisfy( anId ) )
-       theSequence.push_back( anId );
+        theSequence.push_back( anId );
     }
   }
 }
@@ -2428,8 +2430,8 @@ inline void FillSequence(const TIterator& theIterator,
 void
 Filter::
 GetElementsId( const SMDS_Mesh* theMesh,
-              PredicatePtr thePredicate,
-              TIdSequence& theSequence )
+               PredicatePtr thePredicate,
+               TIdSequence& theSequence )
 {
   theSequence.clear();
 
@@ -2462,7 +2464,7 @@ GetElementsId( const SMDS_Mesh* theMesh,
 
 void
 Filter::GetElementsId( const SMDS_Mesh* theMesh,
-                      Filter::TIdSequence& theSequence )
+                       Filter::TIdSequence& theSequence )
 {
   GetElementsId(theMesh,myPredicate,theSequence);
 }
@@ -3254,31 +3256,54 @@ void ElementsOnShape::process (const SMDS_MeshElement* theElemPtr)
 TSequenceOfXYZ::TSequenceOfXYZ()
 {}
 
-TSequenceOfXYZ::TSequenceOfXYZ(size_type n) : std::vector<gp_XYZ>(n)
+TSequenceOfXYZ::TSequenceOfXYZ(size_type n) : myArray(n)
 {}
 
-TSequenceOfXYZ::TSequenceOfXYZ(size_type n, const value_type& t) : std::vector<gp_XYZ>(n,t)
+TSequenceOfXYZ::TSequenceOfXYZ(size_type n, const gp_XYZ& t) : myArray(n,t)
 {}
 
-TSequenceOfXYZ::TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ) : std::vector<gp_XYZ>(theSequenceOfXYZ)
+TSequenceOfXYZ::TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ) : myArray(theSequenceOfXYZ.myArray)
 {}
 
 template <class InputIterator>
-TSequenceOfXYZ::TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd): std::vector<gp_XYZ>(theBegin,theEnd)
+TSequenceOfXYZ::TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd): myArray(theBegin,theEnd)
+{}
+
+TSequenceOfXYZ::~TSequenceOfXYZ()
 {}
 
 TSequenceOfXYZ& TSequenceOfXYZ::operator=(const TSequenceOfXYZ& theSequenceOfXYZ)
 {
-  std::vector<gp_XYZ>::operator=(theSequenceOfXYZ);
+  myArray = theSequenceOfXYZ.myArray;
   return *this;
 }
 
-std::vector<gp_XYZ>::reference TSequenceOfXYZ::operator()(size_type n)
+gp_XYZ& TSequenceOfXYZ::operator()(size_type n)
+{
+  return myArray[n-1];
+}
+
+const gp_XYZ& TSequenceOfXYZ::operator()(size_type n) const
+{
+  return myArray[n-1];
+}
+
+void TSequenceOfXYZ::clear()
+{
+  myArray.clear();
+}
+
+void TSequenceOfXYZ::reserve(size_type n)
+{
+  myArray.reserve(n);
+}
+
+void TSequenceOfXYZ::push_back(const gp_XYZ& v)
 {
-  return std::vector<gp_XYZ>::operator[](n-1);
+  myArray.push_back(v);
 }
 
-std::vector<gp_XYZ>::const_reference TSequenceOfXYZ::operator()(size_type n) const
+TSequenceOfXYZ::size_type TSequenceOfXYZ::size() const
 {
-  return std::vector<gp_XYZ>::operator[](n-1);
+  return myArray.size();
 }
index 38a507c84bf1f21e6c6b6c1417ce9e852c031bf7..4f81bbd72f8ea2882d7f962d66e2507af501d8c1 100644 (file)
@@ -68,30 +68,40 @@ class gp_Pnt;
 namespace SMESH{
   namespace Controls{
 
-    class SMESHCONTROLS_EXPORT TSequenceOfXYZ: public std::vector<gp_XYZ>
+    class SMESHCONTROLS_EXPORT TSequenceOfXYZ
     {
+      typedef std::vector<gp_XYZ>::size_type size_type;
+
     public:
       TSequenceOfXYZ();
 
       TSequenceOfXYZ(size_type n);
 
-      TSequenceOfXYZ(size_type n, const value_type& t);
+      TSequenceOfXYZ(size_type n, const gp_XYZ& t);
 
       TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ);
 
       template <class InputIterator>
       TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd);
 
+      ~TSequenceOfXYZ();
+
       TSequenceOfXYZ& operator=(const TSequenceOfXYZ& theSequenceOfXYZ);
 
-      reference operator()(size_type n);
+      gp_XYZ& operator()(size_type n);
 
-      const_reference operator()(size_type n) const;
+      const gp_XYZ& operator()(size_type n) const;
 
-    private:
-      reference operator[](size_type n);
+      void clear();
+
+      void reserve(size_type n);
 
-      const_reference operator[](size_type n) const;
+      void push_back(const gp_XYZ& v);
+
+      size_type size() const;
+
+    private:
+      std::vector<gp_XYZ> myArray;
     };
 
     /*
@@ -122,9 +132,9 @@ namespace SMESH{
       void  SetPrecision( const long thePrecision );
       
       bool GetPoints(const int theId,
-                    TSequenceOfXYZ& theRes) const;
+                     TSequenceOfXYZ& theRes) const;
       static bool GetPoints(const SMDS_MeshElement* theElem,
-                           TSequenceOfXYZ& theRes);
+                            TSequenceOfXYZ& theRes);
     protected:
       const SMDS_Mesh* myMesh;
       const SMDS_MeshElement* myCurrElement;
@@ -253,10 +263,10 @@ namespace SMESH{
       virtual double GetBadRate( double Value, int nbNodes ) const;
       virtual SMDSAbs_ElementType GetType() const;
       struct Value{
-       double myLength;
-       long myPntId[2];
-       Value(double theLength, long thePntId1, long thePntId2);
-       bool operator<(const Value& x) const;
+        double myLength;
+        long myPntId[2];
+        Value(double theLength, long thePntId1, long thePntId2);
+        bool operator<(const Value& x) const;
       };
       typedef std::set<Value> TValues;
       void GetValues(TValues& theValues);
@@ -286,9 +296,9 @@ namespace SMESH{
       virtual double GetBadRate( double Value, int nbNodes ) const;
       virtual SMDSAbs_ElementType GetType() const;
       struct Value{
-       long myPntId[2];
-       Value(long thePntId1, long thePntId2);
-       bool operator<(const Value& x) const;
+        long myPntId[2];
+        Value(long thePntId1, long thePntId2);
+        bool operator<(const Value& x) const;
       };
       typedef std::map<Value,int> MValues;
 
@@ -354,10 +364,10 @@ namespace SMESH{
       static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId  );
       typedef long TElemId;
       struct Border{
-       TElemId myElemId;
-       TElemId myPntId[2];
-       Border(long theElemId, long thePntId1, long thePntId2);
-       bool operator<(const Border& x) const;
+        TElemId myElemId;
+        TElemId myPntId[2];
+        Border(long theElemId, long thePntId1, long thePntId2);
+        bool operator<(const Border& x) const;
       };
       typedef std::set<Border> TBorders;
       void GetBoreders(TBorders& theBorders);
@@ -787,13 +797,13 @@ namespace SMESH{
       virtual
       void
       GetElementsId( const SMDS_Mesh* theMesh,
-                    TIdSequence& theSequence );
+                     TIdSequence& theSequence );
 
       static
       void
       GetElementsId( const SMDS_Mesh* theMesh,
-                    PredicatePtr thePredicate,
-                    TIdSequence& theSequence );
+                     PredicatePtr thePredicate,
+                     TIdSequence& theSequence );
       
     protected:
       PredicatePtr myPredicate;
index 6c0abb7303d5a80aa483e4b987456412cfe8db41..bb35dd4796ee4eef5bdf5e606e6adbc262bd32de 100644 (file)
 
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 using namespace std;
 
 Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
 {
+  Kernel_Utils::Localizer loc;
   Status aResult = DRS_OK;
 
   int i, j;
index 91b06d6b1d895edc3bdd3adc1aec9214b6d3d2da..54741eac3c85d886d93bb34a484b3efbf7335ae4 100644 (file)
 
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 using namespace std;
 
 Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
 {
+  Kernel_Utils::Localizer loc;
   Status aResult = DRS_OK;
 
   int nbNodes, nbCells;
index e681fa4f0e49ab2ad5b52e8b3ce34888f73ccc49..2a4dead050857d35682b4c8893acf71c260e5b1a 100644 (file)
@@ -66,6 +66,7 @@ libMeshDriverDAT_la_CPPFLAGS = \
 
 libMeshDriverDAT_la_LDFLAGS  = \
        ../Driver/libMeshDriver.la \
+       $(KERNEL_LDFLAGS) -lSALOMEBasics \
        $(CAS_KERNEL)
 
 DAT_Test_CPPFLAGS = \
index 84fbf8937ec2daec1931360e1309ad1e11b0188b..ca31e7b9c4f8d37afd02eac921416426e539bf46 100644 (file)
@@ -28,7 +28,7 @@
 #include "DriverMED_Family.h"
 #include "MED_Factory.hxx"
 
-#include <sstream>     
+#include <sstream>      
 
 using namespace std;
 
@@ -83,7 +83,7 @@ void
 DriverMED_Family
 ::SetType(const SMDSAbs_ElementType theType) 
 { 
-  myType = theType; 
+  myTypes.insert( myType = theType );
 }
 
 SMDSAbs_ElementType
@@ -93,6 +93,13 @@ DriverMED_Family
   return myType; 
 }
 
+const std::set< SMDSAbs_ElementType >&
+DriverMED_Family
+::GetTypes() const
+{
+  return myTypes;
+}
+
 bool
 DriverMED_Family
 ::MemberOf(std::string theGroupName) const
@@ -139,11 +146,11 @@ DriverMED_Family
 DriverMED_FamilyPtrList 
 DriverMED_Family
 ::MakeFamilies(const SMESHDS_SubMeshPtrMap& theSubMeshes,
-              const SMESHDS_GroupBasePtrList& theGroups,
-              const bool doGroupOfNodes,
-              const bool doGroupOfEdges,
-              const bool doGroupOfFaces,
-              const bool doGroupOfVolumes)
+               const SMESHDS_GroupBasePtrList& theGroups,
+               const bool doGroupOfNodes,
+               const bool doGroupOfEdges,
+               const bool doGroupOfFaces,
+               const bool doGroupOfVolumes)
 {
   DriverMED_FamilyPtrList aFamilies;
 
@@ -189,7 +196,7 @@ DriverMED_Family
             aFamilies.erase(aCurrIter);
           }
           if (aFam2->IsEmpty()) 
-           break;
+            break;
         }
       }
       // The rest elements of family
@@ -218,7 +225,7 @@ DriverMED_Family
         aFam1->Split(aFam2, aCommon);
         if (!aCommon->IsEmpty())
         {
-         aCommon->SetGroupAttributVal(0);
+          aCommon->SetGroupAttributVal(0);
           aFamilies.push_back(aCommon);
         }
         if (aFam1->IsEmpty())
@@ -226,7 +233,7 @@ DriverMED_Family
           aFamilies.erase(aCurrIter);
         }
         if (aFam2->IsEmpty()) 
-         break;
+          break;
       }
     }
     // The rest elements of group
@@ -310,7 +317,7 @@ DriverMED_Family
 //=============================================================================
 MED::PFamilyInfo 
 DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, 
-                               const MED::PMeshInfo& theMeshInfo) const
+                                const MED::PMeshInfo& theMeshInfo) const
 {
   ostringstream aStr;
   aStr << "FAM_" << myId;
@@ -332,20 +339,20 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper,
   MED::PFamilyInfo anInfo;
   if(myId == 0 || myGroupAttributVal == 0){
     anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
-                                     aValue,
-                                     myId,
-                                     myGroupNames);
+                                      aValue,
+                                      myId,
+                                      myGroupNames);
   }else{
     MED::TStringVector anAttrDescs (1, "");  // 1 attribute with empty description,
     MED::TIntVector anAttrIds (1, myId);        // Id=0,
     MED::TIntVector anAttrVals (1, myGroupAttributVal);
     anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
-                                     aValue,
-                                     myId,
-                                     myGroupNames,
-                                     anAttrDescs,
-                                     anAttrIds,
-                                     anAttrVals);
+                                      aValue,
+                                      myId,
+                                      myGroupNames,
+                                      anAttrDescs,
+                                      anAttrIds,
+                                      anAttrVals);
   }
 
 //  cout << endl;
@@ -413,7 +420,7 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup)
 DriverMED_FamilyPtrList 
 DriverMED_Family
 ::SplitByType (SMESHDS_SubMesh* theSubMesh,
-              const int        theId)
+               const int        theId)
 {
   DriverMED_FamilyPtrList aFamilies;
   DriverMED_FamilyPtr aNodesFamily   (new DriverMED_Family);
index 6ec769bbad86aa3de32e0a958a9ebceb38579bd1..ccc042b96e504799e45ccf33da2cfce24558b658 100644 (file)
@@ -68,16 +68,16 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
   static 
   DriverMED_FamilyPtrList
   MakeFamilies (const SMESHDS_SubMeshPtrMap& theSubMeshes,
-               const SMESHDS_GroupBasePtrList& theGroups,
-               const bool doGroupOfNodes,
-               const bool doGroupOfEdges,
-               const bool doGroupOfFaces,
-               const bool doGroupOfVolumes);
+                const SMESHDS_GroupBasePtrList& theGroups,
+                const bool doGroupOfNodes,
+                const bool doGroupOfEdges,
+                const bool doGroupOfFaces,
+                const bool doGroupOfVolumes);
 
   //! Create TFamilyInfo for this family
   MED::PFamilyInfo 
   GetFamilyInfo (const MED::PWrapper& theWrapper, 
-                const MED::PMeshInfo& theMeshInfo) const;
+                 const MED::PMeshInfo& theMeshInfo) const;
 
   //! Returns elements of this family
   const ElementsSet& GetElements () const;
@@ -99,6 +99,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
 
   void SetType(const SMDSAbs_ElementType theType);
   SMDSAbs_ElementType GetType();
+  const std::set< SMDSAbs_ElementType >& GetTypes() const;
 
   bool MemberOf(std::string theGroupName) const;
 
@@ -113,7 +114,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
   static
   DriverMED_FamilyPtrList 
   SplitByType(SMESHDS_SubMesh* theSubMesh,
-             const int        theId);
+              const int        theId);
 
 
   /*! Remove from <Elements> elements, common with <by>,
@@ -121,7 +122,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
     Create family <common> from common elements, with combined groups list.
   */
   void Split (DriverMED_FamilyPtr by,
-             DriverMED_FamilyPtr common);
+              DriverMED_FamilyPtr common);
 
   //! Check, if this family has empty list of elements
   bool IsEmpty () const;
@@ -133,6 +134,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
   ElementsSet                   myElements;
   MED::TStringSet               myGroupNames;
   int                           myGroupAttributVal;
+  std::set<SMDSAbs_ElementType> myTypes; // Issue 0020576
 };
 
 #endif
index 145a13c9319d6efabfc2975bcfb14b61295bff84..af538f52f454eea091667a0eb98e2c2538520d2b 100644 (file)
@@ -48,10 +48,11 @@ static int MYDEBUG = 0;
 #define _EDF_NODE_IDS_
 
 using namespace MED;
+using namespace std;
 
 void
 DriverMED_R_SMESHDS_Mesh
-::SetMeshName(std::string theMeshName)
+::SetMeshName(string theMeshName)
 {
   myMeshName = theMeshName;
 }
@@ -60,7 +61,7 @@ static const SMDS_MeshNode*
 FindNode(const SMDS_Mesh* theMesh, TInt theId){
   const SMDS_MeshNode* aNode = theMesh->FindNode(theId);
   if(aNode) return aNode;
-  EXCEPTION(std::runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
+  EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
 }
 
 
@@ -79,88 +80,88 @@ DriverMED_R_SMESHDS_Mesh
     aResult = DRS_EMPTY;
     if(TInt aNbMeshes = aMed->GetNbMeshes()){
       for(int iMesh = 0; iMesh < aNbMeshes; iMesh++){
-       // Reading the MED mesh
-       //---------------------
-       PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
+        // Reading the MED mesh
+        //---------------------
+        PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
 
-        std::string aMeshName;
+        string aMeshName;
         if (myMeshId != -1) {
-          std::ostringstream aMeshNameStr;
+          ostringstream aMeshNameStr;
           aMeshNameStr<<myMeshId;
           aMeshName = aMeshNameStr.str();
         } else {
           aMeshName = myMeshName;
         }
-       if(MYDEBUG) MESSAGE("Perform - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
-       if(aMeshName != aMeshInfo->GetName()) continue;
+        if(MYDEBUG) MESSAGE("Perform - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
+        if(aMeshName != aMeshInfo->GetName()) continue;
         aResult = DRS_OK;
 
-       //TInt aMeshDim = aMeshInfo->GetDim();
-       
+        //TInt aMeshDim = aMeshInfo->GetDim();
+        
         // Reading MED families to the temporary structure
-       //------------------------------------------------
-       TErr anErr;
-       TInt aNbFams = aMed->GetNbFamilies(aMeshInfo);
+        //------------------------------------------------
+        TErr anErr;
+        TInt aNbFams = aMed->GetNbFamilies(aMeshInfo);
         if(MYDEBUG) MESSAGE("Read " << aNbFams << " families");
         for (TInt iFam = 0; iFam < aNbFams; iFam++) {
-         PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr);
-         if(anErr >= 0){
-           TInt aFamId = aFamilyInfo->GetId();
-           if(MYDEBUG) MESSAGE("Family " << aFamId << " :");
-           
+          PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr);
+          if(anErr >= 0){
+            TInt aFamId = aFamilyInfo->GetId();
+            if(MYDEBUG) MESSAGE("Family " << aFamId << " :");
+            
             DriverMED_FamilyPtr aFamily (new DriverMED_Family);
-           
+            
             TInt aNbGrp = aFamilyInfo->GetNbGroup();
             if(MYDEBUG) MESSAGE("belong to " << aNbGrp << " groups");
-           bool isAttrOk = false;
-           if(aFamilyInfo->GetNbAttr() == aNbGrp)
-             isAttrOk = true;
+            bool isAttrOk = false;
+            if(aFamilyInfo->GetNbAttr() == aNbGrp)
+              isAttrOk = true;
             for (TInt iGr = 0; iGr < aNbGrp; iGr++) {
-              std::string aGroupName = aFamilyInfo->GetGroupName(iGr);
+              string aGroupName = aFamilyInfo->GetGroupName(iGr);
               if(isAttrOk){
-               TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr);
-               aFamily->SetGroupAttributVal(anAttrVal);
-             }
-             
+                TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr);
+                aFamily->SetGroupAttributVal(anAttrVal);
+              }
+              
               if(MYDEBUG) MESSAGE(aGroupName);
               aFamily->AddGroupName(aGroupName);
-             
+              
             }
             aFamily->SetId( aFamId );
             myFamilies[aFamId] = aFamily;
-         }
+          }
         }
 
-       if (aMeshInfo->GetType() == MED::eSTRUCTURE){
-         /*bool aRes = */buildMeshGrille(aMed,aMeshInfo);
-         continue;
-       }
+        if (aMeshInfo->GetType() == MED::eSTRUCTURE){
+          /*bool aRes = */buildMeshGrille(aMed,aMeshInfo);
+          continue;
+        }
 
         // Reading MED nodes to the corresponding SMDS structure
-       //------------------------------------------------------
+        //------------------------------------------------------
         PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
-       if (!aNodeInfo) {
+        if (!aNodeInfo) {
           aResult = DRS_FAIL;
-         continue;
+          continue;
         }
 
-       PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
+        PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
 
-       EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
-       TInt aNbElems = aNodeInfo->GetNbElem();
-       if(MYDEBUG) MESSAGE("Perform - aNodeInfo->GetNbElem() = "<<aNbElems<<"; anIsNodeNum = "<<anIsNodeNum);
+        EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
+        TInt aNbElems = aNodeInfo->GetNbElem();
+        if(MYDEBUG) MESSAGE("Perform - aNodeInfo->GetNbElem() = "<<aNbElems<<"; anIsNodeNum = "<<anIsNodeNum);
         DriverMED_FamilyPtr aFamily;
         for(TInt iElem = 0; iElem < aNbElems; iElem++){
-         TCCoordSlice aCoordSlice = aNodeInfo->GetCoordSlice(iElem);
+          TCCoordSlice aCoordSlice = aNodeInfo->GetCoordSlice(iElem);
           double aCoords[3] = {0.0, 0.0, 0.0};
           for(TInt iDim = 0; iDim < 3; iDim++)
             aCoords[iDim] = aCoordHelper->GetCoord(aCoordSlice,iDim);
           const SMDS_MeshNode* aNode;
           if(anIsNodeNum) {
-           aNode = myMesh->AddNodeWithID
+            aNode = myMesh->AddNodeWithID
               (aCoords[0],aCoords[1],aCoords[2],aNodeInfo->GetElemNum(iElem));
           } else {
-           aNode = myMesh->AddNode
+            aNode = myMesh->AddNode
               (aCoords[0],aCoords[1],aCoords[2]);
           }
           //cout<<aNode->GetID()<<": "<<aNode->X()<<", "<<aNode->Y()<<", "<<aNode->Z()<<endl;
@@ -174,44 +175,44 @@ DriverMED_R_SMESHDS_Mesh
           }
         }
 
-       // Reading pre information about all MED cells
-       //--------------------------------------------
-       typedef MED::TVector<int> TNodeIds;
+        // Reading pre information about all MED cells
+        //--------------------------------------------
+        typedef MED::TVector<int> TNodeIds;
         bool takeNumbers = true;  // initially we trust the numbers from file
-       MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
-       MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
-       for(; anEntityIter != aEntityInfo.end(); anEntityIter++){
-         const EEntiteMaillage& anEntity = anEntityIter->first;
-         if(anEntity == eNOEUD) continue;
-         // Reading MED cells to the corresponding SMDS structure
-         //------------------------------------------------------
-         const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
-         MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
-         for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
-           const EGeometrieElement& aGeom = aGeom2SizeIter->first;
-
-           switch(aGeom) {
-//         case ePOINT1: ## PAL16410
-//           break;
-           case ePOLYGONE: {
+        MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+        MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
+        for(; anEntityIter != aEntityInfo.end(); anEntityIter++){
+          const EEntiteMaillage& anEntity = anEntityIter->first;
+          if(anEntity == eNOEUD) continue;
+          // Reading MED cells to the corresponding SMDS structure
+          //------------------------------------------------------
+          const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
+          MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+          for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+            const EGeometrieElement& aGeom = aGeom2SizeIter->first;
+
+            switch(aGeom) {
+//          case ePOINT1: ## PAL16410
+//            break;
+            case ePOLYGONE: {
               PPolygoneInfo aPolygoneInfo = aMed->GetPPolygoneInfo(aMeshInfo,anEntity,aGeom);
               EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
-             
-             TInt aNbElem = aPolygoneInfo->GetNbElem();
-             for(TInt iElem = 0; iElem < aNbElem; iElem++){
-               MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
-               TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
-               TNodeIds aNodeIds(aNbConn);
+              
+              TInt aNbElem = aPolygoneInfo->GetNbElem();
+              for(TInt iElem = 0; iElem < aNbElem; iElem++){
+                MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
+                TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+                TNodeIds aNodeIds(aNbConn);
 #ifdef _EDF_NODE_IDS_
-               if(anIsNodeNum)
-                 for(TInt iConn = 0; iConn < aNbConn; iConn++)
-                   aNodeIds[iConn] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
-               else
-                 for(TInt iConn = 0; iConn < aNbConn; iConn++)
-                   aNodeIds[iConn] = aConnSlice[iConn];
+                if(anIsNodeNum)
+                  for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                    aNodeIds[iConn] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
+                else
+                  for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                    aNodeIds[iConn] = aConnSlice[iConn];
 #else
-               for(TInt iConn = 0; iConn < aNbConn; iConn++)
-                 aNodeIds[iConn] = aConnSlice[iConn];
+                for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                  aNodeIds[iConn] = aConnSlice[iConn];
 #endif
                 bool isRenum = false;
                 SMDS_MeshElement* anElement = NULL;
@@ -221,12 +222,12 @@ DriverMED_R_SMESHDS_Mesh
                 try{
 #endif
                   if(anIsElemNum){
-                   TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
+                    TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
                     anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId);
-                 }
+                  }
                   if(!anElement){
-                    std::vector<const SMDS_MeshNode*> aNodes(aNbConn);
-                   for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                    vector<const SMDS_MeshNode*> aNodes(aNbConn);
+                    for(TInt iConn = 0; iConn < aNbConn; iConn++)
                       aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
                     anElement = myMesh->AddPolygonalFace(aNodes);
                     isRenum = anIsElemNum;
@@ -256,107 +257,107 @@ DriverMED_R_SMESHDS_Mesh
                 }
               }
               break;
-           }
-           case ePOLYEDRE: {
+            }
+            case ePOLYEDRE: {
               PPolyedreInfo aPolyedreInfo = aMed->GetPPolyedreInfo(aMeshInfo,anEntity,aGeom);
               EBooleen anIsElemNum = takeNumbers ? aPolyedreInfo->IsElemNum() : eFAUX;
 
-             TInt aNbElem = aPolyedreInfo->GetNbElem();
-             for(TInt iElem = 0; iElem < aNbElem; iElem++){
-               MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
-               TInt aNbFaces = aConnSliceArr.size();
+              TInt aNbElem = aPolyedreInfo->GetNbElem();
+              for(TInt iElem = 0; iElem < aNbElem; iElem++){
+                MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+                TInt aNbFaces = aConnSliceArr.size();
                 typedef MED::TVector<int> TQuantities;
-               TQuantities aQuantities(aNbFaces);
-               TInt aNbNodes = aPolyedreInfo->GetNbNodes(iElem);
-               TNodeIds aNodeIds(aNbNodes);
-               for(TInt iFace = 0, iNode = 0; iFace < aNbFaces; iFace++){
-                 MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
-                 TInt aNbConn = aConnSlice.size();
+                TQuantities aQuantities(aNbFaces);
+                TInt aNbNodes = aPolyedreInfo->GetNbNodes(iElem);
+                TNodeIds aNodeIds(aNbNodes);
+                for(TInt iFace = 0, iNode = 0; iFace < aNbFaces; iFace++){
+                  MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+                  TInt aNbConn = aConnSlice.size();
                   aQuantities[iFace] = aNbConn;
 #ifdef _EDF_NODE_IDS_
-                 if(anIsNodeNum)
-                   for(TInt iConn = 0; iConn < aNbConn; iConn++)
-                     aNodeIds[iNode++] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
-                 else
-                   for(TInt iConn = 0; iConn < aNbConn; iConn++)
-                     aNodeIds[iNode++] = aConnSlice[iConn];
+                  if(anIsNodeNum)
+                    for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                      aNodeIds[iNode++] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
+                  else
+                    for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                      aNodeIds[iNode++] = aConnSlice[iConn];
 #else
-                 for(TInt iConn = 0; iConn < aNbConn; iConn++)
-                   aNodeIds[iNode++] = aConnSlice[iConn];
-#endif         
-               }
-
-               bool isRenum = false;
-               SMDS_MeshElement* anElement = NULL;
-               TInt aFamNum = aPolyedreInfo->GetFamNum(iElem);
-               
+                  for(TInt iConn = 0; iConn < aNbConn; iConn++)
+                    aNodeIds[iNode++] = aConnSlice[iConn];
+#endif          
+                }
+
+                bool isRenum = false;
+                SMDS_MeshElement* anElement = NULL;
+                TInt aFamNum = aPolyedreInfo->GetFamNum(iElem);
+                
 #ifndef _DEXCEPT_
-               try{
+                try{
 #endif
-                 if(anIsElemNum){
-                   TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
-                   anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
-                 }
-                 if(!anElement){
-                   std::vector<const SMDS_MeshNode*> aNodes(aNbNodes);
-                   for(TInt iConn = 0; iConn < aNbNodes; iConn++)
-                     aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
-                   anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
-                   isRenum = anIsElemNum;
-                 }
+                  if(anIsElemNum){
+                    TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
+                    anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
+                  }
+                  if(!anElement){
+                    vector<const SMDS_MeshNode*> aNodes(aNbNodes);
+                    for(TInt iConn = 0; iConn < aNbNodes; iConn++)
+                      aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
+                    anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
+                    isRenum = anIsElemNum;
+                  }
 #ifndef _DEXCEPT_
-               }catch(const std::exception& exc){
-                 aResult = DRS_FAIL;
-               }catch(...){
-                 aResult = DRS_FAIL;
-               }
-#endif         
-               if(!anElement){
-                 aResult = DRS_WARN_SKIP_ELEM;
-               }else{
-                 if(isRenum){
-                   anIsElemNum = eFAUX;
-                   takeNumbers = false;
-                   if (aResult < DRS_WARN_RENUMBER)
-                     aResult = DRS_WARN_RENUMBER;
-                 }
-                 if ( checkFamilyID ( aFamily, aFamNum )) {
-                   // Save reference to this element from its family
-                   aFamily->AddElement(anElement);
-                   aFamily->SetType(anElement->GetType());
-                 }
-               }
-             }
+                }catch(const std::exception& exc){
+                  aResult = DRS_FAIL;
+                }catch(...){
+                  aResult = DRS_FAIL;
+                }
+#endif          
+                if(!anElement){
+                  aResult = DRS_WARN_SKIP_ELEM;
+                }else{
+                  if(isRenum){
+                    anIsElemNum = eFAUX;
+                    takeNumbers = false;
+                    if (aResult < DRS_WARN_RENUMBER)
+                      aResult = DRS_WARN_RENUMBER;
+                  }
+                  if ( checkFamilyID ( aFamily, aFamNum )) {
+                    // Save reference to this element from its family
+                    aFamily->AddElement(anElement);
+                    aFamily->SetType(anElement->GetType());
+                  }
+                }
+              }
               break;
             }
-           default: {
+            default: {
               PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
               EBooleen anIsElemNum = takeNumbers ? aCellInfo->IsElemNum() : eFAUX;
               TInt aNbElems = aCellInfo->GetNbElem();
               if(MYDEBUG) MESSAGE("Perform - anEntity = "<<anEntity<<"; anIsElemNum = "<<anIsElemNum);
               if(MYDEBUG) MESSAGE("Perform - aGeom = "<<aGeom<<"; aNbElems = "<<aNbElems);
 
+              TInt aNbNodes = -1;
+              switch(aGeom){
+              case eSEG2:    aNbNodes = 2;  break;
+              case eSEG3:    aNbNodes = 3;  break;
+              case eTRIA3:   aNbNodes = 3;  break;
+              case eTRIA6:   aNbNodes = 6;  break;
+              case eQUAD4:   aNbNodes = 4;  break;
+              case eQUAD8:   aNbNodes = 8;  break;
+              case eTETRA4:  aNbNodes = 4;  break;
+              case eTETRA10: aNbNodes = 10; break;
+              case ePYRA5:   aNbNodes = 5;  break;
+              case ePYRA13:  aNbNodes = 13; break;
+              case ePENTA6:  aNbNodes = 6;  break;
+              case ePENTA15: aNbNodes = 15; break;
+              case eHEXA8:   aNbNodes = 8;  break;
+              case eHEXA20:  aNbNodes = 20; break;
+              case ePOINT1:  aNbNodes = 1;  break;
+              default:;
+              }
+              vector<TInt> aNodeIds(aNbNodes);
               for(int iElem = 0; iElem < aNbElems; iElem++){
-                TInt aNbNodes = -1;
-                switch(aGeom){
-                case eSEG2:    aNbNodes = 2;  break;
-                case eSEG3:    aNbNodes = 3;  break;
-                case eTRIA3:   aNbNodes = 3;  break;
-                case eTRIA6:   aNbNodes = 6;  break;
-                case eQUAD4:   aNbNodes = 4;  break;
-                case eQUAD8:   aNbNodes = 8;  break;
-                case eTETRA4:  aNbNodes = 4;  break;
-                case eTETRA10: aNbNodes = 10; break;
-                case ePYRA5:   aNbNodes = 5;  break;
-                case ePYRA13:  aNbNodes = 13; break;
-                case ePENTA6:  aNbNodes = 6;  break;
-                case ePENTA15: aNbNodes = 15; break;
-                case eHEXA8:   aNbNodes = 8;  break;
-                case eHEXA20:  aNbNodes = 20; break;
-                case ePOINT1:  aNbNodes = 1;  break;
-                default:;
-                }
-                std::vector<TInt> aNodeIds(aNbNodes);
                 bool anIsValidConnect = false;
                 TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
 #ifndef _DEXCEPT_
@@ -736,9 +737,9 @@ DriverMED_R_SMESHDS_Mesh
   return aResult;
 }
 
-std::list<std::string> DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
+list<string> DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
 {
-  std::list<std::string> aMeshNames;
+  list<string> aMeshNames;
 
   try {
     if(MYDEBUG) MESSAGE("GetMeshNames - myFile : " << myFile);
@@ -747,10 +748,10 @@ std::list<std::string> DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
 
     if (TInt aNbMeshes = aMed->GetNbMeshes()) {
       for (int iMesh = 0; iMesh < aNbMeshes; iMesh++) {
-       // Reading the MED mesh
-       //---------------------
-       PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
-       aMeshNames.push_back(aMeshInfo->GetName());
+        // Reading the MED mesh
+        //---------------------
+        PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
+        aMeshNames.push_back(aMeshInfo->GetName());
       }
     }
   }catch(const std::exception& exc){
@@ -764,26 +765,28 @@ std::list<std::string> DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
   return aMeshNames;
 }
 
-std::list<TNameAndType> DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
+list<TNameAndType> DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
 {
-  std::list<TNameAndType> aResult;
-  std::set<TNameAndType> aResGroupNames;
+  list<TNameAndType> aResult;
+  set<TNameAndType> aResGroupNames;
 
-  std::map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
+  map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
   for (; aFamsIter != myFamilies.end(); aFamsIter++)
   {
     DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
     const MED::TStringSet& aGroupNames = aFamily->GetGroupNames();
-    std::set<std::string>::const_iterator aGrNamesIter = aGroupNames.begin();
+    set<string>::const_iterator aGrNamesIter = aGroupNames.begin();
     for (; aGrNamesIter != aGroupNames.end(); aGrNamesIter++)
     {
-      TNameAndType aNameAndType = make_pair( *aGrNamesIter, aFamily->GetType() );
-      // Check, if this is a Group or SubMesh name
-//if (aName.substr(0, 5) == string("Group")) {
+      const set< SMDSAbs_ElementType >& types = aFamily->GetTypes();
+      set< SMDSAbs_ElementType >::const_iterator type = types.begin();
+      for ( ; type != types.end(); ++type )
+      {
+        TNameAndType aNameAndType = make_pair( *aGrNamesIter, *type );
         if ( aResGroupNames.insert( aNameAndType ).second ) {
           aResult.push_back( aNameAndType );
         }
-//    }
+      }
     }
   }
 
@@ -792,28 +795,28 @@ std::list<TNameAndType> DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
 
 void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
 {
-  std::string aGroupName (theGroup->GetStoreName());
+  string aGroupName (theGroup->GetStoreName());
   if(MYDEBUG) MESSAGE("Get Group " << aGroupName);
 
-  std::map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
+  map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
   for (; aFamsIter != myFamilies.end(); aFamsIter++)
   {
     DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
-    if (aFamily->GetType() == theGroup->GetType() && aFamily->MemberOf(aGroupName))
+    if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
     {
-      const std::set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
-      std::set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
-      const SMDS_MeshElement * element = 0;
+      const set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
+      set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
       for (; anElemsIter != anElements.end(); anElemsIter++)
       {
-        element = *anElemsIter;
-       theGroup->SMDSGroup().Add(element);
-       int aGroupAttrVal = aFamily->GetGroupAttributVal();
-       if( aGroupAttrVal != 0)
-         theGroup->SetColorGroup(aGroupAttrVal);
+        const SMDS_MeshElement * element = *anElemsIter;
+        if ( element->GetType() == theGroup->GetType() ) // Issue 0020576
+          theGroup->SMDSGroup().Add(element);
       }
-      if ( element )
-        theGroup->SetType( theGroup->SMDSGroup().GetType() );
+      int aGroupAttrVal = aFamily->GetGroupAttributVal();
+      if( aGroupAttrVal != 0)
+        theGroup->SetColorGroup(aGroupAttrVal);
+//       if ( element ) -- Issue 0020576
+//         theGroup->SetType( theGroup->SMDSGroup().GetType() );
     }
   }
 }
@@ -823,15 +826,15 @@ void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh,
 {
   char submeshGrpName[ 30 ];
   sprintf( submeshGrpName, "SubMesh %d", theId );
-  std::string aName (submeshGrpName);
-  std::map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
+  string aName (submeshGrpName);
+  map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
   for (; aFamsIter != myFamilies.end(); aFamsIter++)
   {
     DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
     if (aFamily->MemberOf(aName))
     {
-      const std::set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
-      std::set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
+      const set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
+      set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
       if (aFamily->GetType() == SMDSAbs_Node)
       {
         for (; anElemsIter != anElements.end(); anElemsIter++)
@@ -853,21 +856,21 @@ void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh,
 
 void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
 {
-  std::map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
+  map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
   for (; aFamsIter != myFamilies.end(); aFamsIter++)
   {
     DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
     MED::TStringSet aGroupNames = aFamily->GetGroupNames();
-    std::set<std::string>::iterator aGrNamesIter = aGroupNames.begin();
+    set<string>::iterator aGrNamesIter = aGroupNames.begin();
     for (; aGrNamesIter != aGroupNames.end(); aGrNamesIter++)
     {
-      std::string aName = *aGrNamesIter;
+      string aName = *aGrNamesIter;
       // Check, if this is a Group or SubMesh name
-      if (aName.substr(0, 7) == std::string("SubMesh"))
+      if (aName.substr(0, 7) == string("SubMesh"))
       {
-        int Id = atoi(std::string(aName).substr(7).c_str());
-        std::set<const SMDS_MeshElement *> anElements = aFamily->GetElements();
-        std::set<const SMDS_MeshElement *>::iterator anElemsIter = anElements.begin();
+        int Id = atoi(string(aName).substr(7).c_str());
+        set<const SMDS_MeshElement *> anElements = aFamily->GetElements();
+        set<const SMDS_MeshElement *>::iterator anElemsIter = anElements.begin();
         if (aFamily->GetType() == SMDSAbs_Node)
         {
           for (; anElemsIter != anElements.end(); anElemsIter++)
@@ -909,7 +912,7 @@ void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
 bool DriverMED_R_SMESHDS_Mesh::checkFamilyID(DriverMED_FamilyPtr & aFamily, int anID) const
 {
   if ( !aFamily || aFamily->GetId() != anID ) {
-    std::map<int, DriverMED_FamilyPtr>::const_iterator i_fam = myFamilies.find(anID);
+    map<int, DriverMED_FamilyPtr>::const_iterator i_fam = myFamilies.find(anID);
     if ( i_fam == myFamilies.end() )
       return false;
     aFamily = i_fam->second;
@@ -924,7 +927,7 @@ bool DriverMED_R_SMESHDS_Mesh::checkFamilyID(DriverMED_FamilyPtr & aFamily, int
  * \return TRUE, if successfully. Else FALSE
  */
 bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
-                                              const MED::PMeshInfo& theMeshInfo)
+                                               const MED::PMeshInfo& theMeshInfo)
 {
   bool res = true;
 
@@ -944,10 +947,10 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
     if((aGrilleInfo->myFamNumNode).size() > 0){
       TInt aFamNum = aGrilleInfo->GetFamNumNode(iNode);
       if ( checkFamilyID ( aFamily, aFamNum ))
-       {
-         aFamily->AddElement(aNode);
-         aFamily->SetType(SMDSAbs_Node);
-       }
+        {
+          aFamily->AddElement(aNode);
+          aFamily->SetType(SMDSAbs_Node);
+        }
     }
     
   }
@@ -959,38 +962,38 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
     switch(aGrilleInfo->GetGeom()){
     case MED::eSEG2:
       if(aNodeIds.size() != 2){
-       res = false;
-       EXCEPTION(std::runtime_error,"buildMeshGrille Error. Incorrect size of ids 2!="<<aNodeIds.size());
+        res = false;
+        EXCEPTION(runtime_error,"buildMeshGrille Error. Incorrect size of ids 2!="<<aNodeIds.size());
       }
       anElement = myMesh->AddEdgeWithID(aNodeIds[0],
-                                       aNodeIds[1],
-                                       iCell);
+                                        aNodeIds[1],
+                                        iCell);
       break;
     case MED::eQUAD4:
       if(aNodeIds.size() != 4){
-       res = false;
-       EXCEPTION(std::runtime_error,"buildMeshGrille Error. Incorrect size of ids 4!="<<aNodeIds.size());
+        res = false;
+        EXCEPTION(runtime_error,"buildMeshGrille Error. Incorrect size of ids 4!="<<aNodeIds.size());
       }
       anElement = myMesh->AddFaceWithID(aNodeIds[0],
-                                       aNodeIds[2],
-                                       aNodeIds[3],
-                                       aNodeIds[1],
-                                       iCell);
+                                        aNodeIds[2],
+                                        aNodeIds[3],
+                                        aNodeIds[1],
+                                        iCell);
       break;
     case MED::eHEXA8:
       if(aNodeIds.size() != 8){
-       res = false;
-       EXCEPTION(std::runtime_error,"buildMeshGrille Error. Incorrect size of ids 8!="<<aNodeIds.size());
+        res = false;
+        EXCEPTION(runtime_error,"buildMeshGrille Error. Incorrect size of ids 8!="<<aNodeIds.size());
       }
       anElement = myMesh->AddVolumeWithID(aNodeIds[0],
-                                         aNodeIds[2],
-                                         aNodeIds[3],
-                                         aNodeIds[1],
-                                         aNodeIds[4],
-                                         aNodeIds[6],
-                                         aNodeIds[7],
-                                         aNodeIds[5],
-                                         iCell);
+                                          aNodeIds[2],
+                                          aNodeIds[3],
+                                          aNodeIds[1],
+                                          aNodeIds[4],
+                                          aNodeIds[6],
+                                          aNodeIds[7],
+                                          aNodeIds[5],
+                                          iCell);
       break;
     default:
       break;
@@ -999,8 +1002,8 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
     if((aGrilleInfo->myFamNum).size() > 0){
       TInt aFamNum = aGrilleInfo->GetFamNum(iCell);
       if ( checkFamilyID ( aFamily, aFamNum )){
-       aFamily->AddElement(anElement);
-       aFamily->SetType(anElement->GetType());
+        aFamily->AddElement(anElement);
+        aFamily->SetType(anElement->GetType());
       }
     }
   }
index 2ccaa3f3d7625b8188a5d8f6f82bc5e8c4e20321..3f63ff4852941c1e85dceda0c532fe9a3ea0a9a9 100644 (file)
@@ -62,7 +62,7 @@ class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
   bool checkFamilyID(DriverMED_FamilyPtr & aFamily, int anID) const;
 
   bool buildMeshGrille(const MED::PWrapper& theWrapper,
-                      const MED::PMeshInfo& theMeshInfo);
+                       const MED::PMeshInfo& theMeshInfo);
 
  private:
   std::string myMeshName;
index 8afbd565946986776352cb5154ae3b755f9c036e..9c97adb9bfde2b7e230db7da3b570bcfd15a6e96 100644 (file)
@@ -54,7 +54,7 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
 {}
 
 void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, 
-                                      MED::EVersion theId)
+                                       MED::EVersion theId)
 {
   myMed = CrWrapper(theFileName,theId);
   Driver_SMESHDS_Mesh::SetFile(theFileName);
@@ -189,9 +189,9 @@ namespace{
     TUnit* myUnit;
   public:
     TCoordHelper(const SMDS_NodeIteratorPtr& theNodeIter,
-                TGetCoord* theGetCoord,
-                TName* theName,
-                TUnit* theUnit = aUnit):
+                 TGetCoord* theGetCoord,
+                 TName* theName,
+                 TUnit* theUnit = aUnit):
       myNodeIter(theNodeIter),
       myGetCoord(theGetCoord),
       myName(theName),
@@ -200,7 +200,7 @@ namespace{
     virtual ~TCoordHelper(){}
     bool Next(){ 
       return myNodeIter->more() && 
-       (myCurrentNode = myNodeIter->next());
+        (myCurrentNode = myNodeIter->next());
     }
     const SMDS_MeshNode* GetNode(){
       return myCurrentNode;
@@ -352,33 +352,33 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       bool anIsYDimension = false;
       bool anIsZDimension = false;
       {
-       SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
-       double aBounds[6];
-       if(aNodesIter->more()){
-         const SMDS_MeshNode* aNode = aNodesIter->next();
-         aBounds[0] = aBounds[1] = aNode->X();
-         aBounds[2] = aBounds[3] = aNode->Y();
-         aBounds[4] = aBounds[5] = aNode->Z();
-       }
-       while(aNodesIter->more()){
-         const SMDS_MeshNode* aNode = aNodesIter->next();
-         aBounds[0] = min(aBounds[0],aNode->X());
-         aBounds[1] = max(aBounds[1],aNode->X());
-         
-         aBounds[2] = min(aBounds[2],aNode->Y());
-         aBounds[3] = max(aBounds[3],aNode->Y());
-         
-         aBounds[4] = min(aBounds[4],aNode->Z());
-         aBounds[5] = max(aBounds[5],aNode->Z());
-       }
-
-       double EPS = 1.0E-7;
-       anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
-       anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
-       anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
-       aMeshDimension = anIsXDimension + anIsYDimension + anIsZDimension;
-       if(!aMeshDimension)
-         aMeshDimension = 3;
+        SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
+        double aBounds[6];
+        if(aNodesIter->more()){
+          const SMDS_MeshNode* aNode = aNodesIter->next();
+          aBounds[0] = aBounds[1] = aNode->X();
+          aBounds[2] = aBounds[3] = aNode->Y();
+          aBounds[4] = aBounds[5] = aNode->Z();
+        }
+        while(aNodesIter->more()){
+          const SMDS_MeshNode* aNode = aNodesIter->next();
+          aBounds[0] = min(aBounds[0],aNode->X());
+          aBounds[1] = max(aBounds[1],aNode->X());
+          
+          aBounds[2] = min(aBounds[2],aNode->Y());
+          aBounds[3] = max(aBounds[3],aNode->Y());
+          
+          aBounds[4] = min(aBounds[4],aNode->Z());
+          aBounds[5] = max(aBounds[5],aNode->Z());
+        }
+
+        double EPS = 1.0E-7;
+        anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
+        anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
+        anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
+        aMeshDimension = anIsXDimension + anIsYDimension + anIsZDimension;
+        if(!aMeshDimension)
+          aMeshDimension = 3;
         // PAL16857(SMESH not conform to the MED convention):
         if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane
           aMeshDimension = 3;
@@ -395,24 +395,24 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
       switch(aMeshDimension){
       case 3:
-       aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYZGetCoord,aXYZName));
-       break;
+        aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYZGetCoord,aXYZName));
+        break;
       case 2:
-       if(anIsXDimension && anIsYDimension)
-         aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYGetCoord,aXYName));
-       if(anIsYDimension && anIsZDimension)
-         aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYZGetCoord,aYZName));
-       if(anIsXDimension && anIsZDimension)
-         aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXZGetCoord,aXZName));
-       break;
+        if(anIsXDimension && anIsYDimension)
+          aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYGetCoord,aXYName));
+        if(anIsYDimension && anIsZDimension)
+          aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYZGetCoord,aYZName));
+        if(anIsXDimension && anIsZDimension)
+          aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXZGetCoord,aXZName));
+        break;
       case 1:
-       if(anIsXDimension)
-         aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXGetCoord,aXName));
-       if(anIsYDimension)
-         aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYGetCoord,aYName));
-       if(anIsZDimension)
-         aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aZGetCoord,aZName));
-       break;
+        if(anIsXDimension)
+          aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXGetCoord,aXName));
+        if(anIsYDimension)
+          aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYGetCoord,aYName));
+        if(anIsZDimension)
+          aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aZGetCoord,aZName));
+        break;
       }
     }
 
@@ -495,7 +495,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       // coordinates
       TCoordSlice aTCoordSlice = aNodeInfo->GetCoordSlice( iNode );
       for(TInt iCoord = 0; iCoord < aMeshDimension; iCoord++){
-       aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord);
+        aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord);
       }
       // node number
       int aNodeID = aCoordHelperPtr->GetID();
index c438fa334639dc62cffd0ff3696250611e8b10b5..617cb6dfb2cf437c518976dff43a13ee01b5316c 100644 (file)
@@ -30,6 +30,8 @@
 #include "UNV2417_Structure.hxx"
 #include "UNV_Utilities.hxx"
 
+#include <Basics_Utils.hxx>
+
 using namespace std;
 
 
@@ -49,6 +51,7 @@ DriverUNV_R_SMDS_Mesh::~DriverUNV_R_SMDS_Mesh()
 
 Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
 {
+  Kernel_Utils::Localizer loc;
   Status aResult = DRS_OK;
   std::ifstream in_stream(myFile.c_str());
   try{
index 7a4da5e92370de5accf86158924f1cf11a6196ac..7b3a4d22ba4fd1d2439af5ae88f725f4407dab1f 100644 (file)
@@ -36,6 +36,8 @@
 #include "UNV2417_Structure.hxx"
 #include "UNV_Utilities.hxx"
 
+#include <Basics_Utils.hxx>
+
 using namespace std;
 using namespace UNV;
 
@@ -57,6 +59,7 @@ namespace{
 
 Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
 {
+  Kernel_Utils::Localizer loc;
   Status aResult = DRS_OK;
   std::ofstream out_stream(myFile.c_str());
   try{
index ba69102858f96da7bdc58c7bb0be7b6176f2a3ed..bad160b7ffaa1e445245b632aa9a4bb198c23ab3 100644 (file)
@@ -79,6 +79,7 @@ libMeshDriverUNV_la_CPPFLAGS = \
 
 libMeshDriverUNV_la_LDFLAGS  = \
        ../Driver/libMeshDriver.la \
+       $(KERNEL_LDFLAGS) -lSALOMEBasics \
        $(CAS_KERNEL)
 
 UNV_Test_CPPFLAGS = \
index f1579fa3a1d9e999f9e4cf7f9479bb5c45209a7f..9d9e80c5b67004127d6d5ac372e13505d684cf19 100755 (executable)
@@ -36,7 +36,10 @@ extern "C"
   MEFISTO2D_EXPORT   
     R
   #ifdef WIN32
+  #ifdef F2C_BUILD
+  #else
       __stdcall
+  #endif
   #endif
       areteideale()//( R3 xyz, R3 direction )
   {
@@ -52,8 +55,11 @@ static double cpunew, cpuold=0;
 
 void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
 #endif
+#endif
 tempscpu_( double & tempsec )
 //Retourne le temps CPU utilise en secondes
 {  
@@ -64,8 +70,11 @@ tempscpu_( double & tempsec )
 
 void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
 #endif
+#endif
 deltacpu_( R & dtcpu )
 //Retourne le temps CPU utilise en secondes depuis le precedent appel
 {
@@ -744,7 +753,10 @@ void  aptrte( Z   nutysu, R      aretmx,
 }
 void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
  qualitetrte( R3 *mnpxyd,
                   Z & mosoar, Z & mxsoar, Z *mnsoar,
index 68fb0e63ac414a1e6681d4953592a658fbe459e4..a1f11cb8083f0c60199e34bf9eea3f3ef578a377 100755 (executable)
@@ -156,7 +156,10 @@ MEFISTO2D_EXPORT
 
 extern "C" { void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
    qualitetrte( R3 *mnpxyd,
                   Z & mosoar, Z & mxsoar, Z *mnsoar,
@@ -193,7 +196,10 @@ extern "C" { void
 
 extern "C" {  void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   tempscpu( double & tempsec );
 }
@@ -202,7 +208,10 @@ extern "C" {  void
 
 extern "C" { void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   deltacpu( R & dtcpu );
 }
@@ -212,7 +221,10 @@ extern "C" { void
 //initialiser le tableau mnsoar pour le hachage des aretes
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   insoar( Z & mxsomm, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar );
 }
@@ -220,14 +232,20 @@ extern "C" {void
 //mettre a zero les nb entiers de tab
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   azeroi( Z & nb, Z * tab );
 }
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   fasoar( Z & ns1, Z & ns2, Z & nt1, Z & nt2, Z & nolign,
                          Z & mosoar,  Z & mxsoar,  Z & n1soar,  Z * mnsoar,  Z * mnarst,
@@ -279,7 +297,10 @@ extern "C" {void
 //initialisation du tableau letree et ajout dans letree des sommets 1 a nbsomm
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   teajte( Z & mxsomm, Z &  nbsomm, R3 * mnpxyd,  R3 * comxmi,
                            R & aretmx,  Z & mxtree, Z * letree,
@@ -288,7 +309,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   tehote( Z & nutysu, Z & nbarpi, Z &  mxsomm, Z &  nbsomm, R3 * mnpxyd,
                            R3 * comxmi, R & aretmx,
@@ -300,7 +324,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   tetrte( R3 * comxmi, R & aretmx, Z & nbarpi, Z & mxsomm, R3 * mnpxyd,
                            Z & mxqueu,  Z * mnqueu,  Z * mntree,
@@ -313,7 +340,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   aisoar( Z & mosoar, Z & mxsoar, Z * mnsoar, Z & na );
 }
@@ -321,7 +351,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   tedela( R3 * mnpxyd, Z * mnarst,
                            Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z & na,
@@ -332,7 +365,10 @@ extern "C" {void
  
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   terefr( Z & nbarpi, R3 * mnpxyd,
                            Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
@@ -346,7 +382,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   tesuex( Z & nblf, Z * nulftr,
                            Z & ndtri0, Z & nbsomm, R3 * mnpxyd, Z * mnslig,
@@ -358,7 +397,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   teamqt( Z & nutysu, R & aretmx, R & airemx,
                            Z * mnarst, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
@@ -377,7 +419,10 @@ extern "C" {void
  
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   nusotr( Z & nt, Z & mosoar, Z * mnsoar, Z & moartr, Z * mnartr,Z * nosotr );
 }
@@ -385,7 +430,10 @@ extern "C" {void
 
 extern "C" {void
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   qutr2d( R3 & p1, R3 & p2, R3 & p3, R & qualite );
 }
@@ -393,7 +441,10 @@ extern "C" {void
 
 extern "C" { R
 #ifdef WIN32
+#ifdef F2C_BUILD
+#else
               __stdcall
+#endif
 #endif
   surtd2( R3 & p1, R3 & p2, R3 & p3 );
 }
index 30a2e591a560815f81b59e6abba663ba62a7c8ec..9a04613b394b6663d8e378c79d02e9ac699d8ffd 100644 (file)
@@ -36,7 +36,6 @@ salomeinclude_HEADERS = \
        SMESH_DeviceActor.h \
        SMESH_PreviewActorsCollection.h \
        SMESH_ExtractGeometry.h \
-       SMESH_ActorUtils.h \
        SMESH_FaceOrientationFilter.h
 
 # Libraries targets
@@ -77,5 +76,6 @@ libSMESHObject_la_LDFLAGS  = \
         ../SMDS/libSMDS.la \
         ../Controls/libSMESHControls.la \
         $(GUI_LDFLAGS) -lSalomeApp -lSalomeObject -lSVTK -lVTKViewer -lqtx -lsuit \
+       $(GEOM_LDFLAGS) -lGEOMObject \
        $(CAS_KERNEL) \
         $(VTK_LIBS) $(QT_MT_LIBS)
index 4709f9357bd26325684bdbd5b79d82a0fd8f2cd8..7a37d65410b17301f6db14ab0fb145891d3ea17f 100644 (file)
 #include <vtkImplicitBoolean.h>
 #include <vtkImplicitFunctionCollection.h>
 
+#include <vtkConfigure.h>
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
 #include "utilities.h"
 
 #ifdef _DEBUG_
@@ -90,9 +95,9 @@ SMESH_ActorDef* SMESH_ActorDef::New(){
 
 
 SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj, 
-                             const char* theEntry, 
-                             const char* theName,
-                             int theIsClear)
+                              const char* theEntry, 
+                              const char* theName,
+                              int theIsClear)
 {
   SMESH_ActorDef* anActor = SMESH_ActorDef::New();
   if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){
@@ -399,7 +404,11 @@ SMESH_ActorDef::SMESH_ActorDef()
     
   myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
   myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION >= 0x050200)
+  myPtsLabeledDataMapper->SetLabelFormat("%d");
+#else
   myPtsLabeledDataMapper->SetLabelFormat("%g");
+#endif
   myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
     
   vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
@@ -440,7 +449,11 @@ SMESH_ActorDef::SMESH_ActorDef()
     
   myClsLabeledDataMapper = vtkLabeledDataMapper::New();
   myClsLabeledDataMapper->SetInput(myClsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION >= 0x050200)
+  myClsLabeledDataMapper->SetLabelFormat("%d");
+#else
   myClsLabeledDataMapper->SetLabelFormat("%g");
+#endif
   myClsLabeledDataMapper->SetLabelModeToLabelScalars();
     
   vtkTextProperty* aClsTextProp = vtkTextProperty::New();
@@ -593,7 +606,7 @@ void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
     vtkIntArray *anArray = vtkIntArray::New();
     anArray->SetNumberOfValues( aNbElem );
     
-    for ( int anId = 0; anId < aNbElem; anId++ )
+    for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
     {
       int aSMDSId = myVisualObj->GetNodeObjId( anId );
       anArray->SetValue( anId, aSMDSId );
@@ -664,7 +677,7 @@ SetControlMode(eControl theMode)
 void 
 SMESH_ActorDef::
 SetControlMode(eControl theMode,
-              bool theCheckEntityMode)
+               bool theCheckEntityMode)
 {
   SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();  
   if( !mgr )
@@ -796,41 +809,41 @@ SetControlMode(eControl theMode,
       myControlMode = theMode;
       switch(myControlMode){
       case eFreeNodes:
-       myNodeExtActor->SetExtControlMode(aFunctor);
-       break;
+        myNodeExtActor->SetExtControlMode(aFunctor);
+        break;
       case eFreeEdges:
       case eFreeBorders:
-       my1DExtActor->SetExtControlMode(aFunctor);
-       break;
+        my1DExtActor->SetExtControlMode(aFunctor);
+        break;
       case eFreeFaces:
-       my2DExtActor->SetExtControlMode(aFunctor);
-       break;
+        my2DExtActor->SetExtControlMode(aFunctor);
+        break;
       case eLength2D:
       case eMultiConnection2D:
-       my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
-       break;
+        my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
+        break;
       default:
-       myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
+        myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
       }
     }
 
     if(theCheckEntityMode){
       if(myControlActor == my1DActor)
-       SetEntityMode(eEdges);
+        SetEntityMode(eEdges);
       else if(myControlActor == my2DActor){
-       switch(myControlMode){
-       case eLength2D:
-       case eFreeEdges:
-       case eFreeFaces:
-       case eMultiConnection2D:
-         //SetEntityMode(eEdges);
-         SetEntityMode(eFaces);
-         break;
-       default:
-         SetEntityMode(eFaces);
-       }
+        switch(myControlMode){
+        case eLength2D:
+        case eFreeEdges:
+        case eFreeFaces:
+        case eMultiConnection2D:
+          //SetEntityMode(eEdges);
+          SetEntityMode(eFaces);
+          break;
+        default:
+          SetEntityMode(eFaces);
+        }
       }else if(myControlActor == my3DActor)
-       SetEntityMode(eVolumes);
+        SetEntityMode(eVolumes);
     }
 
   }else if(theCheckEntityMode){
@@ -900,9 +913,9 @@ void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
 
 
 bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, 
-                         const char* theEntry, 
-                         const char* theName,
-                         int theIsClear)
+                          const char* theEntry, 
+                          const char* theName,
+                          int theIsClear)
 {
   Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(theEntry,"SMESH",theName);
   setIO(anIO);
@@ -1034,8 +1047,8 @@ bool SMESH_ActorDef::IsInfinitive(){
   vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
   aDataSet->Update();
   myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
-    aDataSet->GetNumberOfCells() == 1 && 
-    aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX;
+    aDataSet->GetNumberOfCells() == 1 && 
+    aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX );
   return SALOME_Actor::IsInfinitive();
 }
 
@@ -1149,21 +1162,21 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
     if(myControlMode != eNone){
       switch(myControlMode){
       case eFreeNodes:
-       myNodeExtActor->VisibilityOn();
-       break;
+        myNodeExtActor->VisibilityOn();
+        break;
       case eFreeEdges:
       case eFreeBorders:
-       my1DExtActor->VisibilityOn();
-       break;
+        my1DExtActor->VisibilityOn();
+        break;
       case eFreeFaces:
-       my2DExtActor->VisibilityOn();
-       break;
+        my2DExtActor->VisibilityOn();
+        break;
       case eLength2D:
       case eMultiConnection2D:
-       my1DExtActor->VisibilityOn();
+        my1DExtActor->VisibilityOn();
       default:
-       if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
-         myScalarBarActor->VisibilityOn();
+        if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
+          myScalarBarActor->VisibilityOn();
       }
     }
 
@@ -1250,7 +1263,11 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
 
   VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
   aHightFilter->ClearRegisteredCellsWithType();
-  aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+
+  // The following row has been commented (initially added in 1.28.2.3.1 revision)
+  // Reason: seems to be unnecessary, this filter should always have default (ePassAll) mode of changing
+  // In addition, it leads to exception (see bug IPAL21372)
+  //aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
 
   if (myEntityMode & e0DElements) {
     if (MYDEBUG) MESSAGE("0D ELEMENTS");
@@ -1458,12 +1475,12 @@ void SMESH_ActorDef::UpdateHighlight(){
       myHighlitableActor->SetHighlited(anIsVisible);
       myHighlitableActor->SetVisibility(anIsVisible);
       myHighlitableActor->GetExtractUnstructuredGrid()->
-       SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
+        SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
     }else if(myRepresentation == ePoint || GetPointRepresentation()){
       myHighlitableActor->SetHighlited(anIsVisible);
       myHighlitableActor->GetExtractUnstructuredGrid()->
-       SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+        SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
       myHighlitableActor->SetVisibility(anIsVisible);
       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
     }
@@ -1581,7 +1598,7 @@ void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType
   mySurfaceProp->SetColor(r,g,b);
   if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
     if( aGroupObj->GetElementType() == SMDSAbs_Face ||
-       aGroupObj->GetElementType() == SMDSAbs_Volume )
+        aGroupObj->GetElementType() == SMDSAbs_Volume )
       myNameActor->SetBackgroundColor(r,g,b);
   Modified();
 }
@@ -1754,8 +1771,8 @@ GetClippingPlane(vtkIdType theID)
 
 
 static void ComputeBoundsParam(vtkDataSet* theDataSet,
-                              vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3],
-                              vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj)
+                               vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3],
+                               vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj)
 {
   vtkFloatingPointType aBounds[6];
   theDataSet->GetBounds(aBounds);
@@ -1769,13 +1786,13 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet,
   }
 
   vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
-                              {aBounds[1],aBounds[2],aBounds[4]},
-                              {aBounds[0],aBounds[3],aBounds[4]},
-                              {aBounds[1],aBounds[3],aBounds[4]},
-                              {aBounds[0],aBounds[2],aBounds[5]},
-                              {aBounds[1],aBounds[2],aBounds[5]}, 
-                              {aBounds[0],aBounds[3],aBounds[5]}, 
-                              {aBounds[1],aBounds[3],aBounds[5]}};
+                               {aBounds[1],aBounds[2],aBounds[4]},
+                               {aBounds[0],aBounds[3],aBounds[4]},
+                               {aBounds[1],aBounds[3],aBounds[4]},
+                               {aBounds[0],aBounds[2],aBounds[5]},
+                               {aBounds[1],aBounds[2],aBounds[5]}, 
+                               {aBounds[0],aBounds[3],aBounds[5]}, 
+                               {aBounds[1],aBounds[3],aBounds[5]}};
 
   int aMaxId = 0, aMinId = aMaxId;
   theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
@@ -1799,7 +1816,7 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet,
 
 
 static void DistanceToPosition(vtkDataSet* theDataSet,
-                              vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3])
+                               vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3])
 {
   vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
   ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
@@ -1811,7 +1828,7 @@ static void DistanceToPosition(vtkDataSet* theDataSet,
 
 
 static void PositionToDistance(vtkDataSet* theDataSet, 
-                              vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist)
+                               vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist)
 {
   vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
   ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
index 99005dcf1fbe3257a192afbb3cc8ce5b730561f3..89f4fc51acf9814560b0d56b40ab9cdd110ddd35 100644 (file)
@@ -44,9 +44,9 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
  public:
   vtkTypeMacro(SMESH_Actor,SALOME_Actor);
   static SMESH_Actor* New(TVisualObjPtr theVisualObj, 
-                         const char* theEntry, 
-                         const char* theName,
-                         int theIsClear);
+                          const char* theEntry, 
+                          const char* theName,
+                          int theIsClear);
   
   virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
   virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
@@ -102,7 +102,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
 
   enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
                 eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
-                eMinimumAngle, eWarping, eSkew,        eAspectRatio3D, eMultiConnection2D, eVolume3D};
+                eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D};
   virtual void SetControlMode(eControl theMode) = 0;
   virtual eControl GetControlMode() = 0;
 
index dbbe0a5bbb1bedc1aa52bab8a163c0d3c7cc2c10..98f87fd047a4603e5a129159d6b0e7449d5c8cee 100644 (file)
@@ -272,9 +272,9 @@ class SMESH_ActorDef : public SMESH_Actor
   ~SMESH_ActorDef();
 
   bool Init(TVisualObjPtr theVisualObj, 
-           const char* theEntry, 
-           const char* theName,
-           int theIsClear);
+            const char* theEntry, 
+            const char* theName,
+            int theIsClear);
 
   void SetIsShrunkable(bool theShrunkable);
   void UpdateHighlight();
index c8fcbfe2489d97497adda170b64a6455c4a5cdf0..872a30acd4290739525619f8262e4d429502d12c 100644 (file)
@@ -41,7 +41,7 @@ namespace SMESH
 
   vtkFloatingPointType
   GetFloat( const QString& theValue, 
-           vtkFloatingPointType theDefault )
+            vtkFloatingPointType theDefault )
   {
     int pos = theValue.indexOf( ":" );
     vtkFloatingPointType val = theDefault;
@@ -50,15 +50,15 @@ namespace SMESH
       QString name = theValue.right( theValue.length()-pos-1 ),
               sect = theValue.left( pos );
       if( !name.isEmpty() && !sect.isEmpty() )
-       val = GetFloat( name, sect, theDefault );
+        val = GetFloat( name, sect, theDefault );
     }
     return val;
   }
 
   vtkFloatingPointType
   GetFloat( const QString& theValue, 
-           const QString& theSection, 
-           vtkFloatingPointType theDefault )
+            const QString& theSection, 
+            vtkFloatingPointType theDefault )
   {
     vtkFloatingPointType val = theDefault;
     SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -70,7 +70,7 @@ namespace SMESH
 
   void
   WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, 
-                       const char* theFileName)
+                        const char* theFileName)
   {
     vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
     aWriter->SetFileName(theFileName);
@@ -83,8 +83,8 @@ namespace SMESH
 
   QColor
   GetColor( const QString& theSect, 
-           const QString& theName, 
-           const QColor& def )
+            const QString& theName, 
+            const QColor& def )
   {
     QColor c = def;
     SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -95,11 +95,11 @@ namespace SMESH
 
   void
   GetColor( const QString& theSect, 
-           const QString& theName, 
-           int& r, 
-           int& g, 
-           int& b, 
-           const QColor& def )
+            const QString& theName, 
+            int& r, 
+            int& g, 
+            int& b, 
+            const QColor& def )
   {
     QColor c = def;
     SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -111,11 +111,11 @@ namespace SMESH
 
   void
   GetColor( const QString& theSect, 
-           const QString& theName, 
-           vtkFloatingPointType& r, 
-           vtkFloatingPointType& g, 
-           vtkFloatingPointType& b, 
-           const QColor& def )
+            const QString& theName, 
+            vtkFloatingPointType& r, 
+            vtkFloatingPointType& g, 
+            vtkFloatingPointType& b, 
+            const QColor& def )
   {
     int ir( 0 ), ig( 0 ), ib( 0 );
     GetColor( theSect, theName, ir, ig, ib, def );
index a494f743b5d317b7486e5f846031cca3bed8a10e..69451fcac9b727700d22c8359a57362ef3d087dc 100644 (file)
@@ -33,42 +33,42 @@ namespace SMESH
 SMESHOBJECT_EXPORT  
   vtkFloatingPointType 
   GetFloat( const QString& theValue, 
-           vtkFloatingPointType theDefault = 0 );
+            vtkFloatingPointType theDefault = 0 );
 
 SMESHOBJECT_EXPORT
   vtkFloatingPointType 
   GetFloat( const QString& theName, 
-           const QString& theSection, 
-           vtkFloatingPointType theDefault = 0 );
+            const QString& theSection, 
+            vtkFloatingPointType theDefault = 0 );
 
 SMESHOBJECT_EXPORT
   QColor 
   GetColor( const QString& theSect, 
-           const QString& theName, 
-           const QColor& = QColor() );
+            const QString& theName, 
+            const QColor& = QColor() );
 
 SMESHOBJECT_EXPORT
   void
   GetColor( const QString& theSect, 
-           const QString& theName, 
-           int&, 
-           int&, 
-           int&, 
-           const QColor& = QColor() );
+            const QString& theName, 
+            int&, 
+            int&, 
+            int&, 
+            const QColor& = QColor() );
 
 SMESHOBJECT_EXPORT
   void
   GetColor( const QString& theSect, 
-           const QString& theName, 
-           vtkFloatingPointType&, 
-           vtkFloatingPointType&, 
-           vtkFloatingPointType&, 
-           const QColor& = QColor() );
+            const QString& theName, 
+            vtkFloatingPointType&, 
+            vtkFloatingPointType&, 
+            vtkFloatingPointType&, 
+            const QColor& = QColor() );
 
 SMESHOBJECT_EXPORT
   void 
   WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, 
-                       const char* theFileName);
+                        const char* theFileName);
 
 }
 
index 2a657eb34b87da6fb05ff0a9413aa0f1db403d74..4d0626902228f86a9e23f10e27d43179e588b445 100644 (file)
@@ -91,7 +91,7 @@ SMESH_DeviceActor
   myMapper = vtkPolyDataMapper::New();
 
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                myPolygonOffsetUnits);
+                                                                 myPolygonOffsetUnits);
 
   myMapper->UseLookupTableScalarRangeOn();
   myMapper->SetColorModeToMapScalars();
@@ -281,8 +281,8 @@ SMESH_DeviceActor
 void
 SMESH_DeviceActor
 ::SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
-                vtkScalarBarActor* theScalarBarActor,
-                vtkLookupTable* theLookupTable)
+                 vtkScalarBarActor* theScalarBarActor,
+                 vtkLookupTable* theLookupTable)
 {
   bool anIsInitialized = theFunctor;
   if(anIsInitialized){
@@ -304,23 +304,23 @@ SMESH_DeviceActor
     using namespace SMESH::Controls;
     if(NumericalFunctor* aNumericalFunctor = dynamic_cast<NumericalFunctor*>(theFunctor.get())){
       for(vtkIdType i = 0; i < aNbCells; i++){
-       vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
-       vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
-       double aValue = aNumericalFunctor->GetValue(anObjId);
-       aScalars->SetValue(i,aValue);
+        vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
+        vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
+        double aValue = aNumericalFunctor->GetValue(anObjId);
+        aScalars->SetValue(i,aValue);
       }
     }else if(Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get())){
       for(vtkIdType i = 0; i < aNbCells; i++){
-       vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
-       vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
-       bool aValue = aPredicate->IsSatisfy(anObjId);
-       aScalars->SetValue(i,aValue);
+        vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
+        vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
+        bool aValue = aPredicate->IsSatisfy(anObjId);
+        aScalars->SetValue(i,aValue);
       }
     }
 
     aDataSet->GetCellData()->SetScalars(aScalars);
     aScalars->Delete();
-       
+        
     theLookupTable->SetRange(aScalars->GetRange());
     theLookupTable->SetNumberOfTableValues(theScalarBarActor->GetMaximumNumberOfColors());
     theLookupTable->Build();
@@ -335,8 +335,8 @@ SMESH_DeviceActor
 void
 SMESH_DeviceActor
 ::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
-                   vtkScalarBarActor* theScalarBarActor,
-                   vtkLookupTable* theLookupTable)
+                    vtkScalarBarActor* theScalarBarActor,
+                    vtkLookupTable* theLookupTable)
 {
   bool anIsInitialized = theFunctor;
   myExtractUnstructuredGrid->ClearRegisteredCells();
@@ -374,18 +374,18 @@ SMESH_DeviceActor
       
       Length2D::TValues::const_iterator anIter = aValues.begin();
       for(vtkIdType aVtkId = 0; anIter != aValues.end(); anIter++,aVtkId++){
-       const Length2D::Value& aValue = *anIter;
-       int aNode[2] = {
-         myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
-         myVisualObj->GetNodeVTKId(aValue.myPntId[1])
-       };
-       if(aNode[0] >= 0 && aNode[1] >= 0){
-         anIdList->SetId( 0, aNode[0] );
-         anIdList->SetId( 1, aNode[1] );
-         aConnectivity->InsertNextCell( anIdList );
-         aCellTypesArray->InsertNextValue( VTK_LINE );
-         aScalars->SetValue(aVtkId,aValue.myLength);
-       }
+        const Length2D::Value& aValue = *anIter;
+        int aNode[2] = {
+          myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
+          myVisualObj->GetNodeVTKId(aValue.myPntId[1])
+        };
+        if(aNode[0] >= 0 && aNode[1] >= 0){
+          anIdList->SetId( 0, aNode[0] );
+          anIdList->SetId( 1, aNode[1] );
+          aConnectivity->InsertNextCell( anIdList );
+          aCellTypesArray->InsertNextValue( VTK_LINE );
+          aScalars->SetValue(aVtkId,aValue.myLength);
+        }
       }
       
       VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
@@ -394,7 +394,7 @@ SMESH_DeviceActor
       
       aConnectivity->InitTraversal();
       for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
-       aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
+        aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
       
       aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
       SetUnstructuredGrid(aDataSet);
@@ -434,18 +434,18 @@ SMESH_DeviceActor
       
       MultiConnection2D::MValues::const_iterator anIter = aValues.begin();
       for(vtkIdType aVtkId = 0; anIter != aValues.end(); anIter++,aVtkId++){
-       const MultiConnection2D::Value& aValue = (*anIter).first;
-       int aNode[2] = {
-         myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
-         myVisualObj->GetNodeVTKId(aValue.myPntId[1])
-       };
-       if(aNode[0] >= 0 && aNode[1] >= 0){
-         anIdList->SetId( 0, aNode[0] );
-         anIdList->SetId( 1, aNode[1] );
-         aConnectivity->InsertNextCell( anIdList );
-         aCellTypesArray->InsertNextValue( VTK_LINE );
-         aScalars->SetValue(aVtkId,(*anIter).second);
-       }
+        const MultiConnection2D::Value& aValue = (*anIter).first;
+        int aNode[2] = {
+          myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
+          myVisualObj->GetNodeVTKId(aValue.myPntId[1])
+        };
+        if(aNode[0] >= 0 && aNode[1] >= 0){
+          anIdList->SetId( 0, aNode[0] );
+          anIdList->SetId( 1, aNode[1] );
+          aConnectivity->InsertNextCell( anIdList );
+          aCellTypesArray->InsertNextValue( VTK_LINE );
+          aScalars->SetValue(aVtkId,(*anIter).second);
+        }
       }
       
       VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
@@ -454,7 +454,7 @@ SMESH_DeviceActor
       
       aConnectivity->InitTraversal();
       for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
-       aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
+        aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
       
       aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
       SetUnstructuredGrid(aDataSet);
@@ -492,7 +492,7 @@ SMESH_DeviceActor
     for( vtkIdType i = 0; i < aNbCells; i++ ){
       vtkIdType anObjId = myVisualObj->GetElemObjId(i);
       if(aFreePredicate->IsSatisfy(anObjId))
-       myExtractUnstructuredGrid->RegisterCell(i);
+        myExtractUnstructuredGrid->RegisterCell(i);
     }
     if(!myExtractUnstructuredGrid->IsCellsRegistered())
       myExtractUnstructuredGrid->RegisterCell(-1);
@@ -520,15 +520,15 @@ SMESH_DeviceActor
     for(; anIter != aBorders.end(); anIter++){
       const FreeEdges::Border& aBorder = *anIter;
       int aNode[2] = {
-       myVisualObj->GetNodeVTKId(aBorder.myPntId[0]),
-       myVisualObj->GetNodeVTKId(aBorder.myPntId[1])
+        myVisualObj->GetNodeVTKId(aBorder.myPntId[0]),
+        myVisualObj->GetNodeVTKId(aBorder.myPntId[1])
       };
       //cout<<"aNode = "<<aBorder.myPntId[0]<<"; "<<aBorder.myPntId[1]<<endl;
       if(aNode[0] >= 0 && aNode[1] >= 0){
-       anIdList->SetId( 0, aNode[0] );
-       anIdList->SetId( 1, aNode[1] );
-       aConnectivity->InsertNextCell( anIdList );
-       aCellTypesArray->InsertNextValue( VTK_LINE );
+        anIdList->SetId( 0, aNode[0] );
+        anIdList->SetId( 1, aNode[1] );
+        aConnectivity->InsertNextCell( anIdList );
+        aCellTypesArray->InsertNextValue( VTK_LINE );
       }
     }
     
@@ -546,12 +546,11 @@ SMESH_DeviceActor
     aDataSet->Delete();
   }else if(FreeNodes* aFreeNodes = dynamic_cast<FreeNodes*>(theFunctor.get())){
     myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
-    vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid();
     vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
     for( vtkIdType i = 0; i < aNbNodes; i++ ){
       vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
       if(aFreeNodes->IsSatisfy(anObjId))
-       myExtractUnstructuredGrid->RegisterCell(i);
+        myExtractUnstructuredGrid->RegisterCell(i);
     }
     if(!myExtractUnstructuredGrid->IsCellsRegistered())
       myExtractUnstructuredGrid->RegisterCell(-1);
@@ -828,7 +827,7 @@ SMESH_DeviceActor
 void
 SMESH_DeviceActor
 ::SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units)
+                             vtkFloatingPointType units)
 {
   myPolygonOffsetFactor = factor;
   myPolygonOffsetUnits = units;
index 2180501608adc7c77d4990b34fd98b0c19e6c979..0b9acb48fe7886a213f04debac51d28d741ffc52 100644 (file)
@@ -109,11 +109,11 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
   vtkUnstructuredGrid* GetUnstructuredGrid();
 
   void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
-                     vtkScalarBarActor* theScalarBarActor,
-                     vtkLookupTable* theLookupTable);
+                      vtkScalarBarActor* theScalarBarActor,
+                      vtkLookupTable* theLookupTable);
   void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
-                        vtkScalarBarActor* theScalarBarActor,
-                        vtkLookupTable* theLookupTable);
+                         vtkScalarBarActor* theScalarBarActor,
+                         vtkLookupTable* theLookupTable);
   void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor);
 
   bool IsHighlited() { return myIsHighlited;}
@@ -161,11 +161,11 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
 
   void
   SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units);
+                             vtkFloatingPointType units);
 
   void
   GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                            vtkFloatingPointType& units)
+                             vtkFloatingPointType& units)
   {
     factor = myPolygonOffsetFactor;
     units = myPolygonOffsetUnits;
index 0376aba38567c85db8c9d8e8e7a3967d46030a23..c7c63af364c2a6d136fbf75aae92922bfaacdbbd 100644 (file)
@@ -152,7 +152,7 @@ int SMESH_ExtractGeometry::RequestData(
         {
         newId = newPts->InsertNextPoint(x);
         pointMap[ptId] = newId;
-       myNodeVTK2ObjIds.push_back(ptId);
+        myNodeVTK2ObjIds.push_back(ptId);
         outputPD->CopyData(pd,ptId,newId);
         }
       }
@@ -175,7 +175,7 @@ int SMESH_ExtractGeometry::RequestData(
           {
           newId = newPts->InsertNextPoint(x);
           pointMap[ptId] = newId;
-         myNodeVTK2ObjIds.push_back(ptId);
+          myNodeVTK2ObjIds.push_back(ptId);
           outputPD->CopyData(pd,ptId,newId);
           }
         }
@@ -228,7 +228,7 @@ int SMESH_ExtractGeometry::RequestData(
             x = input->GetPoint(ptId);
             newId = newPts->InsertNextPoint(x);
             pointMap[ptId] = newId;
-           myNodeVTK2ObjIds.push_back(ptId);
+            myNodeVTK2ObjIds.push_back(ptId);
             outputPD->CopyData(pd,ptId,newId);
             }
           newCellPts->InsertId(i,pointMap[ptId]);
index a7f5d1d944da3eed8a299886c1d8c7d0cd647071..cf09779d02985062d4d3dfa5444275ea1ee43017 100644 (file)
@@ -209,8 +209,8 @@ void GetFaceParams( vtkCell* theFace, double theNormal[3], double& theSize )
 
   double* aBounds = theFace->GetBounds();
   theSize = pow( pow( aBounds[1] - aBounds[0], 2 ) +
-                pow( aBounds[3] - aBounds[2], 2 ) +
-                pow( aBounds[5] - aBounds[4], 2 ), 0.5 );
+                 pow( aBounds[3] - aBounds[2], 2 ) +
+                 pow( aBounds[5] - aBounds[4], 2 ), 0.5 );
 }
 
 /*!
@@ -268,7 +268,7 @@ int SMESH_FaceOrientationFilter::RequestData(
 
       input->GetCellNeighbors( aCellId, aFace->PointIds, aNeighborIds );
       if( aNeighborIds->GetNumberOfIds() > 0 )
-       continue;
+        continue;
 
       double aSize, aNormal[3];
       GetFaceParams( aFace, aNormal, aSize );
index 5f12330ef3c71b23fbdc8642aaa3d57389108f95..e7ef139a4a2d3b88b12c5fe1b78ade97652bfab8 100644 (file)
@@ -46,7 +46,7 @@
 #include <vtkUnstructuredGrid.h>
 
 #include <memory>
-#include <sstream>     
+#include <sstream>      
 #include <stdexcept>
 #include <set>
 
@@ -81,7 +81,7 @@ static int MYDEBUGWITHFILES = 0;
 // purpose  : Get type of VTK cell
 //=================================================================================
 static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
-                                    const bool thePoly,
+                                     const bool thePoly,
                                      const int theNbNodes )
 {
   switch( theType )
@@ -263,7 +263,7 @@ namespace{
   typedef std::vector<const SMDS_MeshElement*> TConnect;
 
   int GetConnect(const SMDS_ElemIteratorPtr& theNodesIter, 
-                TConnect& theConnect)
+                 TConnect& theConnect)
   {
     theConnect.clear();
     for(; theNodesIter->more();)
@@ -273,10 +273,10 @@ namespace{
   
   inline 
   void SetId(vtkIdList *theIdList, 
-            const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes, 
-            const TConnect& theConnect, 
-            int thePosition,
-            int theId)
+             const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes, 
+             const TConnect& theConnect, 
+             int thePosition,
+             int theId)
   {
     theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second);
   }
@@ -372,12 +372,12 @@ void SMESH_VisualObjDef::buildElemPrs()
         myVTK2SMDSElems.insert( TMapOfIds::value_type( iElem, anId ) );
 
         SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
-       switch (aType) {
-       case SMDSAbs_Volume:{
+        switch (aType) {
+        case SMDSAbs_Volume:{
           aConnect.clear();
-         std::vector<int> aConnectivities;
-         // Convertions connectivities from SMDS to VTK
-         if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
+          std::vector<int> aConnectivities;
+          // Convertions connectivities from SMDS to VTK
+          if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
 
             if ( const SMDS_PolyhedralVolumeOfNodes* ph =
                  dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
@@ -385,67 +385,67 @@ void SMESH_VisualObjDef::buildElemPrs()
               aNbNodes = GetConnect(ph->uniqueNodesIterator(),aConnect);
               anIdList->SetNumberOfIds( aNbNodes );
             }
-           for (int k = 0; k < aNbNodes; k++)
-             aConnectivities.push_back(k);
+            for (int k = 0; k < aNbNodes; k++)
+              aConnectivities.push_back(k);
 
           } else if (aNbNodes == 4) {
-           static int anIds[] = {0,2,1,3};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+            static int anIds[] = {0,2,1,3};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
 
-         } else if (aNbNodes == 5) {
-           static int anIds[] = {0,3,2,1,4};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+          } else if (aNbNodes == 5) {
+            static int anIds[] = {0,3,2,1,4};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
 
-         } else if (aNbNodes == 6) {
-           static int anIds[] = {0,1,2,3,4,5};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+          } else if (aNbNodes == 6) {
+            static int anIds[] = {0,1,2,3,4,5};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
 
-         }
+          }
           else if (aNbNodes == 8) {
-           static int anIds[] = {0,3,2,1,4,7,6,5};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+            static int anIds[] = {0,3,2,1,4,7,6,5};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
 
-         }
+          }
           else if (aNbNodes == 10) {
-           static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
-         }
+            static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+          }
           else if (aNbNodes == 13) {
-           static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
-         }
+            static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+          }
           else if (aNbNodes == 15) {
             //static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
             static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
-           //for (int k = 0; k < aNbNodes; k++) {
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+            //for (int k = 0; k < aNbNodes; k++) {
             //  int nn = aConnectivities[k];
             //  const SMDS_MeshNode* N = static_cast<const SMDS_MeshNode*> (aConnect[nn]);
             //  cout<<"k="<<k<<"  N("<<N->X()<<","<<N->Y()<<","<<N->Z()<<")"<<endl;
             //}
-         }
+          }
           else if (aNbNodes == 20) {
-           static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
-           for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
-         }
+            static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
+            for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+          }
           else {
           }
 
           if ( aConnect.empty() )
             GetConnect(aNodesIter,aConnect);
 
-         if (aConnectivities.size() > 0) {
-           for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
-             SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
-         }
-         break;
-       }
-       default:
-         for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
-           const SMDS_MeshElement* aNode = aNodesIter->next();
-           anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
-         }
-       }
+          if (aConnectivities.size() > 0) {
+            for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
+              SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
+          }
+          break;
+        }
+        default:
+          for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
+            const SMDS_MeshElement* aNode = aNodesIter->next();
+            anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
+          }
+        }
 
         aConnectivity->InsertNextCell( anIdList );
         aCellTypesArray->InsertNextValue( getCellType( aType, anElem->IsPoly(), aNbNodes ) );
@@ -483,9 +483,9 @@ void SMESH_VisualObjDef::buildElemPrs()
 // purpose  : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 )
 //=================================================================================
 bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
-                                      const int theEdgeNum,
-                                      int&      theNodeId1,
-                                      int&      theNodeId2 ) const
+                                       const int theEdgeNum,
+                                       int&      theNodeId1,
+                                       int&      theNodeId2 ) const
 {
   const SMDS_Mesh* aMesh = GetMesh();
   if ( aMesh == 0 )
@@ -520,6 +520,19 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
   return true;
 }
 
+//=================================================================================
+// function : IsValid
+// purpose  : Return true if there are some entities
+//=================================================================================
+bool SMESH_VisualObjDef::IsValid() const
+{
+  return GetNbEntities(SMDSAbs_Node) > 0      || 
+         GetNbEntities(SMDSAbs_0DElement) > 0 || 
+         GetNbEntities(SMDSAbs_Edge) > 0      || 
+         GetNbEntities(SMDSAbs_Face) > 0      ||
+         GetNbEntities(SMDSAbs_Volume) > 0 ;
+}
+
 /*
   Class       : SMESH_MeshObj
   Description : Class for visualisation of mesh
@@ -678,7 +691,7 @@ void SMESH_MeshObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor
 //=================================================================================
 bool SMESH_MeshObj::IsNodePrs() const
 {
-  return myClient->NbEdges() == 0 &&myClient->NbFaces() == 0 && myClient->NbVolumes() == 0 ;
+  return myClient->Nb0DElements() == 0 && myClient->NbEdges() == 0 && myClient->NbFaces() == 0 && myClient->NbVolumes() == 0 ;
 }
 
 
@@ -905,7 +918,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
     case SMDSAbs_Volume:
     {
       SMESH::long_array_var anIds = 
-       mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
+        mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
       return anIds->length();
     }
     default:
@@ -942,7 +955,7 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis
     else
     {
       SMESH::long_array_var anIds = 
-       mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
+        mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
       return getPointers( theType, anIds, aMesh, theResList );
     }
   }
index 3d4dbbf8b433b30c685b8a1b1d7808c53220d5e9..3bc178eca4127f47a2da547bfb6dda5083086f3f 100644 (file)
@@ -62,9 +62,10 @@ public:
   virtual SMDS_Mesh* GetMesh() const = 0;
 
   virtual bool GetEdgeNodes( const int theElemId,
-                            const int theEdgeNum,
-                            int&      theNodeId1,
-                            int&      theNodeId2 ) const = 0;
+                             const int theEdgeNum,
+                             int&      theNodeId1,
+                             int&      theNodeId2 ) const = 0;
+  virtual bool              IsValid() const = 0;
   
   virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
   
index 094504f33adae44e735ae4507141a1e47f2df5fc..82f540913bf98a5d8bba36689338348a2a3675e7 100644 (file)
@@ -69,6 +69,8 @@ public:
   virtual bool              IsNodePrs() const = 0;
   virtual SMDS_Mesh*        GetMesh() const = 0;
 
+  virtual bool              IsValid() const;
+
   virtual bool              GetEdgeNodes( const int theElemId,
                                           const int theEdgeNum,
                                           int&      theNodeId1,
index d07e33b712e2423b05a55e1ed83ea078f9851905..e565701dabe1d9cfc10ec8634aa0d58b20742034 100644 (file)
@@ -137,25 +137,25 @@ GEOM_Actor* SMESH_PreviewActorsCollection::createActor(const TopoDS_Shape& shape
   actor->SetShape(shape,0,0);
 
   //Color Properties
-  /*   
-       vtkProperty* aProp = vtkProperty::New();
-       vtkProperty* aHLProp = vtkProperty::New();
-       vtkProperty* aPHLProp = vtkProperty::New();
-       
-       aProp->SetColor( 255, 0, 0);
-       actor->SetProperty(aProp);
-
-       aHLProp->SetColor( 255, 255, 255);
-       actor->SetHighlightProperty(aHLProp);
-
-       aPHLProp->SetColor( 155, 155, 155);
-       aPHLProp->SetLineWidth ( 3 );
-       aPHLProp->SetOpacity ( 0.75 );
-       actor->SetPreHighlightProperty(aPHLProp);
-
-       aProp->Delete();
-       aHLProp->Delete();
-       aPHLProp->Delete();
+  /*    
+        vtkProperty* aProp = vtkProperty::New();
+        vtkProperty* aHLProp = vtkProperty::New();
+        vtkProperty* aPHLProp = vtkProperty::New();
+        
+        aProp->SetColor( 255, 0, 0);
+        actor->SetProperty(aProp);
+
+        aHLProp->SetColor( 255, 255, 255);
+        actor->SetHighlightProperty(aHLProp);
+
+        aPHLProp->SetColor( 155, 155, 155);
+        aPHLProp->SetLineWidth ( 3 );
+        aPHLProp->SetOpacity ( 0.75 );
+        actor->SetPreHighlightProperty(aPHLProp);
+
+        aProp->Delete();
+        aHLProp->Delete();
+        aPHLProp->Delete();
   */
 
   return actor;
index 1317d2b75e899c2ba359c788b2d8c6b5a1509d6e..ae5bf5ccd2075d06355945aef55d4e00ac005049 100644 (file)
@@ -36,7 +36,7 @@ using namespace std;
 //=======================================================================
 
 SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
-       const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
+        const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
 {
 }
 
@@ -47,21 +47,21 @@ SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
 
 const double *SMDS_EdgePosition::Coords() const
 {
-       static double origin[]={0,0,0};
-       MESSAGE("SMDS_EdgePosition::Coords not implemented");
-       return origin;
+        static double origin[]={0,0,0};
+        MESSAGE("SMDS_EdgePosition::Coords not implemented");
+        return origin;
 }
 
 /**
 */
 SMDS_TypeOfPosition SMDS_EdgePosition::GetTypeOfPosition() const
 {
-       return SMDS_TOP_EDGE;
+        return SMDS_TOP_EDGE;
 }
 
 void SMDS_EdgePosition::SetUParameter(double aUparam)
 {
-       myUParameter = aUparam;
+        myUParameter = aUparam;
 }
 
 //=======================================================================
@@ -71,5 +71,5 @@ void SMDS_EdgePosition::SetUParameter(double aUparam)
 
 double SMDS_EdgePosition::GetUParameter() const 
 {
-       return myUParameter;
+        return myUParameter;
 }
index 8a68e9a1e87794a13e29c02984d64adf79a6b4da..db64ab7823f8f9a06bb1e76cef828295bdae2b6e 100644 (file)
@@ -75,40 +75,40 @@ public:
 
   virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID);
   virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       int ID);
   virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2);
+                                 const SMDS_MeshNode * n2);
 
   // 2d order edge with 3 nodes: n12 - node between n1 and n2
   virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID);
   virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n12,
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n12,
+                                       int ID);
   virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
                                  const SMDS_MeshNode * n2,
                                  const SMDS_MeshNode * n12);
 
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3,
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3,
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3);
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3);
 
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3,
-                                      const SMDS_MeshNode * n4,
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3,
+                                       const SMDS_MeshNode * n4,
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3,
-                                const SMDS_MeshNode * n4);
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n4);
 
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshEdge * e1,
                                        const SMDS_MeshEdge * e2,
@@ -130,100 +130,100 @@ public:
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
                                        int n12,int n23,int n31, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3,
-                                      const SMDS_MeshNode * n12,
-                                      const SMDS_MeshNode * n23,
-                                      const SMDS_MeshNode * n31,
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3,
+                                       const SMDS_MeshNode * n12,
+                                       const SMDS_MeshNode * n23,
+                                       const SMDS_MeshNode * n31,
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
                                  const SMDS_MeshNode * n12,
-                                const SMDS_MeshNode * n23,
-                                const SMDS_MeshNode * n31);
+                                 const SMDS_MeshNode * n23,
+                                 const SMDS_MeshNode * n31);
 
   // 2d order quadrangle
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
                                        int n12,int n23,int n34,int n41, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3,
-                                      const SMDS_MeshNode * n4,
-                                      const SMDS_MeshNode * n12,
-                                      const SMDS_MeshNode * n23,
-                                      const SMDS_MeshNode * n34,
-                                      const SMDS_MeshNode * n41,
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3,
+                                       const SMDS_MeshNode * n4,
+                                       const SMDS_MeshNode * n12,
+                                       const SMDS_MeshNode * n23,
+                                       const SMDS_MeshNode * n34,
+                                       const SMDS_MeshNode * n41,
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3,
-                                const SMDS_MeshNode * n4,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n4,
                                  const SMDS_MeshNode * n12,
-                                const SMDS_MeshNode * n23,
-                                const SMDS_MeshNode * n34,
-                                const SMDS_MeshNode * n41);
+                                 const SMDS_MeshNode * n23,
+                                 const SMDS_MeshNode * n34,
+                                 const SMDS_MeshNode * n41);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
                                            int n5, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
                                            int n5, int n6, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
                                            int n5, int n6, int n7, int n8, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6,
-                                          const SMDS_MeshNode * n7,
-                                          const SMDS_MeshNode * n8,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6,
+                                           const SMDS_MeshNode * n7,
+                                           const SMDS_MeshNode * n8,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6,
-                                    const SMDS_MeshNode * n7,
-                                    const SMDS_MeshNode * n8);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6,
+                                     const SMDS_MeshNode * n7,
+                                     const SMDS_MeshNode * n8);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshFace * f1,
                                            const SMDS_MeshFace * f2,
@@ -263,20 +263,20 @@ public:
                                            int n12,int n23,int n31,
                                            int n14,int n24,int n34, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n31,
-                                          const SMDS_MeshNode * n14,
-                                          const SMDS_MeshNode * n24,
-                                          const SMDS_MeshNode * n34,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n31,
+                                           const SMDS_MeshNode * n14,
+                                           const SMDS_MeshNode * n24,
+                                           const SMDS_MeshNode * n34,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n31,
@@ -290,24 +290,24 @@ public:
                                            int n15,int n25,int n35,int n45,
                                            int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n34,
-                                          const SMDS_MeshNode * n41,
-                                          const SMDS_MeshNode * n15,
-                                          const SMDS_MeshNode * n25,
-                                          const SMDS_MeshNode * n35,
-                                          const SMDS_MeshNode * n45,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n34,
+                                           const SMDS_MeshNode * n41,
+                                           const SMDS_MeshNode * n15,
+                                           const SMDS_MeshNode * n25,
+                                           const SMDS_MeshNode * n35,
+                                           const SMDS_MeshNode * n45,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n34,
@@ -325,27 +325,27 @@ public:
                                            int n14,int n25,int n36,
                                            int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6,
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n31,
-                                          const SMDS_MeshNode * n45,
-                                          const SMDS_MeshNode * n56,
-                                          const SMDS_MeshNode * n64,
-                                          const SMDS_MeshNode * n14,
-                                          const SMDS_MeshNode * n25,
-                                          const SMDS_MeshNode * n36,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6,
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n31,
+                                           const SMDS_MeshNode * n45,
+                                           const SMDS_MeshNode * n56,
+                                           const SMDS_MeshNode * n64,
+                                           const SMDS_MeshNode * n14,
+                                           const SMDS_MeshNode * n25,
+                                           const SMDS_MeshNode * n36,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6,
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6,
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n31,
@@ -364,34 +364,34 @@ public:
                                            int n15,int n26,int n37,int n48,
                                            int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6,
-                                          const SMDS_MeshNode * n7,
-                                          const SMDS_MeshNode * n8,
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n34,
-                                          const SMDS_MeshNode * n41,
-                                          const SMDS_MeshNode * n56,
-                                          const SMDS_MeshNode * n67,
-                                          const SMDS_MeshNode * n78,
-                                          const SMDS_MeshNode * n85,
-                                          const SMDS_MeshNode * n15,
-                                          const SMDS_MeshNode * n26,
-                                          const SMDS_MeshNode * n37,
-                                          const SMDS_MeshNode * n48,
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6,
+                                           const SMDS_MeshNode * n7,
+                                           const SMDS_MeshNode * n8,
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n34,
+                                           const SMDS_MeshNode * n41,
+                                           const SMDS_MeshNode * n56,
+                                           const SMDS_MeshNode * n67,
+                                           const SMDS_MeshNode * n78,
+                                           const SMDS_MeshNode * n85,
+                                           const SMDS_MeshNode * n15,
+                                           const SMDS_MeshNode * n26,
+                                           const SMDS_MeshNode * n37,
+                                           const SMDS_MeshNode * n48,
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6,
-                                    const SMDS_MeshNode * n7,
-                                    const SMDS_MeshNode * n8,
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6,
+                                     const SMDS_MeshNode * n7,
+                                     const SMDS_MeshNode * n8,
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n34,
@@ -559,29 +559,29 @@ private:
   SMDS_Mesh(SMDS_Mesh * parent);
 
   SMDS_MeshFace * createTriangle(const SMDS_MeshNode * node1,
-                                const SMDS_MeshNode * node2,
-                                const SMDS_MeshNode * node3);
+                                 const SMDS_MeshNode * node2,
+                                 const SMDS_MeshNode * node3);
   SMDS_MeshFace * createQuadrangle(const SMDS_MeshNode * node1,
-                                  const SMDS_MeshNode * node2,
-                                  const SMDS_MeshNode * node3,
-                                  const SMDS_MeshNode * node4,
+                                   const SMDS_MeshNode * node2,
+                                   const SMDS_MeshNode * node3,
+                                   const SMDS_MeshNode * node4,
                                    int ID);
 //  SMDS_Mesh0DElement* Find0DElementOrCreate(const SMDS_MeshNode * n);
   SMDS_MeshEdge* FindEdgeOrCreate(const SMDS_MeshNode * n1,
-                                 const SMDS_MeshNode * n2);
+                                  const SMDS_MeshNode * n2);
   SMDS_MeshFace* FindFaceOrCreate(const SMDS_MeshNode *n1,
-                                 const SMDS_MeshNode *n2,
-                                 const SMDS_MeshNode *n3);
+                                  const SMDS_MeshNode *n2,
+                                  const SMDS_MeshNode *n3);
   SMDS_MeshFace* FindFaceOrCreate(const SMDS_MeshNode *n1,
-                                 const SMDS_MeshNode *n2,
-                                 const SMDS_MeshNode *n3,
-                                 const SMDS_MeshNode *n4);
+                                  const SMDS_MeshNode *n2,
+                                  const SMDS_MeshNode *n3,
+                                  const SMDS_MeshNode *n4);
 
   bool registerElement(int ID, SMDS_MeshElement * element);
 
   void addChildrenWithNodes(std::set<const SMDS_MeshElement*>& setOfChildren,
-                           const SMDS_MeshElement * element,
-                           std::set<const SMDS_MeshElement*>& nodes);
+                            const SMDS_MeshElement * element,
+                            std::set<const SMDS_MeshElement*>& nodes);
 
   inline void adjustmyCellsCapacity(int ID)
   {
index 02e2661a343bbade92a67ed656f792106f7b37dc..73b61ca3fb4b314d5bc9281ed4eb5324cfcc7573 100644 (file)
@@ -40,73 +40,73 @@ using namespace std;
 /// 5,1 and 7,3 are an edges.
 ///////////////////////////////////////////////////////////////////////////////
 SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
-               const SMDS_MeshNode * node1,
-               const SMDS_MeshNode * node2,
-               const SMDS_MeshNode * node3,
-               const SMDS_MeshNode * node4,
-               const SMDS_MeshNode * node5,
-               const SMDS_MeshNode * node6,
-               const SMDS_MeshNode * node7,
-               const SMDS_MeshNode * node8)
+                const SMDS_MeshNode * node1,
+                const SMDS_MeshNode * node2,
+                const SMDS_MeshNode * node3,
+                const SMDS_MeshNode * node4,
+                const SMDS_MeshNode * node5,
+                const SMDS_MeshNode * node6,
+                const SMDS_MeshNode * node7,
+                const SMDS_MeshNode * node8)
 {
-       myNbNodes = 8;
-       myNodes = new const SMDS_MeshNode* [myNbNodes];
-       myNodes[0]=node1;
-       myNodes[1]=node2;
-       myNodes[2]=node3;
-       myNodes[3]=node4;
-       myNodes[4]=node5;
-       myNodes[5]=node6;
-       myNodes[6]=node7;
-       myNodes[7]=node8;
+        myNbNodes = 8;
+        myNodes = new const SMDS_MeshNode* [myNbNodes];
+        myNodes[0]=node1;
+        myNodes[1]=node2;
+        myNodes[2]=node3;
+        myNodes[3]=node4;
+        myNodes[4]=node5;
+        myNodes[5]=node6;
+        myNodes[6]=node7;
+        myNodes[7]=node8;
 }
 
 SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
-               const SMDS_MeshNode * node1,
-               const SMDS_MeshNode * node2,
-               const SMDS_MeshNode * node3,
-               const SMDS_MeshNode * node4)
+                const SMDS_MeshNode * node1,
+                const SMDS_MeshNode * node2,
+                const SMDS_MeshNode * node3,
+                const SMDS_MeshNode * node4)
 {
-       myNbNodes = 4;
-       myNodes = new const SMDS_MeshNode* [myNbNodes];
-       myNodes[0]=node1;
-       myNodes[1]=node2;
-       myNodes[2]=node3;
-       myNodes[3]=node4;
+        myNbNodes = 4;
+        myNodes = new const SMDS_MeshNode* [myNbNodes];
+        myNodes[0]=node1;
+        myNodes[1]=node2;
+        myNodes[2]=node3;
+        myNodes[3]=node4;
 }
 
 SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
-               const SMDS_MeshNode * node1,
-               const SMDS_MeshNode * node2,
-               const SMDS_MeshNode * node3,
-               const SMDS_MeshNode * node4,
-               const SMDS_MeshNode * node5)
+                const SMDS_MeshNode * node1,
+                const SMDS_MeshNode * node2,
+                const SMDS_MeshNode * node3,
+                const SMDS_MeshNode * node4,
+                const SMDS_MeshNode * node5)
 {
-       myNbNodes = 5;
-       myNodes = new const SMDS_MeshNode* [myNbNodes];
-       myNodes[0]=node1;
-       myNodes[1]=node2;
-       myNodes[2]=node3;
-       myNodes[3]=node4;
-       myNodes[4]=node5;
+        myNbNodes = 5;
+        myNodes = new const SMDS_MeshNode* [myNbNodes];
+        myNodes[0]=node1;
+        myNodes[1]=node2;
+        myNodes[2]=node3;
+        myNodes[3]=node4;
+        myNodes[4]=node5;
 }
 
 SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
-               const SMDS_MeshNode * node1,
-               const SMDS_MeshNode * node2,
-               const SMDS_MeshNode * node3,
-               const SMDS_MeshNode * node4,
-               const SMDS_MeshNode * node5,
-               const SMDS_MeshNode * node6)
+                const SMDS_MeshNode * node1,
+                const SMDS_MeshNode * node2,
+                const SMDS_MeshNode * node3,
+                const SMDS_MeshNode * node4,
+                const SMDS_MeshNode * node5,
+                const SMDS_MeshNode * node6)
 {
-       myNbNodes = 6;
-       myNodes = new const SMDS_MeshNode* [myNbNodes];
-       myNodes[0]=node1;
-       myNodes[1]=node2;
-       myNodes[2]=node3;
-       myNodes[3]=node4;
-       myNodes[4]=node5;
-       myNodes[5]=node6;
+        myNbNodes = 6;
+        myNodes = new const SMDS_MeshNode* [myNbNodes];
+        myNodes[0]=node1;
+        myNodes[1]=node2;
+        myNodes[2]=node3;
+        myNodes[3]=node4;
+        myNodes[4]=node5;
+        myNodes[5]=node6;
 }
 
 bool SMDS_VolumeOfNodes::ChangeNodes(const SMDS_MeshNode* nodes[],
@@ -139,40 +139,40 @@ SMDS_VolumeOfNodes::~SMDS_VolumeOfNodes()
 
 void SMDS_VolumeOfNodes::Print(ostream & OS) const
 {
-       OS << "volume <" << GetID() << "> : ";
-       int i;
-       for (i = 0; i < NbNodes()-1; ++i) OS << myNodes[i] << ",";
-       OS << myNodes[NbNodes()-1]<< ") " << endl;
+        OS << "volume <" << GetID() << "> : ";
+        int i;
+        for (i = 0; i < NbNodes()-1; ++i) OS << myNodes[i] << ",";
+        OS << myNodes[NbNodes()-1]<< ") " << endl;
 }
 
 int SMDS_VolumeOfNodes::NbFaces() const
 {
-       switch(NbNodes())
-       {
-       case 4: return 4;
-       case 5: return 5;
-       case 6: return 5;
-       case 8: return 6;
-       default: MESSAGE("invalid number of nodes");
-       }
+        switch(NbNodes())
+        {
+        case 4: return 4;
+        case 5: return 5;
+        case 6: return 5;
+        case 8: return 6;
+        default: MESSAGE("invalid number of nodes");
+        }
         return 0;
 }
 
 int SMDS_VolumeOfNodes::NbNodes() const
 {
-       return myNbNodes;
+        return myNbNodes;
 }
 
 int SMDS_VolumeOfNodes::NbEdges() const
 {
-       switch(NbNodes())
-       {
-       case 4: return 6;
-       case 5: return 8;
-       case 6: return 9;
-       case 8: return 12;
-       default: MESSAGE("invalid number of nodes");
-       }
+        switch(NbNodes())
+        {
+        case 4: return 6;
+        case 5: return 8;
+        case 6: return 9;
+        case 8: return 12;
+        default: MESSAGE("invalid number of nodes");
+        }
         return 0;
 }
 
@@ -234,7 +234,7 @@ SMDS_ElemIteratorPtr SMDS_VolumeOfNodes::elementsIterator(SMDSAbs_ElementType ty
 
 SMDSAbs_ElementType SMDS_VolumeOfNodes::GetType() const
 {
-       return SMDSAbs_Volume;
+        return SMDSAbs_Volume;
 }
 
 /*!
index 0984cb50557e7f684a05180d4f827760c948cd42..24509b255f6b536228c11861aaf6b7b51c1881b0 100644 (file)
@@ -368,6 +368,8 @@ static int QuadHexa_nbN [] = { 8, 8, 8, 8, 8, 8 };
 // ========================================================
 // to perform some calculations without linkage to CASCADE
 // ========================================================
+namespace
+{
 struct XYZ {
   double x;
   double y;
@@ -376,25 +378,26 @@ struct XYZ {
   XYZ( double X, double Y, double Z ) { x = X; y = Y; z = Z; }
   XYZ( const XYZ& other )             { x = other.x; y = other.y; z = other.z; }
   XYZ( const SMDS_MeshNode* n )       { x = n->X(); y = n->Y(); z = n->Z(); }
-  XYZ operator-( const XYZ& other );
-  XYZ Crossed( const XYZ& other );
-  double Dot( const XYZ& other );
-  double Magnitude();
+  inline XYZ operator-( const XYZ& other );
+  inline XYZ Crossed( const XYZ& other );
+  inline double Dot( const XYZ& other );
+  inline double Magnitude();
 };
-XYZ XYZ::operator-( const XYZ& Right ) {
+inline XYZ XYZ::operator-( const XYZ& Right ) {
   return XYZ(x - Right.x, y - Right.y, z - Right.z);
 }
-XYZ XYZ::Crossed( const XYZ& Right ) {
+inline XYZ XYZ::Crossed( const XYZ& Right ) {
   return XYZ (y * Right.z - z * Right.y,
               z * Right.x - x * Right.z,
               x * Right.y - y * Right.x);
 }
-double XYZ::Dot( const XYZ& Other ) {
+inline double XYZ::Dot( const XYZ& Other ) {
   return(x * Other.x + y * Other.y + z * Other.z);
 }
-double XYZ::Magnitude() {
+inline double XYZ::Magnitude() {
   return sqrt (x * x + y * y + z * z);
 }
+}
 
 //=======================================================================
 //function : SMDS_VolumeTool
@@ -837,6 +840,32 @@ bool SMDS_VolumeTool::GetBaryCenter(double & X, double & Y, double & Z) const
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief Classify a point
+ *  \param tol - thickness of faces
+ */
+//================================================================================
+
+bool SMDS_VolumeTool::IsOut(double X, double Y, double Z, double tol)
+{
+  // LIMITATION: for convex volumes only
+  XYZ p( X,Y,Z );
+  for ( int iF = 0; iF < myNbFaces; ++iF )
+  {
+    XYZ faceNormal;
+    if ( !GetFaceNormal( iF, faceNormal.x, faceNormal.y, faceNormal.z ))
+      continue;
+    if ( !IsFaceExternal( iF ))
+      faceNormal = XYZ() - faceNormal; // reverse
+
+    XYZ face2p( p - XYZ( myFaceNodes[0] ));
+    if ( face2p.Dot( faceNormal ) > tol )
+      return true;
+  }
+  return false;
+}
+
 //=======================================================================
 //function : SetExternalNormal
 //purpose  : Node order will be so that faces normals are external
index b95bc8a620f48c5bf41568db9d440820de98f967..3b637c839586fab6ae4dfb148d574b424f363a1f 100644 (file)
@@ -93,6 +93,8 @@ class SMDS_EXPORT SMDS_VolumeTool
 
   bool GetBaryCenter (double & X, double & Y, double & Z) const;
 
+  bool IsOut(double X, double Y, double Z, double tol);
+  // Classify a point
 
   // -----------------------
   // info on node connection
index 59971bfee71a05f7816c47d42b260a42bc16c726..821d8fa9f7940c3208bcad592856a7a297e86abd 100644 (file)
@@ -996,7 +996,8 @@ int SMESH_Block::GetOrderedEdges (const TopoDS_Face&   theFace,
     for ( iE = 0; wExp.More(); wExp.Next(), iE++ )
     {
       TopoDS_Edge edge = wExp.Current();
-      edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
+      // commented for issue 0020557, other related ones: 0020526, PAL19080
+      // edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
       theEdges.push_back( edge );
     }
     theNbVertexInWires.push_back( iE );
index 4a998052cdaeedd4dcc8bef6a2ab89738fc36003..92f5b3f6b973a384447b5df5dc873a7a6dedfcdf 100644 (file)
@@ -53,9 +53,9 @@ using namespace std;
 
 SMESH_Gen::SMESH_Gen()
 {
-       MESSAGE("SMESH_Gen::SMESH_Gen");
-       _localId = 0;
-       _hypId = 0;
+        MESSAGE("SMESH_Gen::SMESH_Gen");
+        _localId = 0;
+        _hypId = 0;
         _segmentation = 10;
         SMDS_Mesh::_meshList.clear();
         MESSAGE(SMDS_Mesh::_meshList.size());
@@ -69,7 +69,7 @@ SMESH_Gen::SMESH_Gen()
 
 SMESH_Gen::~SMESH_Gen()
 {
-       MESSAGE("SMESH_Gen::~SMESH_Gen");
+        MESSAGE("SMESH_Gen::~SMESH_Gen");
 }
 
 //=============================================================================
@@ -79,26 +79,26 @@ SMESH_Gen::~SMESH_Gen()
 //=============================================================================
 
 /*SMESH_Hypothesis *SMESH_Gen::CreateHypothesis(const char *anHyp, int studyId)
-       throw(SALOME_Exception)
+        throw(SALOME_Exception)
 {
 
-       MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
-       // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
+        MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
+        // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
 
-       StudyContextStruct *myStudyContext = GetStudyContext(studyId);
+        StudyContextStruct *myStudyContext = GetStudyContext(studyId);
 
-       // create a new hypothesis object, store its ref. in studyContext
+        // create a new hypothesis object, store its ref. in studyContext
 
-       SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
-       int hypId = myHypothesis->GetID();
-       myStudyContext->mapHypothesis[hypId] = myHypothesis;
-       SCRUTE(studyId);
-       SCRUTE(hypId);
+        SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
+        int hypId = myHypothesis->GetID();
+        myStudyContext->mapHypothesis[hypId] = myHypothesis;
+        SCRUTE(studyId);
+        SCRUTE(hypId);
 
-       // store hypothesis in SMESHDS document
+        // store hypothesis in SMESHDS document
 
-       myStudyContext->myDocument->AddHypothesis(myHypothesis);
-       return myHypothesis;
+        myStudyContext->myDocument->AddHypothesis(myHypothesis);
+        return myHypothesis;
 }*/
 
 //=============================================================================
@@ -118,10 +118,10 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
 
   // create a new SMESH_mesh object
   SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
-                                    theStudyId,
-                                    this,
-                                    theIsEmbeddedMode,
-                                    aStudyContext->myDocument);
+                                     theStudyId,
+                                     this,
+                                     theIsEmbeddedMode,
+                                     aStudyContext->myDocument);
   aStudyContext->mapMesh[_localId] = aMesh;
 
   return aMesh;
@@ -136,8 +136,8 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
 bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
                         const TopoDS_Shape &  aShape,
                         const bool            anUpward,
-                       const ::MeshDimension aDim,
-                       TSetOfInt*            aShapesId)
+                        const ::MeshDimension aDim,
+                        TSetOfInt*            aShapesId)
 {
   MESSAGE("SMESH_Gen::Compute");
   MEMOSTAT;
@@ -172,7 +172,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
         // clear compute state to not show previous compute errors
         //  if preview invoked less dimension less than previous
         smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
-       continue;
+        continue;
       }
 
       if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
@@ -182,7 +182,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
       if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
         ret = false;
       else if ( aShapesId )
-       aShapesId->insert( smToCompute->GetId() );
+        aShapesId->insert( smToCompute->GetId() );
     }
     return ret;
   }
@@ -207,7 +207,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
       
       // check for preview dimension limitations
       if ( aShapesId && aShapeDim > (int)aDim )
-       continue;
+        continue;
 
       SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
       if ( algo && !algo->NeedDescretBoundary() )
@@ -215,11 +215,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
         if ( algo->SupportSubmeshes() )
           smWithAlgoSupportingSubmeshes.push_back( smToCompute );
         else
-       {
+        {
           smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-         if ( aShapesId )
-           aShapesId->insert( smToCompute->GetId() );
-       }
+          if ( aShapesId )
+            aShapesId->insert( smToCompute->GetId() );
+        }
       }
     }
     // ------------------------------------------------------------
@@ -246,14 +246,14 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
         SMESH_subMesh* smToCompute = smIt->next();
 
         const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
-       const int aShapeDim = GetShapeDim( aSubShape );
+        const int aShapeDim = GetShapeDim( aSubShape );
         //if ( aSubShape.ShapeType() == TopAbs_VERTEX ) continue;
-       if ( aShapeDim < 1 ) continue;
+        if ( aShapeDim < 1 ) continue;
 
-       // check for preview dimension limitations
-       if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
-         continue;
-       
+        // check for preview dimension limitations
+        if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
+          continue;
+        
         SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
         filter
           .And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
@@ -271,18 +271,20 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
     // apply the algos that do not require descretized boundaries
     // ----------------------------------------------------------
     for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
+    {
+      sm = *subIt;
       if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
       {
-       const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
-       // check for preview dimension limitations
-       if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
-         continue;
+        const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
+        // check for preview dimension limitations
+        if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
+          continue;
 
         sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-       if ( aShapesId )
-         aShapesId->insert( sm->GetId() );
+        if ( aShapesId )
+          aShapesId->insert( sm->GetId() );
       }
-
+    }
     // -----------------------------------------------
     // mesh the rest subshapes starting from vertices
     // -----------------------------------------------
@@ -304,8 +306,8 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
 bool SMESH_Gen::Evaluate(SMESH_Mesh &          aMesh,
                          const TopoDS_Shape &  aShape,
                          MapShapeNbElems&      aResMap,
-                        const bool            anUpward,
-                        TSetOfInt*            aShapesId)
+                         const bool            anUpward,
+                         TSetOfInt*            aShapesId)
 {
   MESSAGE("SMESH_Gen::Evaluate");
 
@@ -330,14 +332,14 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh &          aMesh,
       //if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
       //  continue;
       if ( !aMesh.HasShapeToMesh() ) {
-       if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
-           aShType == TopAbs_SHELL )
-         continue;
+        if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
+            aShType == TopAbs_SHELL )
+          continue;
       }
 
       smToCompute->Evaluate(aResMap);
       if( aShapesId )
-       aShapesId->insert( smToCompute->GetId() );
+        aShapesId->insert( smToCompute->GetId() );
     }
     return ret;
   }
@@ -359,12 +361,12 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh &          aMesh,
       if ( algo && !algo->NeedDescretBoundary() ) {
         if ( algo->SupportSubmeshes() ) {
           smWithAlgoSupportingSubmeshes.push_back( smToCompute );
-       }
+        }
         else {
           smToCompute->Evaluate(aResMap);
-         if ( aShapesId )
-           aShapesId->insert( smToCompute->GetId() );
-       }
+          if ( aShapesId )
+            aShapesId->insert( smToCompute->GetId() );
+        }
       }
     }
     // ------------------------------------------------------------
@@ -389,10 +391,10 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh &          aMesh,
         SMESH_subMesh* smToCompute = smIt->next();
 
         const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
-       const int aShapeDim = GetShapeDim( aSubShape );
-       if ( aShapeDim < 1 ) continue;
+        const int aShapeDim = GetShapeDim( aSubShape );
+        if ( aShapeDim < 1 ) continue;
 
-       //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
+        //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
 
         SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
         filter
@@ -410,10 +412,12 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh &          aMesh,
     // ----------------------------------------------------------
     // apply the algos that do not require descretized boundaries
     // ----------------------------------------------------------
-    for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt ) {
+    for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
+    {
+      sm = *subIt;
       sm->Evaluate(aResMap);
       if ( aShapesId )
-       aShapesId->insert( sm->GetId() );
+        aShapesId->insert( sm->GetId() );
     }
 
     // -----------------------------------------------
@@ -437,7 +441,7 @@ static bool checkConformIgnoredAlgos(SMESH_Mesh&               aMesh,
                                      const SMESH_Algo*         aGlobIgnoAlgo,
                                      const SMESH_Algo*         aLocIgnoAlgo,
                                      bool &                    checkConform,
-                                     map<int, SMESH_subMesh*>& aCheckedMap,
+                                     set<SMESH_subMesh*>&      aCheckedMap,
                                      list< SMESH_Gen::TAlgoStateError > & theErrors)
 {
   ASSERT( aSubMesh );
@@ -492,19 +496,15 @@ static bool checkConformIgnoredAlgos(SMESH_Mesh&               aMesh,
         }
 
         // sub-algos will be hidden by a local <algo>
-        const map<int, SMESH_subMesh*>& smMap = aSubMesh->DependsOn();
-        map<int, SMESH_subMesh*>::const_reverse_iterator revItSub;
+        SMESH_subMeshIteratorPtr revItSub =
+          aSubMesh->getDependsOnIterator( /*includeSelf=*/false, /*complexShapeFirst=*/true);
         bool checkConform2 = false;
-        for ( revItSub = smMap.rbegin(); revItSub != smMap.rend(); revItSub++)
+        while ( revItSub->more() )
         {
-          checkConformIgnoredAlgos (aMesh, (*revItSub).second, aGlobIgnoAlgo,
+          SMESH_subMesh* sm = revItSub->next();
+          checkConformIgnoredAlgos (aMesh, sm, aGlobIgnoAlgo,
                                     algo, checkConform2, aCheckedMap, theErrors);
-          int key = (*revItSub).first;
-         SMESH_subMesh* sm = (*revItSub).second;
-          if ( aCheckedMap.find( key ) == aCheckedMap.end() )
-          {
-            aCheckedMap[ key ] = sm;
-          }
+          aCheckedMap.insert( sm );
         }
       }
     }
@@ -525,7 +525,7 @@ static bool checkMissing(SMESH_Gen*                aGen,
                          const int                 aTopAlgoDim,
                          bool*                     globalChecked,
                          const bool                checkNoAlgo,
-                         map<int, SMESH_subMesh*>& aCheckedMap,
+                         set<SMESH_subMesh*>&      aCheckedMap,
                          list< SMESH_Gen::TAlgoStateError > & theErrors)
 {
   if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
@@ -598,15 +598,13 @@ static bool checkMissing(SMESH_Gen*                aGen,
   if (!algo->NeedDescretBoundary() || isTopLocalAlgo)
   {
     bool checkNoAlgo2 = ( algo->NeedDescretBoundary() );
-    const map<int, SMESH_subMesh*>& subMeshes = aSubMesh->DependsOn();
-    map<int, SMESH_subMesh*>::const_iterator itsub;
-    for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
+    SMESH_subMeshIteratorPtr itsub = aSubMesh->getDependsOnIterator( /*includeSelf=*/false,
+                                                                     /*complexShapeFirst=*/false);
+    while ( itsub->more() )
     {
       // sub-meshes should not be checked further more
-      int key = (*itsub).first;
-      SMESH_subMesh* sm = (*itsub).second;
-      if ( aCheckedMap.find( key ) == aCheckedMap.end() )
-        aCheckedMap[ key ] = sm;
+      SMESH_subMesh* sm = itsub->next();
+      aCheckedMap.insert( sm );
 
       if (isTopLocalAlgo)
       {
@@ -700,39 +698,25 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh&               theMesh,
     }
   }
 
-  const map<int, SMESH_subMesh*>& smMap = sm->DependsOn();
-  map<int, SMESH_subMesh*>::const_reverse_iterator revItSub = smMap.rbegin();
-  map<int, SMESH_subMesh*> aCheckedMap;
+  set<SMESH_subMesh*> aCheckedSubs;
   bool checkConform = ( !theMesh.IsNotConformAllowed() );
-  int aKey = 1;
-  SMESH_subMesh* smToCheck = sm;
 
   // loop on theShape and its sub-shapes
-  while ( smToCheck )
+  SMESH_subMeshIteratorPtr revItSub = sm->getDependsOnIterator( /*includeSelf=*/true,
+                                                                /*complexShapeFirst=*/true);
+  while ( revItSub->more() )
   {
+    SMESH_subMesh* smToCheck = revItSub->next();
     if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
       break;
 
-    if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
+    if ( aCheckedSubs.insert( smToCheck ).second ) // not yet checked
       if (!checkConformIgnoredAlgos (theMesh, smToCheck, aGlobIgnoAlgo,
-                                     0, checkConform, aCheckedMap, theErrors))
+                                     0, checkConform, aCheckedSubs, theErrors))
         ret = false;
 
     if ( smToCheck->GetAlgoState() != SMESH_subMesh::NO_ALGO )
       hasAlgo = true;
-
-    // next subMesh
-    if (revItSub != smMap.rend())
-    {
-      aKey = (*revItSub).first;
-      smToCheck = (*revItSub).second;
-      revItSub++;
-    }
-    else
-    {
-      smToCheck = 0;
-    }
-
   }
 
   // ----------------------------------------------------------------
@@ -752,36 +736,26 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh&               theMesh,
       break;
     }
   }
-  aCheckedMap.clear();
-  smToCheck = sm;
-  revItSub = smMap.rbegin();
   bool checkNoAlgo = theMesh.HasShapeToMesh() ? bool( aTopAlgoDim ) : false;
   bool globalChecked[] = { false, false, false, false };
 
   // loop on theShape and its sub-shapes
-  while ( smToCheck )
+  aCheckedSubs.clear();
+  revItSub = sm->getDependsOnIterator( /*includeSelf=*/true, /*complexShapeFirst=*/true);
+  while ( revItSub->more() )
   {
+    SMESH_subMesh* smToCheck = revItSub->next();
     if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
       break;
 
-    if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
+    if ( aCheckedSubs.insert( smToCheck ).second ) // not yet checked
       if (!checkMissing (this, theMesh, smToCheck, aTopAlgoDim,
-                         globalChecked, checkNoAlgo, aCheckedMap, theErrors))
+                         globalChecked, checkNoAlgo, aCheckedSubs, theErrors))
       {
         ret = false;
         if (smToCheck->GetAlgoState() == SMESH_subMesh::NO_ALGO )
           checkNoAlgo = false;
       }
-
-    // next subMesh
-    if (revItSub != smMap.rend())
-    {
-      aKey = (*revItSub).first;
-      smToCheck = (*revItSub).second;
-      revItSub++;
-    }
-    else
-      smToCheck = 0;
   }
 
   if ( !hasAlgo ) {
@@ -830,16 +804,16 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh &         aMesh,
 
 StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
 {
-       // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
-
-       if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
-       {
-               _mapStudyContext[studyId] = new StudyContextStruct;
-               _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
-       }
-       StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
+        // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
+
+        if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
+        {
+                _mapStudyContext[studyId] = new StudyContextStruct;
+                _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
+        }
+        StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
 //   ASSERT(_mapStudyContext.find(studyId) != _mapStudyContext.end());
-       return myStudyContext;
+        return myStudyContext;
 }
 
 // //=============================================================================
@@ -904,6 +878,6 @@ int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
 
 int SMESH_Gen::GetANewId()
 {
-       //MESSAGE("SMESH_Gen::GetANewId");
-       return _hypId++;
+        //MESSAGE("SMESH_Gen::GetANewId");
+        return _hypId++;
 }
index 57a5af6ebd748363a730cc3534789683b874565f..ab610a00a7b8e7f3c4305cc5055011d8bcd3b63d 100644 (file)
@@ -61,7 +61,7 @@ typedef std::set<int> TSetOfInt;
 
 class SMESH_EXPORT  SMESH_Gen
 {
- public:
+public:
   SMESH_Gen();
   ~SMESH_Gen();
 
@@ -78,8 +78,8 @@ class SMESH_EXPORT  SMESH_Gen
   bool Compute(::SMESH_Mesh &        aMesh,
                const TopoDS_Shape &  aShape,
                const bool            anUpward=false,
-              const ::MeshDimension aDim=::MeshDim_3D,
-              TSetOfInt*            aShapesId=0);
+               const ::MeshDimension aDim=::MeshDim_3D,
+               TSetOfInt*            aShapesId=0);
 
   /*!
    * \brief evaluates size of prospective mesh on a shape 
@@ -89,8 +89,8 @@ class SMESH_EXPORT  SMESH_Gen
    * \retval bool - is a success
    */
   bool Evaluate(::SMESH_Mesh &        aMesh,
-               const TopoDS_Shape &  aShape,
-               MapShapeNbElems&      aResMap,
+                const TopoDS_Shape &  aShape,
+                MapShapeNbElems&      aResMap,
                 const bool            anUpward=false,
                 TSetOfInt*            aShapesId=0);
 
@@ -109,7 +109,7 @@ class SMESH_EXPORT  SMESH_Gen
    */
   void SetDefaultNbSegments(int nb) { _nbSegments = nb; }
   int GetDefaultNbSegments() const { return _nbSegments; }
-  
+
   struct TAlgoStateError
   {
     TAlgoStateErrorName _name;
@@ -138,16 +138,6 @@ class SMESH_EXPORT  SMESH_Gen
   SMESH_Algo* GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, TopoDS_Shape* assignedTo=0);
   static bool IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& aMesh);
 
-  // inherited methods from SALOMEDS::Driver
-
-//   void Save(int studyId, const char *aUrlOfFile);
-//   void Load(int studyId, const char *aUrlOfFile);
-//   void Close(int studyId);
-//   const char *ComponentDataType();
-
-//   const char *IORToLocalPersistentID(const char *IORString, bool & IsAFile);
-//   const char *LocalPersistentIDToIOR(const char *aLocalPersistentID);
-
   int GetANewId();
 
   std::map < int, SMESH_Algo * >_mapAlgo;
@@ -156,9 +146,9 @@ class SMESH_EXPORT  SMESH_Gen
   std::map < int, SMESH_2D_Algo * >_map2D_Algo;
   std::map < int, SMESH_3D_Algo * >_map3D_Algo;
 
- private:
+private:
 
-  int _localId;                                // unique Id of created objects, within SMESH_Gen entity
+  int _localId;                     // unique Id of created objects, within SMESH_Gen entity
   std::map < int, StudyContextStruct * >_mapStudyContext;
 
   // hypotheses managing
index 4b288a0d90311b7285255ff45bb3537ee7fd1c29..0fec4925c0665a1db95021b58466cf4e6ae43c96 100644 (file)
@@ -39,8 +39,8 @@ using namespace std;
 //=============================================================================
 
 SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
-                                  int studyId,
-                                  SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
+                                   int studyId,
+                                   SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
 {
   //MESSAGE("SMESH_Hypothesis::SMESH_Hypothesis");
   _gen = gen;
index 1281522d98a55cb91523e4e0fb1e04a4891a0a06..67d78b4e683574b0f6bd43cf9db7e93cb6981126 100644 (file)
@@ -81,10 +81,10 @@ typedef SMESH_HypoFilter THypType;
 //=============================================================================
 
 SMESH_Mesh::SMESH_Mesh(int               theLocalId, 
-                      int               theStudyId, 
-                      SMESH_Gen*        theGen,
-                      bool              theIsEmbeddedMode,
-                      SMESHDS_Document* theDocument):
+                       int               theStudyId, 
+                       SMESH_Gen*        theGen,
+                       bool              theIsEmbeddedMode,
+                       SMESHDS_Document* theDocument):
   _groupId( 0 ), _nbSubShapes( 0 )
 {
   MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
@@ -325,14 +325,14 @@ void SMESH_Mesh::ClearSubMesh(const int theShapeId)
   if ( SMESH_subMesh *sm = GetSubMeshContaining( theShapeId ) )
   {
     SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
-                                                            /*complexShapeFirst=*/false);
+                                                             /*complexShapeFirst=*/false);
     while ( smIt->more() )
     {
       sm = smIt->next();
       TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();      
       if ( shapeType == TopAbs_VERTEX || shapeType < TopAbs_SOLID )
-       // all other shapes depends on vertices so they are already cleaned
-       sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
+        // all other shapes depends on vertices so they are already cleaned
+        sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
       // to recompute even if failed
       sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
     }
@@ -373,21 +373,21 @@ int SMESH_Mesh::UNVToMesh(const char* theFileName)
 
       SMESH_Group* aSMESHGroup = AddGroup( aSubGroup->GetType(), aName.c_str(), aId );
       if ( aSMESHGroup ) {
-       if(MYDEBUG) MESSAGE("UNVToMesh - group added: "<<aName);      
-       SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( aSMESHGroup->GetGroupDS() );
-       if ( aGroupDS ) {
-         aGroupDS->SetStoreName(aName.c_str());
-         aSubGroup->InitIterator();
-         const SMDS_MeshElement* aElement = 0;
-         while (aSubGroup->More()) {
-           aElement = aSubGroup->Next();
-           if (aElement) {
-             aGroupDS->SMDSGroup().Add(aElement);
-           }
-         }
-         if (aElement)
-           aGroupDS->SetType(aElement->GetType());
-       }
+        if(MYDEBUG) MESSAGE("UNVToMesh - group added: "<<aName);      
+        SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( aSMESHGroup->GetGroupDS() );
+        if ( aGroupDS ) {
+          aGroupDS->SetStoreName(aName.c_str());
+          aSubGroup->InitIterator();
+          const SMDS_MeshElement* aElement = 0;
+          while (aSubGroup->More()) {
+            aElement = aSubGroup->Next();
+            if (aElement) {
+              aGroupDS->SMDSGroup().Add(aElement);
+            }
+          }
+          if (aElement)
+            aGroupDS->SetType(aElement->GetType());
+        }
       }
     }
   }
@@ -1086,9 +1086,9 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
 }
 
 void SMESH_Mesh::ExportMED(const char *file, 
-                          const char* theMeshName, 
-                          bool theAutoGroups,
-                          int theVersion) 
+                           const char* theMeshName, 
+                           bool theAutoGroups,
+                           int theVersion) 
   throw(SALOME_Exception)
 {
   Unexpect aCatch(SalomeException);
@@ -1376,7 +1376,7 @@ bool SMESH_Mesh::IsMainShape(const TopoDS_Shape& theShape) const
 
 SMESH_Group* SMESH_Mesh::AddGroup (const SMDSAbs_ElementType theType,
                                    const char*               theName,
-                                  int&                      theId,
+                                   int&                      theId,
                                    const TopoDS_Shape&       theShape)
 {
   if (_mapGroup.find(_groupId) != _mapGroup.end())
index 284bf89a7f41b9443577225fa835fdbcb1502a83..26339eb0957ef7b9a995822425ea49bd467462b1 100644 (file)
@@ -55,10 +55,10 @@ class SMESH_EXPORT SMESH_Mesh
 {
 public:
   SMESH_Mesh(int               theLocalId, 
-            int               theStudyId, 
-            SMESH_Gen*        theGen,
-            bool              theIsEmbeddedMode,
-            SMESHDS_Document* theDocument);
+             int               theStudyId, 
+             SMESH_Gen*        theGen,
+             bool              theIsEmbeddedMode,
+             SMESHDS_Document* theDocument);
   
   virtual ~SMESH_Mesh();
   
@@ -162,7 +162,7 @@ public:
    * \brief Return True if anHyp is used to mesh aSubShape
    */
   bool IsUsedHypothesis(SMESHDS_Hypothesis *  anHyp,
-                       const SMESH_subMesh * aSubMesh);
+                        const SMESH_subMesh * aSubMesh);
   /*!
    * \brief check if a hypothesis alowing notconform mesh is present
    */
@@ -191,9 +191,9 @@ public:
   bool HasDuplicatedGroupNamesMED();
 
   void ExportMED(const char *file, 
-                const char* theMeshName = NULL, 
-                bool theAutoGroups = true, 
-                int theVersion = 0) 
+                 const char* theMeshName = NULL, 
+                 bool theAutoGroups = true, 
+                 int theVersion = 0) 
     throw(SALOME_Exception);
 
   void ExportDAT(const char *file) throw(SALOME_Exception);
@@ -231,8 +231,8 @@ public:
   int NbGroup() const { return _mapGroup.size(); }
   
   SMESH_Group* AddGroup (const SMDSAbs_ElementType theType,
-                        const char*               theName,
-                        int&                      theId,
+                         const char*               theName,
+                         int&                      theId,
                          const TopoDS_Shape&       theShape=TopoDS_Shape());
   
   typedef boost::shared_ptr< SMDS_Iterator<SMESH_Group*> > GroupIteratorPtr;
index d347a715772ede510fd4b89723c90ab1c3e3ab7b..32dcba79617af5fe50d493ec38cb1ac2a5ea7c56 100644 (file)
@@ -78,6 +78,8 @@
 
 #include <map>
 #include <set>
+#include <numeric>
+#include <limits>
 
 #define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
 
@@ -90,8 +92,23 @@ typedef map<const SMDS_MeshElement*, list<const SMDS_MeshElement*> > TElemOfElem
 //typedef TNodeOfNodeVecMap::iterator                                  TNodeOfNodeVecMapItr;
 //typedef map<const SMDS_MeshElement*, vector<TNodeOfNodeVecMapItr> >  TElemOfVecOfMapNodesMap;
 
-struct TNodeXYZ : public gp_XYZ {
+//=======================================================================
+/*!
+ * \brief SMDS_MeshNode -> gp_XYZ convertor
+ */
+//=======================================================================
+
+struct TNodeXYZ : public gp_XYZ
+{
   TNodeXYZ( const SMDS_MeshNode* n ):gp_XYZ( n->X(), n->Y(), n->Z() ) {}
+  double Distance( const SMDS_MeshNode* n )
+  {
+    return gp_Vec( *this, TNodeXYZ( n )).Magnitude();
+  }
+  double SquareDistance( const SMDS_MeshNode* n )
+  {
+    return gp_Vec( *this, TNodeXYZ( n )).SquareMagnitude();
+  }
 };
 
 //=======================================================================
@@ -2788,12 +2805,12 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*               elem,
       return;
     }
 
-    issimple[iNode] = (listNewNodes.size()==nbSteps);
+    issimple[iNode] = (listNewNodes.size()==nbSteps); // is node medium
 
     itNN[ iNode ] = listNewNodes.begin();
     prevNod[ iNode ] = node;
     nextNod[ iNode ] = listNewNodes.front();
-    if( !issimple[iNode] ) {
+    if( !elem->IsQuadratic() || !issimple[iNode] ) {
       if ( prevNod[ iNode ] != nextNod [ iNode ])
         iNotSameNode = iNode;
       else {
@@ -2806,8 +2823,8 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*               elem,
 
   //cout<<"  nbSame = "<<nbSame<<endl;
   if ( nbSame == nbNodes || nbSame > 2) {
-    //MESSAGE( " Too many same nodes of element " << elem->GetID() );
-    INFOS( " Too many same nodes of element " << elem->GetID() );
+    MESSAGE( " Too many same nodes of element " << elem->GetID() );
+    //INFOS( " Too many same nodes of element " << elem->GetID() );
     return;
   }
 
@@ -5066,12 +5083,13 @@ SMESH_MeshEditor::generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
   return newGroupIDs;
 }
 
-//=======================================================================
-//function : FindCoincidentNodes
-//purpose  : Return list of group of nodes close to each other within theTolerance
-//           Search among theNodes or in the whole mesh if theNodes is empty using
-//           an Octree algorithm
-//=======================================================================
+//================================================================================
+/*!
+ * \brief Return list of group of nodes close to each other within theTolerance
+ *        Search among theNodes or in the whole mesh if theNodes is empty using
+ *        an Octree algorithm
+ */
+//================================================================================
 
 void SMESH_MeshEditor::FindCoincidentNodes (set<const SMDS_MeshNode*> & theNodes,
                                             const double                theTolerance,
@@ -5089,10 +5107,11 @@ void SMESH_MeshEditor::FindCoincidentNodes (set<const SMDS_MeshNode*> & theNodes
   }
   else
     nodes=theNodes;
-  SMESH_OctreeNode::FindCoincidentNodes ( nodes, &theGroupsOfNodes, theTolerance);
 
+  SMESH_OctreeNode::FindCoincidentNodes ( nodes, &theGroupsOfNodes, theTolerance);
 }
 
+
 //=======================================================================
 /*!
  * \brief Implementation of search for the node closest to point
@@ -5101,11 +5120,14 @@ void SMESH_MeshEditor::FindCoincidentNodes (set<const SMDS_MeshNode*> & theNodes
 
 struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher
 {
+  //---------------------------------------------------------------------
   /*!
    * \brief Constructor
    */
   SMESH_NodeSearcherImpl( const SMESHDS_Mesh* theMesh )
   {
+    myMesh = ( SMESHDS_Mesh* ) theMesh;
+
     set<const SMDS_MeshNode*> nodes;
     if ( theMesh ) {
       SMDS_NodeIteratorPtr nIt = theMesh->nodesIterator();
@@ -5113,19 +5135,43 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher
         nodes.insert( nodes.end(), nIt->next() );
     }
     myOctreeNode = new SMESH_OctreeNode(nodes) ;
+
+    // get max size of a leaf box
+    SMESH_OctreeNode* tree = myOctreeNode;
+    while ( !tree->isLeaf() )
+    {
+      SMESH_OctreeNodeIteratorPtr cIt = tree->GetChildrenIterator();
+      if ( cIt->more() )
+        tree = cIt->next();
+    }
+    myHalfLeafSize = tree->maxSize() / 2.;
   }
+
+  //---------------------------------------------------------------------
+  /*!
+   * \brief Move node and update myOctreeNode accordingly
+   */
+  void MoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt )
+  {
+    myOctreeNode->UpdateByMoveNode( node, toPnt );
+    myMesh->MoveNode( node, toPnt.X(), toPnt.Y(), toPnt.Z() );
+  }
+
+  //---------------------------------------------------------------------
   /*!
    * \brief Do it's job
    */
   const SMDS_MeshNode* FindClosestTo( const gp_Pnt& thePnt )
   {
     SMDS_MeshNode tgtNode( thePnt.X(), thePnt.Y(), thePnt.Z() );
+    map<double, const SMDS_MeshNode*> dist2Nodes;
+    myOctreeNode->NodesAround( &tgtNode, dist2Nodes, myHalfLeafSize );
+    if ( !dist2Nodes.empty() )
+      return dist2Nodes.begin()->second;
     list<const SMDS_MeshNode*> nodes;
-    //const double precision = 1e-6;
-    //myOctreeNode->NodesAround( &tgtNode, &nodes, precision );
+    //myOctreeNode->NodesAround( &tgtNode, &nodes, myHalfLeafSize );
 
     double minSqDist = DBL_MAX;
-    Bnd_B3d box;
     if ( nodes.empty() )  // get all nodes of OctreeNode's closest to thePnt
     {
       // sort leafs by their distance from thePnt
@@ -5134,20 +5180,25 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher
       list< SMESH_OctreeNode* > treeList;
       list< SMESH_OctreeNode* >::iterator trIt;
       treeList.push_back( myOctreeNode );
+
+      SMDS_MeshNode pointNode( thePnt.X(), thePnt.Y(), thePnt.Z() );
       for ( trIt = treeList.begin(); trIt != treeList.end(); ++trIt)
       {
         SMESH_OctreeNode* tree = *trIt;
-        if ( !tree->isLeaf() ) { // put children to the queue
+        if ( !tree->isLeaf() ) // put children to the queue
+        {
+          if ( !tree->isInside( &pointNode, myHalfLeafSize )) continue;
           SMESH_OctreeNodeIteratorPtr cIt = tree->GetChildrenIterator();
           while ( cIt->more() )
             treeList.push_back( cIt->next() );
         }
-        else if ( tree->NbNodes() ) { // put tree to treeMap
-          tree->getBox( box );
+        else if ( tree->NbNodes() ) // put a tree to the treeMap
+        {
+          const Bnd_B3d& box = tree->getBox();
           double sqDist = thePnt.SquareDistance( 0.5 * ( box.CornerMin() + box.CornerMax() ));
           pair<TDistTreeMap::iterator,bool> it_in = treeMap.insert( make_pair( sqDist, tree ));
           if ( !it_in.second ) // not unique distance to box center
-            treeMap.insert( it_in.first, make_pair( sqDist - 1e-13*treeMap.size(), tree ));
+            treeMap.insert( it_in.first, make_pair( sqDist + 1e-13*treeMap.size(), tree ));
         }
       }
       // find distance after which there is no sense to check tree's
@@ -5155,7 +5206,7 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher
       TDistTreeMap::iterator sqDist_tree = treeMap.begin();
       if ( treeMap.size() > 5 ) {
         SMESH_OctreeNode* closestTree = sqDist_tree->second;
-        closestTree->getBox( box );
+        const Bnd_B3d& box = closestTree->getBox();
         double limit = sqrt( sqDist_tree->first ) + sqrt ( box.SquareExtent() );
         sqLimit = limit * limit;
       }
@@ -5180,12 +5231,23 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher
     }
     return closestNode;
   }
+
+  //---------------------------------------------------------------------
   /*!
    * \brief Destructor
    */
   ~SMESH_NodeSearcherImpl() { delete myOctreeNode; }
+
+  //---------------------------------------------------------------------
+  /*!
+   * \brief Return the node tree
+   */
+  const SMESH_OctreeNode* getTree() const { return myOctreeNode; }
+
 private:
   SMESH_OctreeNode* myOctreeNode;
+  SMESHDS_Mesh*     myMesh;
+  double            myHalfLeafSize; // max size of a leaf box
 };
 
 //=======================================================================
@@ -5199,6 +5261,404 @@ SMESH_NodeSearcher* SMESH_MeshEditor::GetNodeSearcher()
   return new SMESH_NodeSearcherImpl( GetMeshDS() );
 }
 
+// ========================================================================
+namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
+{
+  const int MaxNbElemsInLeaf = 10; // maximal number of elements in a leaf of tree
+  const int MaxLevel         = 7;  // maximal tree height -> nb terminal boxes: 8^7 = 2097152
+  const double NodeRadius = 1e-9;  // to enlarge bnd box of element
+
+  //=======================================================================
+  /*!
+   * \brief Octal tree of bounding boxes of elements
+   */
+  //=======================================================================
+
+  class ElementBndBoxTree : public SMESH_Octree
+  {
+  public:
+
+    ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType);
+    void getElementsNearPoint( const gp_Pnt& point, TIDSortedElemSet& foundElems);
+    ~ElementBndBoxTree();
+
+  protected:
+    ElementBndBoxTree() {}
+    SMESH_Octree* allocateOctreeChild() const { return new ElementBndBoxTree; }
+    void buildChildrenData();
+    Bnd_B3d* buildRootBox();
+  private:
+    //!< Bounding box of element
+    struct ElementBox : public Bnd_B3d
+    {
+      const SMDS_MeshElement* _element;
+      int                     _refCount; // an ElementBox can be included in several tree branches
+      ElementBox(const SMDS_MeshElement* elem);
+    };
+    vector< ElementBox* > _elements;
+  };
+
+  //================================================================================
+  /*!
+   * \brief ElementBndBoxTree creation
+   */
+  //================================================================================
+
+  ElementBndBoxTree::ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType)
+    :SMESH_Octree( new SMESH_Octree::Limit( MaxLevel, /*minSize=*/0. ))
+  {
+    int nbElems = mesh.GetMeshInfo().NbElements( elemType );
+    _elements.reserve( nbElems );
+
+    SMDS_ElemIteratorPtr elemIt = mesh.elementsIterator( elemType );
+    while ( elemIt->more() )
+      _elements.push_back( new ElementBox( elemIt->next() ));
+
+    if ( _elements.size() > MaxNbElemsInLeaf )
+      compute();
+    else
+      myIsLeaf = true;
+  }
+
+  //================================================================================
+  /*!
+   * \brief Destructor
+   */
+  //================================================================================
+
+  ElementBndBoxTree::~ElementBndBoxTree()
+  {
+    for ( int i = 0; i < _elements.size(); ++i )
+      if ( --_elements[i]->_refCount <= 0 )
+        delete _elements[i];
+  }
+
+  //================================================================================
+  /*!
+   * \brief Return the maximal box
+   */
+  //================================================================================
+
+  Bnd_B3d* ElementBndBoxTree::buildRootBox()
+  {
+    Bnd_B3d* box = new Bnd_B3d;
+    for ( int i = 0; i < _elements.size(); ++i )
+      box->Add( *_elements[i] );
+    return box;
+  }
+
+  //================================================================================
+  /*!
+   * \brief Redistrubute element boxes among children
+   */
+  //================================================================================
+
+  void ElementBndBoxTree::buildChildrenData()
+  {
+    for ( int i = 0; i < _elements.size(); ++i )
+    {
+      for (int j = 0; j < 8; j++)
+      {
+        if ( !_elements[i]->IsOut( myChildren[j]->getBox() ))
+        {
+          _elements[i]->_refCount++;
+          ((ElementBndBoxTree*)myChildren[j])->_elements.push_back( _elements[i]);
+        }
+      }
+      _elements[i]->_refCount--;
+    }
+    _elements.clear();
+
+    for (int j = 0; j < 8; j++)
+    {
+      ElementBndBoxTree* child = static_cast<ElementBndBoxTree*>( myChildren[j]);
+      if ( child->_elements.size() <= MaxNbElemsInLeaf )
+        child->myIsLeaf = true;
+
+      if ( child->_elements.capacity() - child->_elements.size() > 1000 )
+        child->_elements.resize( child->_elements.size() ); // compact
+    }
+  }
+
+  //================================================================================
+  /*!
+   * \brief Return elements which can include the point
+   */
+  //================================================================================
+
+  void ElementBndBoxTree::getElementsNearPoint( const gp_Pnt&     point,
+                                                TIDSortedElemSet& foundElems)
+  {
+    if ( level() && getBox().IsOut( point.XYZ() ))
+      return;
+
+    if ( isLeaf() )
+    {
+      for ( int i = 0; i < _elements.size(); ++i )
+        if ( !_elements[i]->IsOut( point.XYZ() ))
+          foundElems.insert( _elements[i]->_element );
+    }
+    else
+    {
+      for (int i = 0; i < 8; i++)
+        ((ElementBndBoxTree*) myChildren[i])->getElementsNearPoint( point, foundElems );
+    }
+  }
+
+  //================================================================================
+  /*!
+   * \brief Construct the element box
+   */
+  //================================================================================
+
+  ElementBndBoxTree::ElementBox::ElementBox(const SMDS_MeshElement* elem)
+  {
+    _element  = elem;
+    _refCount = 1;
+    SMDS_ElemIteratorPtr nIt = elem->nodesIterator();
+    while ( nIt->more() )
+      Add( TNodeXYZ( cast2Node( nIt->next() )));
+    Enlarge( NodeRadius );
+  }
+
+} // namespace
+
+//=======================================================================
+/*!
+ * \brief Implementation of search for the elements by point
+ */
+//=======================================================================
+
+struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
+{
+  SMESHDS_Mesh*           _mesh;
+  ElementBndBoxTree*      _ebbTree;
+  SMESH_NodeSearcherImpl* _nodeSearcher;
+  SMDSAbs_ElementType     _elementType;
+
+  SMESH_ElementSearcherImpl( SMESHDS_Mesh& mesh ): _mesh(&mesh),_ebbTree(0),_nodeSearcher(0) {}
+  ~SMESH_ElementSearcherImpl()
+  {
+    if ( _ebbTree )      delete _ebbTree;      _ebbTree      = 0;
+    if ( _nodeSearcher ) delete _nodeSearcher; _nodeSearcher = 0;
+  }
+
+  /*!
+   * \brief Return elements of given type where the given point is IN or ON.
+   *
+   * 'ALL' type means elements of any type excluding nodes and 0D elements
+   */
+  void FindElementsByPoint(const gp_Pnt&                      point,
+                           SMDSAbs_ElementType                type,
+                           vector< const SMDS_MeshElement* >& foundElements)
+  {
+    foundElements.clear();
+
+    const SMDS_MeshInfo& meshInfo = _mesh->GetMeshInfo();
+
+    // -----------------
+    // define tolerance
+    // -----------------
+    double tolerance = 0;
+    if ( _nodeSearcher && meshInfo.NbNodes() > 1 )
+    {
+      double boxSize = _nodeSearcher->getTree()->maxSize();
+      tolerance = 1e-8 * boxSize/* / meshInfo.NbNodes()*/;
+    }
+    else if ( _ebbTree && meshInfo.NbElements() > 0 )
+    {
+      double boxSize = _ebbTree->maxSize();
+      tolerance = 1e-8 * boxSize/* / meshInfo.NbElements()*/;
+    }
+    if ( tolerance == 0 )
+    {
+      // define tolerance by size of a most complex element
+      int complexType = SMDSAbs_Volume;
+      while ( complexType > SMDSAbs_All &&
+              meshInfo.NbElements( SMDSAbs_ElementType( complexType )) < 1 )
+        --complexType;
+      if ( complexType == SMDSAbs_All ) return; // empty mesh
+
+      double elemSize;
+      if ( complexType == int( SMDSAbs_Node ))
+      {
+        SMDS_NodeIteratorPtr nodeIt = _mesh->nodesIterator();
+        elemSize = 1;
+        if ( meshInfo.NbNodes() > 2 )
+          elemSize = TNodeXYZ( nodeIt->next() ).Distance( nodeIt->next() );
+      }
+      else
+      {
+        const SMDS_MeshElement* elem =
+          _mesh->elementsIterator( SMDSAbs_ElementType( complexType ))->next();
+        SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
+        TNodeXYZ n1( cast2Node( nodeIt->next() ));
+        while ( nodeIt->more() )
+        {
+          double dist = n1.Distance( cast2Node( nodeIt->next() ));
+          elemSize = max( dist, elemSize );
+        }
+      }
+      tolerance = 1e-6 * elemSize;
+    }
+
+    // =================================================================================
+    if ( type == SMDSAbs_Node || type == SMDSAbs_0DElement )
+    {
+      if ( !_nodeSearcher )
+        _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh );
+
+      const SMDS_MeshNode* closeNode = _nodeSearcher->FindClosestTo( point );
+      if ( !closeNode ) return;
+
+      if ( point.Distance( TNodeXYZ( closeNode )) > tolerance )
+        return; // to far from any node
+
+      if ( type == SMDSAbs_Node )
+      {
+        foundElements.push_back( closeNode );
+      }
+      else
+      {
+        SMDS_ElemIteratorPtr elemIt = closeNode->GetInverseElementIterator( SMDSAbs_0DElement );
+        while ( elemIt->more() )
+          foundElements.push_back( elemIt->next() );
+      }
+    }
+    // =================================================================================
+    else // elements more complex than 0D
+    {
+      if ( !_ebbTree || _elementType != type )
+      {
+        if ( _ebbTree ) delete _ebbTree;
+        _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type );
+      }
+      TIDSortedElemSet suspectElems;
+      _ebbTree->getElementsNearPoint( point, suspectElems );
+      TIDSortedElemSet::iterator elem = suspectElems.begin();
+      for ( ; elem != suspectElems.end(); ++elem )
+        if ( !SMESH_MeshEditor::isOut( *elem, point, tolerance ))
+          foundElements.push_back( *elem );
+    }
+  }
+}; // struct SMESH_ElementSearcherImpl
+
+//=======================================================================
+/*!
+ * \brief Return SMESH_ElementSearcher
+ */
+//=======================================================================
+
+SMESH_ElementSearcher* SMESH_MeshEditor::GetElementSearcher()
+{
+  return new SMESH_ElementSearcherImpl( *GetMeshDS() );
+}
+
+//=======================================================================
+/*!
+ * \brief Return true if the point is IN or ON of the element
+ */
+//=======================================================================
+
+bool SMESH_MeshEditor::isOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol )
+{
+  if ( element->GetType() == SMDSAbs_Volume)
+  {
+    return SMDS_VolumeTool( element ).IsOut( point.X(), point.Y(), point.Z(), tol );
+  }
+
+  // get ordered nodes
+
+  vector< gp_XYZ > xyz;
+
+  SMDS_ElemIteratorPtr nodeIt = element->nodesIterator();
+  if ( element->IsQuadratic() )
+    if (const SMDS_QuadraticFaceOfNodes* f=dynamic_cast<const SMDS_QuadraticFaceOfNodes*>(element))
+      nodeIt = f->interlacedNodesElemIterator();
+    else if (const SMDS_QuadraticEdge*  e =dynamic_cast<const SMDS_QuadraticEdge*>(element))
+      nodeIt = e->interlacedNodesElemIterator();
+
+  while ( nodeIt->more() )
+    xyz.push_back( TNodeXYZ( cast2Node( nodeIt->next() )));
+
+  if ( element->GetType() == SMDSAbs_Face ) // --------------------------------------------------
+  {
+    // gravity center
+    gp_XYZ gc(0,0,0);
+    gc = accumulate( xyz.begin(), xyz.end(), gc );
+    gc /= element->NbNodes();
+
+    // compute face normal using gc
+    gp_Vec normal(0,0,0);
+    xyz.push_back( xyz.front() );
+    for ( int i = 0; i < element->NbNodes(); ++i )
+    {
+      gp_Vec edge( xyz[i], xyz[i+1]);
+      gp_Vec n2gc( xyz[i], gc );
+      normal += edge ^ n2gc;
+    }
+    double faceDoubleArea = normal.Magnitude();
+    if ( faceDoubleArea <= numeric_limits<double>::min() )
+      return true; // invalid face
+    normal /= faceDoubleArea;
+
+    // check if the point lays on face plane
+    gp_Vec n2p( xyz[0], point );
+    if ( fabs( n2p * normal ) > tol )
+      return true; // not on face plane
+
+    // check if point is out of face boundary
+    int i, out = false;
+    for ( i = 0; !out && i < element->NbNodes(); ++i )
+    {
+      gp_Vec edge( xyz[i], xyz[i+1]);
+      gp_Vec n2p ( xyz[i], point );
+      gp_Vec cross = edge ^ n2p;
+      out = ( cross * normal < -tol );
+    }
+    if ( out && element->IsPoly() )
+    {
+      // define point position by the closest edge
+      double minDist = numeric_limits<double>::max();
+      int iMinDist;
+      for ( i = 0; i < element->NbNodes(); ++i )
+      {
+        gp_Vec edge( xyz[i], xyz[i+1]);
+        gp_Vec n1p ( xyz[i], point);
+        double dist = ( edge ^ n1p ).Magnitude() / edge.Magnitude();
+        if ( dist < minDist )
+          iMinDist = i;
+      }
+      gp_Vec edge( xyz[iMinDist], xyz[iMinDist+1]);
+      gp_Vec n2p ( xyz[iMinDist], point );
+      gp_Vec cross = edge ^ n2p;
+      out = ( cross * normal < -tol );
+    }
+    return out;
+  }
+  if ( element->GetType() == SMDSAbs_Edge ) // --------------------------------------------------
+  {
+    for ( int i = 1; i < element->NbNodes(); ++i )
+    {
+      gp_Vec edge( xyz[i-1], xyz[i]);
+      gp_Vec n1p ( xyz[i-1], point);
+      double dist = ( edge ^ n1p ).Magnitude() / edge.Magnitude();
+      if ( dist > tol )
+        return true;
+      gp_Vec n2p( xyz[i], point );
+      if ( fabs( edge.Magnitude() - n1p.Magnitude() - n2p.Magnitude()) > tol )
+        return true;
+    }
+    return false;
+  }
+  // Node or 0D element -------------------------------------------------------------------------
+  {
+    gp_Vec n2p ( xyz[0], point );
+    return n2p.Magnitude() <= tol;
+  }
+  return true;
+}
+
 //=======================================================================
 //function : SimplifyFace
 //purpose  :
@@ -6107,7 +6567,7 @@ bool SMESH_MeshEditor::FindFreeBorder (const SMDS_MeshNode*             theFirst
 
   //vector<const SMDS_MeshNode*> nodes;
   const SMDS_MeshNode *nIgnore = theFirstNode, *nStart = theSecondNode;
-  set < const SMDS_MeshElement* > foundElems;
+  TIDSortedElemSet foundElems;
   bool needTheLast = ( theLastNode != 0 );
 
   while ( nStart != theLastNode ) {
@@ -7185,6 +7645,9 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh *   theSm,
         case 4:
           NewElem = theHelper.AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], id, theForce3d);
           break;
+        case 5:
+          NewElem = theHelper.AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], aNds[4], id, theForce3d);
+          break;
         case 6:
           NewElem = theHelper.AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], aNds[4], aNds[5], id, theForce3d);
           break;
@@ -7229,7 +7692,6 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d)
         SMESH_subMesh* sm = smIt->next();
         if ( SMESHDS_SubMesh *smDS = sm->GetSubMeshDS() ) {
           aHelper.SetSubShape( sm->GetSubShape() );
-          if ( !theForce3d) aHelper.SetCheckNodePosition(true);
           nbCheckedElems += convertElemToQuadratic(smDS, aHelper, theForce3d);
         }
       }
@@ -7310,6 +7772,10 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d)
         NewVolume = aHelper.AddVolume(aNds[0], aNds[1], aNds[2],
                                       aNds[3], id, theForce3d );
         break;
+      case 5:
+        NewVolume = aHelper.AddVolume(aNds[0], aNds[1], aNds[2],
+                                      aNds[3], aNds[4], id, theForce3d);
+        break;
       case 6:
         NewVolume = aHelper.AddVolume(aNds[0], aNds[1], aNds[2],
                                       aNds[3], aNds[4], aNds[5], id, theForce3d);
@@ -8265,7 +8731,7 @@ bool SMESH_MeshEditor::doubleNodes( SMESHDS_Mesh*     theMeshDS,
         theNodeNodeMap[ aCurrNode ] = aNewNode;
         myLastCreatedNodes.Append( aNewNode );
       }
-      isDuplicate |= (aCurrNode == aNewNode);
+      isDuplicate |= (aCurrNode != aNewNode);
       newNodes[ ind++ ] = aNewNode;
     }
     if ( !isDuplicate )
@@ -8303,6 +8769,95 @@ static bool isInside(const SMDS_MeshElement* theElem,
   return (aState == TopAbs_IN || aState == TopAbs_ON );
 }
 
+/*!
+  \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+  \param theNodes - identifiers of nodes to be doubled
+  \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
+         nodes. If list of element identifiers is empty then nodes are doubled but 
+         they not assigned to elements
+  \return TRUE if operation has been completed successfully, FALSE otherwise
+*/
+bool SMESH_MeshEditor::DoubleNodes( const std::list< int >& theListOfNodes, 
+                                    const std::list< int >& theListOfModifiedElems )
+{
+  myLastCreatedElems.Clear();
+  myLastCreatedNodes.Clear();
+
+  if ( theListOfNodes.size() == 0 )
+    return false;
+
+  SMESHDS_Mesh* aMeshDS = GetMeshDS();
+  if ( !aMeshDS )
+    return false;
+
+  // iterate through nodes and duplicate them
+
+  std::map< const SMDS_MeshNode*, const SMDS_MeshNode* > anOldNodeToNewNode;
+
+  std::list< int >::const_iterator aNodeIter;
+  for ( aNodeIter = theListOfNodes.begin(); aNodeIter != theListOfNodes.end(); ++aNodeIter )
+  {
+    int aCurr = *aNodeIter;
+    SMDS_MeshNode* aNode = (SMDS_MeshNode*)aMeshDS->FindNode( aCurr );
+    if ( !aNode )
+      continue;
+
+    // duplicate node
+
+    const SMDS_MeshNode* aNewNode = aMeshDS->AddNode( aNode->X(), aNode->Y(), aNode->Z() );
+    if ( aNewNode )
+    {
+      anOldNodeToNewNode[ aNode ] = aNewNode;
+      myLastCreatedNodes.Append( aNewNode );
+    }
+  }
+
+  // Create map of new nodes for modified elements
+
+  std::map< SMDS_MeshElement*, vector<const SMDS_MeshNode*> > anElemToNodes;
+
+  std::list< int >::const_iterator anElemIter;
+  for ( anElemIter = theListOfModifiedElems.begin(); 
+        anElemIter != theListOfModifiedElems.end(); ++anElemIter )
+  {
+    int aCurr = *anElemIter;
+    SMDS_MeshElement* anElem = (SMDS_MeshElement*)aMeshDS->FindElement( aCurr );
+    if ( !anElem )
+      continue;
+
+    vector<const SMDS_MeshNode*> aNodeArr( anElem->NbNodes() );
+
+    SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
+    int ind = 0;
+    while ( anIter->more() ) 
+    { 
+      SMDS_MeshNode* aCurrNode = (SMDS_MeshNode*)anIter->next();
+      if ( aCurr && anOldNodeToNewNode.find( aCurrNode ) != anOldNodeToNewNode.end() )
+      {
+        const SMDS_MeshNode* aNewNode = anOldNodeToNewNode[ aCurrNode ];
+        aNodeArr[ ind++ ] = aNewNode;
+      }
+      else
+        aNodeArr[ ind++ ] = aCurrNode;
+    }
+    anElemToNodes[ anElem ] = aNodeArr;
+  }
+
+  // Change nodes of elements  
+
+  std::map< SMDS_MeshElement*, vector<const SMDS_MeshNode*> >::iterator
+    anElemToNodesIter = anElemToNodes.begin();
+  for ( ; anElemToNodesIter != anElemToNodes.end(); ++anElemToNodesIter )
+  {
+    const SMDS_MeshElement* anElem = anElemToNodesIter->first;
+    vector<const SMDS_MeshNode*> aNodeArr = anElemToNodesIter->second;
+    if ( anElem )
+      aMeshDS->ChangeElementNodes( anElem, &aNodeArr[ 0 ], anElem->NbNodes() );
+  }
+
+  return true;
+}
+
 /*!
   \brief Creates a hole in a mesh by doubling the nodes of some particular elements
   \param theElems - group of of elements (edges or faces) to be replicated
@@ -8317,9 +8872,6 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems,
                                             const TIDSortedElemSet& theNodesNot,
                                             const TopoDS_Shape&     theShape )
 {
-  SMESHDS_Mesh* aMesh = GetMeshDS();
-  if (!aMesh)
-    return false;
   if ( theShape.IsNull() )
     return false;
 
@@ -8354,3 +8906,59 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems,
   }
   return DoubleNodes( theElems, theNodesNot, anAffected );
 }
+
+/*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+
+bool SMESH_MeshEditor::Make2DMeshFrom3D()
+{
+  // iterates on volume elements and detect all free faces on them
+  SMESHDS_Mesh* aMesh = GetMeshDS();
+  if (!aMesh)
+    return false;
+  bool res = false;
+  SMDS_VolumeIteratorPtr vIt = aMesh->volumesIterator();
+  while(vIt->more())
+  {
+    const SMDS_MeshVolume* volume = vIt->next();
+    SMDS_VolumeTool vTool( volume );
+    const bool isPoly = volume->IsPoly();
+    const bool isQuad = volume->IsQuadratic();
+    for ( int iface = 0, n = vTool.NbFaces(); iface < n; iface++ )
+    {
+      if (!vTool.IsFreeFace(iface))
+        continue;
+      vector<const SMDS_MeshNode *> nodes;
+      int nbFaceNodes = vTool.NbFaceNodes(iface);
+      const SMDS_MeshNode** faceNodes = vTool.GetFaceNodes(iface);
+      if (vTool.IsFaceExternal(iface)) 
+      {
+        int inode = 0;
+        for ( ; inode < nbFaceNodes; inode += isQuad ? 2 : 1)
+          nodes.push_back(faceNodes[inode]);
+        if (isQuad)
+          for ( inode = 1; inode < nbFaceNodes; inode += 2)
+            nodes.push_back(faceNodes[inode]);
+      }
+      else
+      {
+        int inode = nbFaceNodes-1;
+        for ( ; inode >=0; inode -= isQuad ? 2 : 1)
+          nodes.push_back(faceNodes[inode]);
+        if (isQuad)
+          for ( inode = nbFaceNodes-2; inode >=0; inode -= 2)
+            nodes.push_back(faceNodes[inode]);
+      }
+
+      // add new face based on volume nodes
+      if (aMesh->FindFace( nodes ) )
+        continue; // face already exsist
+      myLastCreatedElems.Append( AddElement(nodes, SMDSAbs_Face, isPoly && iface == 1) );
+      res = true;
+    }
+  }
+  return res;
+}
index a0dec46dc3d39e2c8f08e42a312c008a5dba7a7b..fba5047737618407f82766e85a10a628bf6f502e 100644 (file)
@@ -55,12 +55,38 @@ typedef std::map<const SMDS_MeshElement*,
                  std::list<const SMDS_MeshElement*> >        TElemOfElemListMap;
 typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
 
- //!< Set of elements sorted by ID, to be used to assure predictability of edition
+//!< Set of elements sorted by ID, to be used to assure predictability of edition
 typedef std::set< const SMDS_MeshElement*, TIDCompare >      TIDSortedElemSet;
 
 typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* >   NLink;
 
 
+//=======================================================================
+/*!
+ * \brief Searcher for the node closest to point
+ */
+//=======================================================================
+struct SMESH_NodeSearcher
+{
+  virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
+  virtual void MoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ) = 0;
+};
+
+//=======================================================================
+/*!
+ * \brief Return elements of given type where the given point is IN or ON.
+ *
+ * 'ALL' type means elements of any type excluding nodes and 0D elements
+ */
+//=======================================================================
+
+struct SMESH_ElementSearcher
+{
+  virtual void FindElementsByPoint(const gp_Pnt&                           point,
+                                   SMDSAbs_ElementType                     type,
+                                   std::vector< const SMDS_MeshElement* >& foundElems)=0;
+};
+
 //=======================================================================
 /*!
  * \brief A sorted pair of nodes
@@ -77,18 +103,6 @@ struct SMESH_TLink: public NLink
   const SMDS_MeshNode* node2() const { return second; }
 };
 
-// ============================================================
-/*!
- * \brief Searcher for the node closest to point
- */
-// ============================================================
-
-struct SMESH_NodeSearcher
-{
-  virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
-};
-
-
 //=======================================================================
 /*!
  * auxiliary class
@@ -365,6 +379,7 @@ public:
                        SMESH_Mesh*        theTargetMesh=0);
   // Move or copy theElements applying theTrsf to their nodes
 
+
   typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
 
   void FindCoincidentNodes (std::set<const SMDS_MeshNode*> & theNodes,
@@ -378,6 +393,16 @@ public:
    */
   SMESH_NodeSearcher* GetNodeSearcher();
 
+  /*!
+   * \brief Return SMESH_ElementSearcher
+   */
+  SMESH_ElementSearcher* GetElementSearcher();
+  /*!
+   * \brief Return true if the point is IN or ON of the element
+   */
+  static bool isOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
+
+
   int SimplifyFace (const std::vector<const SMDS_MeshNode *> faceNodes,
                     std::vector<const SMDS_MeshNode *>&      poly_nodes,
                     std::vector<int>&                        quantities) const;
@@ -391,7 +416,7 @@ public:
   typedef std::list< std::list< int > > TListOfListOfElementsID;
 
   void FindEqualElements(std::set<const SMDS_MeshElement*> & theElements,
-                        TListOfListOfElementsID &           theGroupsOfElementsID);
+                         TListOfListOfElementsID &           theGroupsOfElementsID);
   // Return list of group of elements build on the same nodes.
   // Search among theElements or in the whole mesh if theElements is empty.
 
@@ -576,6 +601,9 @@ public:
   const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
 
   const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
+
+  bool DoubleNodes( const std::list< int >& theListOfNodes, 
+                    const std::list< int >& theListOfModifiedElems );
   
   bool DoubleNodes( const TIDSortedElemSet& theElems, 
                     const TIDSortedElemSet& theNodesNot,
@@ -584,7 +612,14 @@ public:
   bool DoubleNodesInRegion( const TIDSortedElemSet& theElems, 
                             const TIDSortedElemSet& theNodesNot,
                             const TopoDS_Shape&     theShape );
-
+  
+  /*!
+   * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+   * The created 2D mesh elements based on nodes of free faces of boundary volumes
+   * \return TRUE if operation has been completed successfully, FALSE otherwise
+   */
+  bool Make2DMeshFrom3D();
+  
 private:
 
   /*!
@@ -653,25 +688,25 @@ private:
    * auxilary for ExtrusionAlongTrack
    */
   Extrusion_Error MakeEdgePathPoints(std::list<double>& aPrms,
-                                    const TopoDS_Edge& aTrackEdge,
-                                    bool FirstIsStart,
-                                    list<SMESH_MeshEditor_PathPoint>& LPP);
+                                     const TopoDS_Edge& aTrackEdge,
+                                     bool FirstIsStart,
+                                     list<SMESH_MeshEditor_PathPoint>& LPP);
   Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
-                                  list<SMESH_MeshEditor_PathPoint>& fullList,
-                                  const bool theHasAngles,
-                                  list<double>& theAngles,
-                                  const bool theLinearVariation,
-                                  const bool theHasRefPoint,
-                                  const gp_Pnt& theRefPoint,
-                                  const bool theMakeGroups);
+                                   list<SMESH_MeshEditor_PathPoint>& fullList,
+                                   const bool theHasAngles,
+                                   list<double>& theAngles,
+                                   const bool theLinearVariation,
+                                   const bool theHasRefPoint,
+                                   const gp_Pnt& theRefPoint,
+                                   const bool theMakeGroups);
   void LinearAngleVariation(const int NbSteps,
-                           list<double>& theAngles);
+                            list<double>& theAngles);
 
   bool doubleNodes( SMESHDS_Mesh*     theMeshDS,
                     const TIDSortedElemSet& theElems,
                     const TIDSortedElemSet& theNodesNot,
                     std::map< const SMDS_MeshNode*,
-                              const SMDS_MeshNode* >& theNodeNodeMap,
+                    const SMDS_MeshNode* >& theNodeNodeMap,
                     const bool theIsDoubleElem );
 
 private:
index 8b2062deb6486232119f085e57e8c22eb611d7c1..0ca91a4d34df1f06ae08723e1962fa872b99a56b 100644 (file)
@@ -71,7 +71,7 @@ namespace {
 //================================================================================
 
 SMESH_MesherHelper::SMESH_MesherHelper(SMESH_Mesh& theMesh)
-  : myMesh(&theMesh), myShapeID(0), myCreateQuadratic(false), myCheckNodePos(false)
+  : myMesh(&theMesh), myShapeID(0), myCreateQuadratic(false)
 {
   mySetElemOnShape = ( ! myMesh->HasShapeToMesh() );
 }
@@ -326,9 +326,8 @@ gp_Pnt2d SMESH_MesherHelper::GetUVOnSeam( const gp_Pnt2d& uv1, const gp_Pnt2d& u
  * \param F - the face
  * \param n - the node
  * \param n2 - a node of element being created located inside a face
+ * \param check - optional flag returing false if found UV are invalid
  * \retval gp_XY - resulting UV
- * 
- * Auxilary function called form GetMediumNode()
  */
 //=======================================================================
 
@@ -339,37 +338,14 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face&   F,
 {
   gp_Pnt2d uv( 1e100, 1e100 );
   const SMDS_PositionPtr Pos = n->GetPosition();
+  bool uvOK = false;
   if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE)
   {
     // node has position on face
     const SMDS_FacePosition* fpos =
       static_cast<const SMDS_FacePosition*>(n->GetPosition().get());
     uv.SetCoord(fpos->GetUParameter(),fpos->GetVParameter());
-    if ( check && *check )
-    {
-      // check that uv is correct
-      TopLoc_Location loc;
-      Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
-      double tol = 2 * BRep_Tool::Tolerance( F );
-      gp_Pnt nodePnt = XYZ( n );
-      if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
-      if ( nodePnt.Distance( surface->Value( uv.X(), uv.Y() )) > tol ) {
-        // uv incorrect, project the node to surface
-        GeomAPI_ProjectPointOnSurf projector( nodePnt, surface, tol );
-        if ( !projector.IsDone() || projector.NbPoints() < 1 ) {
-          MESSAGE( "SMESH_MesherHelper::GetNodeUV() failed to project" )
-          return uv.XY();
-        }
-        Quantity_Parameter U,V;
-        projector.LowerDistanceParameters(U,V);
-        if ( nodePnt.Distance( surface->Value( U, V )) > tol )
-          MESSAGE( "SMESH_MesherHelper::GetNodeUV(), invalid projection" );
-        uv.SetCoord( U,V );
-      }
-      else if ( uv.XY().Modulus() > numeric_limits<double>::min() ) {
-        *check = false; // parameters are OK, do not check further more
-      }
-    }
+    uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), BRep_Tool::Tolerance( F ));
   }
   else if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE)
   {
@@ -380,42 +356,49 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face&   F,
       static_cast<const SMDS_EdgePosition*>(n->GetPosition().get());
     int edgeID = Pos->GetShapeId();
     TopoDS_Edge E = TopoDS::Edge(GetMeshDS()->IndexToShape(edgeID));
-    double f, l;
+    double f, l, u = epos->GetUParameter();
     Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
-    uv = C2d->Value( epos->GetUParameter() );
+    if ( f < u && u < l )
+      uv = C2d->Value( u );
+    else
+      uv.SetCoord(0.,0.);
+    uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), BRep_Tool::Tolerance( E ));
+
     // for a node on a seam edge select one of UVs on 2 pcurves
     if ( n2 && IsSeamShape( edgeID ) )
+    {
       uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
-
-    // adjust uv to period
-    TopLoc_Location loc;
-    Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
-    Standard_Boolean isUPeriodic = S->IsUPeriodic();
-    Standard_Boolean isVPeriodic = S->IsVPeriodic();
-    if ( isUPeriodic || isVPeriodic ) {
-      Standard_Real UF,UL,VF,VL;
-      S->Bounds(UF,UL,VF,VL);
-      if(isUPeriodic)
-        uv.SetX( uv.X() + ShapeAnalysis::AdjustToPeriod(uv.X(),UF,UL));
-      if(isVPeriodic)
-        uv.SetY( uv.Y() + ShapeAnalysis::AdjustToPeriod(uv.Y(),VF,VL));
+    }
+    else
+    { // adjust uv to period
+      TopLoc_Location loc;
+      Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
+      Standard_Boolean isUPeriodic = S->IsUPeriodic();
+      Standard_Boolean isVPeriodic = S->IsVPeriodic();
+      if ( isUPeriodic || isVPeriodic ) {
+        Standard_Real UF,UL,VF,VL;
+        S->Bounds(UF,UL,VF,VL);
+        if(isUPeriodic)
+          uv.SetX( uv.X() + ShapeAnalysis::AdjustToPeriod(uv.X(),UF,UL));
+        if(isVPeriodic)
+          uv.SetY( uv.Y() + ShapeAnalysis::AdjustToPeriod(uv.Y(),VF,VL));
+      }
     }
   }
   else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX)
   {
     if ( int vertexID = n->GetPosition()->GetShapeId() ) {
-      bool ok = true;
       const TopoDS_Vertex& V = TopoDS::Vertex(GetMeshDS()->IndexToShape(vertexID));
       try {
         uv = BRep_Tool::Parameters( V, F );
+        uvOK = true;
       }
       catch (Standard_Failure& exc) {
-        ok = false;
       }
-      if ( !ok ) {
-        for ( TopExp_Explorer vert(F,TopAbs_VERTEX); !ok && vert.More(); vert.Next() )
-          ok = ( V == vert.Current() );
-        if ( !ok ) {
+      if ( !uvOK ) {
+        for ( TopExp_Explorer vert(F,TopAbs_VERTEX); !uvOK && vert.More(); vert.Next() )
+          uvOK = ( V == vert.Current() );
+        if ( !uvOK ) {
 #ifdef _DEBUG_
           MESSAGE ( "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID
                << " not in face " << GetMeshDS()->ShapeToIndex( F ) );
@@ -423,14 +406,14 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face&   F,
           // get UV of a vertex closest to the node
           double dist = 1e100;
           gp_Pnt pn = XYZ( n );
-          for ( TopExp_Explorer vert(F,TopAbs_VERTEX); !ok && vert.More(); vert.Next() ) {
+          for ( TopExp_Explorer vert(F,TopAbs_VERTEX); !uvOK && vert.More(); vert.Next() ) {
             TopoDS_Vertex curV = TopoDS::Vertex( vert.Current() );
             gp_Pnt p = BRep_Tool::Pnt( curV );
             double curDist = p.SquareDistance( pn );
             if ( curDist < dist ) {
               dist = curDist;
               uv = BRep_Tool::Parameters( curV, F );
-              if ( dist < DBL_MIN ) break;
+              uvOK = ( dist < DBL_MIN );
             }
           }
         }
@@ -454,9 +437,58 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face&   F,
         uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
     }
   }
+
+  if ( check )
+    *check = uvOK;
+
   return uv.XY();
 }
 
+//=======================================================================
+/*!
+ * \brief Check and fix node UV on a face
+ *  \retval bool - false if UV is bad and could not be fixed
+ */
+//=======================================================================
+
+bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face&   F,
+                                     const SMDS_MeshNode* n,
+                                     gp_XY&               uv,
+                                     const double         tol) const
+{
+  if ( !myOkNodePosShapes.count( n->GetPosition()->GetShapeId() ))
+  {
+    // check that uv is correct
+    TopLoc_Location loc;
+    Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
+    gp_Pnt nodePnt = XYZ( n );
+    if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
+    if ( nodePnt.Distance( surface->Value( uv.X(), uv.Y() )) > tol )
+    {
+      // uv incorrect, project the node to surface
+      GeomAPI_ProjectPointOnSurf projector( nodePnt, surface, tol );
+      if ( !projector.IsDone() || projector.NbPoints() < 1 )
+      {
+        MESSAGE( "SMESH_MesherHelper::CheckNodeUV() failed to project" );
+        return false;
+      }
+      Quantity_Parameter U,V;
+      projector.LowerDistanceParameters(U,V);
+      if ( nodePnt.Distance( surface->Value( U, V )) > tol )
+      {
+        MESSAGE( "SMESH_MesherHelper::CheckNodeUV(), invalid projection" );
+        return false;
+      }
+      uv.SetCoord( U,V );
+    }
+    else if ( uv.Modulus() > numeric_limits<double>::min() )
+    {
+      ((SMESH_MesherHelper*) this)->myOkNodePosShapes.insert( n->GetPosition()->GetShapeId() );
+    }
+  }
+  return true;
+}
+
 //=======================================================================
 /*!
  * \brief Return middle UV taking in account surface period
@@ -583,23 +615,26 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
         F = TopoDS::Face(myShape);
         faceID = myShapeID;
       }
+      bool uvOK1, uvOK2;
+      gp_XY p1 = GetNodeUV(F,n1,n2, &uvOK1);
+      gp_XY p2 = GetNodeUV(F,n2,n1, &uvOK2);
 
-      gp_XY p1 = GetNodeUV(F,n1,n2, &myCheckNodePos);
-      gp_XY p2 = GetNodeUV(F,n2,n1, &myCheckNodePos);
-
-      if ( IsDegenShape( Pos1->GetShapeId() ))
-        p1.SetCoord( myParIndex, p2.Coord( myParIndex ));
-      else if ( IsDegenShape( Pos2->GetShapeId() ))
-        p2.SetCoord( myParIndex, p1.Coord( myParIndex ));
-
-      TopLoc_Location loc;
-      Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
-      gp_XY uv = GetMiddleUV( S, p1, p2 );
-      gp_Pnt P = S->Value( uv.X(), uv.Y() ).Transformed(loc);
-      n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
-      meshDS->SetNodeOnFace(n12, faceID, uv.X(), uv.Y());
-      myTLinkNodeMap.insert(make_pair(link,n12));
-      return n12;
+      if ( uvOK1 && uvOK2 )
+      {
+        if ( IsDegenShape( Pos1->GetShapeId() ))
+          p1.SetCoord( myParIndex, p2.Coord( myParIndex ));
+        else if ( IsDegenShape( Pos2->GetShapeId() ))
+          p2.SetCoord( myParIndex, p1.Coord( myParIndex ));
+
+        TopLoc_Location loc;
+        Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
+        gp_XY uv = GetMiddleUV( S, p1, p2 );
+        gp_Pnt P = S->Value( uv.X(), uv.Y() ).Transformed(loc);
+        n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
+        meshDS->SetNodeOnFace(n12, faceID, uv.X(), uv.Y());
+        myTLinkNodeMap.insert(make_pair(link,n12));
+        return n12;
+      }
     }
     if (edgeID>0 || shapeType == TopAbs_EDGE) {
 
@@ -611,8 +646,8 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
         edgeID = myShapeID;
       }
 
-      double p1 = GetNodeU(E,n1, &myCheckNodePos);
-      double p2 = GetNodeU(E,n2, &myCheckNodePos);
+      double p1 = GetNodeU(E,n1);
+      double p2 = GetNodeU(E,n2);
 
       double f,l;
       Handle(Geom_Curve) C = BRep_Tool::Curve(E, f, l);
@@ -723,7 +758,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
                                            const SMDS_MeshNode* n2,
                                            const SMDS_MeshNode* n3,
                                            const int id,
-                                          const bool force3d)
+                                           const bool force3d)
 {
   SMESHDS_Mesh * meshDS = GetMeshDS();
   SMDS_MeshFace* elem = 0;
@@ -764,7 +799,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
                                            const SMDS_MeshNode* n3,
                                            const SMDS_MeshNode* n4,
                                            const int id,
-                                          const bool force3d)
+                                           const bool force3d)
 {
   SMESHDS_Mesh * meshDS = GetMeshDS();
   SMDS_MeshFace* elem = 0;
@@ -824,7 +859,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
                                                const SMDS_MeshNode* n5,
                                                const SMDS_MeshNode* n6,
                                                const int id,
-                                              const bool force3d)
+                                               const bool force3d)
 {
   SMESHDS_Mesh * meshDS = GetMeshDS();
   SMDS_MeshVolume* elem = 0;
@@ -871,7 +906,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
                                                const SMDS_MeshNode* n3,
                                                const SMDS_MeshNode* n4,
                                                const int id, 
-                                              const bool force3d)
+                                               const bool force3d)
 {
   SMESHDS_Mesh * meshDS = GetMeshDS();
   SMDS_MeshVolume* elem = 0;
@@ -913,7 +948,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
                                                const SMDS_MeshNode* n4,
                                                const SMDS_MeshNode* n5,
                                                const int id, 
-                                              const bool force3d)
+                                               const bool force3d)
 {
   SMDS_MeshVolume* elem = 0;
   if(!myCreateQuadratic) {
@@ -964,7 +999,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
                                                const SMDS_MeshNode* n7,
                                                const SMDS_MeshNode* n8,
                                                const int id,
-                                              const bool force3d)
+                                               const bool force3d)
 {
   SMESHDS_Mesh * meshDS = GetMeshDS();
   SMDS_MeshVolume* elem = 0;
index 65c3f600d9f8e9bd29162044f3c651703b5764db..80bd0affa1b09cbb6abdcbd59e3904ff36e8baf8 100644 (file)
@@ -151,15 +151,6 @@ public:
    */
   void SetElementsOnShape(bool toSet) { mySetElemOnShape = toSet; }
 
-  /*!
-   * \brief Enable/disable checking of node parameters on shapes while adding elements.
-   * In case of incorrect parameters mudium node place is computed as the middle
-   * of two nodes. Default is false.
-   * NOTE that this flag is reset to "not to check" if check with non-default partameter
-   * is successful
-   */
-  void SetCheckNodePosition(bool toCheck) { myCheckNodePos = toCheck; }
-
   /*!
    * \brief Set shape to make elements on without calling IsQuadraticSubMesh()
    */
@@ -193,7 +184,7 @@ public:
                          const SMDS_MeshNode* n2,
                          const SMDS_MeshNode* n3,
                          const int id=0, 
-                        const bool force3d = false);
+                         const bool force3d = false);
   /*!
    * Creates quadratic or linear quadrangle
    */
@@ -202,7 +193,7 @@ public:
                          const SMDS_MeshNode* n3,
                          const SMDS_MeshNode* n4,
                          const int id = 0,
-                        const bool force3d = false);
+                         const bool force3d = false);
   /*!
    * Creates quadratic or linear tetraahedron
    */
@@ -211,7 +202,7 @@ public:
                              const SMDS_MeshNode* n3,
                              const SMDS_MeshNode* n4,
                              const int id = 0,
-                            const bool force3d = true);
+                             const bool force3d = true);
   /*!
    * Creates quadratic or linear pyramid
    */
@@ -221,7 +212,7 @@ public:
                              const SMDS_MeshNode* n4,
                              const SMDS_MeshNode* n5,
                              const int id = 0,
-                            const bool force3d = true);
+                             const bool force3d = true);
   /*!
    * Creates quadratic or linear pentahedron
    */
@@ -232,7 +223,7 @@ public:
                              const SMDS_MeshNode* n5,
                              const SMDS_MeshNode* n6,
                              const int id = 0, 
-                            const bool force3d = true);
+                             const bool force3d = true);
   /*!
    * Creates quadratic or linear hexahedron
    */
@@ -245,7 +236,7 @@ public:
                              const SMDS_MeshNode* n7,
                              const SMDS_MeshNode* n8,
                              const int id = 0, 
-                            bool force3d = true);
+                             bool force3d = true);
   /*!
    * \brief Return U of the given node on the edge
    */
@@ -260,6 +251,14 @@ public:
                   const SMDS_MeshNode* n,
                   const SMDS_MeshNode* inFaceNode=0,
                   bool*                check=0) const;
+  /*!
+   * \brief Check and fix node UV on a face
+   *  \retval bool - false if UV is bad and could not be fixed
+   */
+  bool CheckNodeUV(const TopoDS_Face&   F,
+                   const SMDS_MeshNode* n,
+                   gp_XY&               uv,
+                   const double         tol) const;
   /*!
    * \brief Return middle UV taking in account surface period
    */
@@ -393,7 +392,7 @@ protected:
   // to create quadratic elements
   bool            myCreateQuadratic;
   bool            mySetElemOnShape;
-  bool            myCheckNodePos;
+  std::set< int > myOkNodePosShapes;
 
 };
 
index 4642fa61da1e918da114a3f2546445e2318f71a4..00bdb26698cb480a6c7404cf29b5b1c84460a2a6 100644 (file)
 
 //===========================================================================
 /*!
- * \brief SMESH_Octree Constructor
- * \param maxLevel     - The level max the octree can reach (If <0 unlimited)
+ * Constructor. limit must be provided at tree root construction.
+ * limit will be deleted by SMESH_Octree.
  */
 //===========================================================================
-SMESH_Octree::SMESH_Octree (const int maxLevel, const double minBoxSize):
-    myChildren(NULL),
-    myFather(NULL),
-    myLevel(0),
-    myMaxLevel(maxLevel),
-    myMinBoxSize(minBoxSize),
-    myIsLeaf(-1)
+
+SMESH_Octree::SMESH_Octree (SMESH_Octree::Limit* limit):
+  myChildren(NULL),
+  myFather(NULL),
+  myIsLeaf( false ),
+  myLimit( limit ),
+  myLevel(0),
+  myBox(NULL)
+{
+}
+
+//================================================================================
+/*!
+ * \brief Compute the Octree
+ */
+//================================================================================
+
+void SMESH_Octree::compute()
 {
-  myBox = new Bnd_B3d();
+  if ( myLevel==0 )
+  {
+    myBox = buildRootBox();
+    if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize )
+      myIsLeaf = true;
+    else
+      buildChildren();
+  }
 }
 
 //======================================
@@ -50,85 +68,25 @@ SMESH_Octree::SMESH_Octree (const int maxLevel, const double minBoxSize):
  * \brief SMESH_Octree Destructor
  */
 //======================================
+
 SMESH_Octree::~SMESH_Octree ()
 {
   if(myChildren != NULL)
   {
-    if(!myIsLeaf)
+    if(!isLeaf())
     {
       for(int i = 0; i<8; i++)
         delete myChildren[i];
       delete[] myChildren;
+      myChildren = 0;
     }
   }
-  delete myBox;
-}
-
-//===========================================================================
-/*!
- * \brief Set the bounding box of the Octree
- * \param box          - 3d Bounding Box of the Octree
- */
-//===========================================================================
-void SMESH_Octree::setBox(const Bnd_B3d* box)
-{
-//   delete myBox;
-//   myBox=new Bnd_B3d(*box);
-  *myBox = *box;
-}
-
-//===========================================================================
-/*!
- * \brief Set box to the 3d Bounding Box of the Octree
- * \param box          - Set box to the 3d Bounding Box of the Octree
- */
-//===========================================================================
-void SMESH_Octree::getBox(Bnd_B3d& box)
-{
-//   if(box != NULL)
-//     delete box;
-//   box = new Bnd_B3d (*myBox);
-  box = *myBox;
-}
-
-//===========================================================================
-/*!
- * \brief Set the max level of the Octree
- * \param maxLevel     - The level max the octree can reach (If <0 unlimited)
- */
-//===========================================================================
-void SMESH_Octree::setMaxLevel(const int maxLevel)
-{myMaxLevel = maxLevel;}
-
-
-//===========================================================================
-/*!
- * \brief Compute the bigger dimension of the box
- * \param box          - 3d Box
- * \retval double - bigger dimension of the box
- */
-//===========================================================================
-double SMESH_Octree::maxSize(const Bnd_B3d* box)
-{
-  if(box ==NULL)
-    return 0;
-  gp_XYZ min = box->CornerMin();
-  gp_XYZ max = box->CornerMax();
-  gp_XYZ Size = (max - min);
-  double returnVal = (Size.X()>Size.Y())?Size.X():Size.Y();
-  return (returnVal>Size.Z())?returnVal:Size.Z();
-}
-
-//=============================
-/*!
- * \brief Compute the Octree
- */
-//=============================
-void SMESH_Octree::Compute()
-{
-  // As soon as the Octree is a Leaf, I stop building his children
-  if(!isLeaf())
-    buildChildren();
+  if ( myBox )
+    delete myBox;
+  myBox = 0;
+  if ( level() == 0 )
+    delete myLimit;
+  myLimit = 0;
 }
 
 //=================================================================
@@ -136,8 +94,11 @@ void SMESH_Octree::Compute()
  * \brief Build the 8 children boxes and call buildChildrenData()
  */
 //=================================================================
+
 void SMESH_Octree::buildChildren()
 {
+  if ( isLeaf() ) return;
+
   myChildren = new SMESH_Octree*[8];
 
   gp_XYZ min = myBox->CornerMin();
@@ -147,7 +108,6 @@ void SMESH_Octree::buildChildren()
   gp_XYZ childHsize = HSize/2.;
 
   Standard_Real XminChild, YminChild, ZminChild;
-  Bnd_B3d* box;
   gp_XYZ minChild;
   for (int i = 0; i < 8; i++)
   {
@@ -166,19 +126,53 @@ void SMESH_Octree::buildChildren()
     ZminChild = (i<4)?min.Z():mid.Z();
     minChild.SetCoord(XminChild, YminChild, ZminChild);
 
-    box = new Bnd_B3d(minChild+childHsize,childHsize);
     // The child is of the same type than its father (For instance, a SMESH_OctreeNode)
     // We allocate the memory we need for the child
     myChildren[i] = allocateOctreeChild();
     // and we assign to him its box.
-    myChildren[i]->setBox(box);
-    delete box;
+    myChildren[i]->myFather = this;
+    myChildren[i]->myLimit = myLimit;
+    myChildren[i]->myLevel = myLevel + 1;
+    myChildren[i]->myBox = new Bnd_B3d(minChild+childHsize,childHsize);
+    if ( myLimit->myMinBoxSize > 0. && myChildren[i]->maxSize() <= myLimit->myMinBoxSize )
+      myChildren[i]->myIsLeaf = true;
   }
 
-  // After building the 8 boxes, we put the data into the children..
+  // After building the 8 boxes, we put the data into the children.
   buildChildrenData();
 
   //After we pass to the next level of the Octree
-  for (int i = 0; i < 8; i++)
-    myChildren[i]->Compute();
+  for (int i = 0; i<8; i++)
+    myChildren[i]->buildChildren();
+}
+
+//================================================================================
+/*!
+ * \brief Tell if Octree is a leaf or not
+ *        An inheriting class can influence it via myIsLeaf protected field
+ */
+//================================================================================
+
+bool SMESH_Octree::isLeaf() const
+{
+  return myIsLeaf || ((myLimit->myMaxLevel > 0) ? (level() >= myLimit->myMaxLevel) : false );
+}
+
+//===========================================================================
+/*!
+ * \brief Compute the bigger dimension of my box
+ */
+//===========================================================================
+
+double SMESH_Octree::maxSize() const
+{
+  if ( myBox )
+  {
+    gp_XYZ min = myBox->CornerMin();
+    gp_XYZ max = myBox->CornerMax();
+    gp_XYZ Size = (max - min);
+    double returnVal = (Size.X()>Size.Y())?Size.X():Size.Y();
+    return (returnVal>Size.Z())?returnVal:Size.Z();
+  }
+  return 0.;
 }
index f906c2a08c03a58920448f1ecbabce7f18f90e5b..79a641dd4c262b003d8063cf961b20dd924e2afd 100644 (file)
 class SMESH_Octree {
 
 public:
-  // Constructor
-  SMESH_Octree (const int maxLevel = -1, const double minBoxSize = 0.);
 
-  // Destructor
-  virtual ~SMESH_Octree ();
-
-  // Tell if Octree is a leaf or not (has to be implemented in inherited classes)
-  virtual const bool     isLeaf() = 0;
+  // Data limiting the tree height
+  struct Limit {
+    // MaxLevel of the Octree
+    int    myMaxLevel;
+    // Minimal size of the Box
+    double myMinBoxSize;
 
-  // Compute the Octree
-  void                   Compute();
+    // Default:
+    // maxLevel-> 8^8 = 16777216 terminal trees
+    // minSize -> box size not checked
+    Limit(int maxLevel=8, double minSize=0.):myMaxLevel(maxLevel),myMinBoxSize(minSize) {}
+    virtual ~Limit() {} // it can be inherited
+  };
 
-  // Set the maximal level of the Octree
-  void                   setMaxLevel(const int maxLevel);
+  // Constructor. limit must be provided at tree root construction.
+  // limit will be deleted by SMESH_Octree
+  SMESH_Octree (Limit* limit=0);
 
-  // Set the minimal size of the Box
-  void                   setMinBoxSize(const double minBoxSize){myMinBoxSize = minBoxSize;};
-
-  // Set the bounding box of the Octree
-  void                   setBox(const Bnd_B3d* box);
+  // Destructor
+  virtual ~SMESH_Octree ();
 
-  // Set box to the 3d Bounding Box of the Octree
-  void                   getBox(Bnd_B3d & box);
+  // Compute the Octree. Must be called by constructor of inheriting class
+  void                   compute();
 
-  // Compute the bigger dimension of the box
-  static double          maxSize(const Bnd_B3d* box);
+  // Tell if Octree is a leaf or not.
+  // An inheriting class can influence it via myIsLeaf protected field
+  bool                   isLeaf() const;
 
   // Return its level
   int                    level() const { return myLevel; }
 
+  // Get box to the 3d Bounding Box of the Octree
+  const Bnd_B3d&         getBox() const { return *myBox; }
+
+  // Compute the bigger dimension of my box
+  double                 maxSize() const;
+
+  // Return index of a child the given point is in
+  inline int             getChildIndex(double x, double y, double z, const gp_XYZ& boxMiddle)const;
+
 protected:
-  // Constructor for children (has to be implemented in inherited classes)
-  virtual SMESH_Octree* allocateOctreeChild() = 0;
+  // Return box of the whole tree
+  virtual Bnd_B3d*       buildRootBox() = 0;
 
-  // Build the 8 children boxes
-  void buildChildren();
+  // Constructor for children
+  virtual SMESH_Octree*  allocateOctreeChild() const = 0;
 
-  // Build the data in the 8 children (has to be implemented in inherited classes)
-  virtual void buildChildrenData() = 0;
+  // Build the data in the 8 children
+  virtual void           buildChildrenData() = 0;
 
   // members
 
-  // Box of the Octree
-  Bnd_B3d*       myBox;
-
   // Array of 8 Octree children
   SMESH_Octree** myChildren;
 
   // Point the father, set to NULL for the level 0
   SMESH_Octree*  myFather;
 
+  // Tell us if the Octree is a leaf or not
+  bool           myIsLeaf;
+
+  // Tree limit
+  const Limit*   myLimit;
+
+private:
+  // Build the 8 children boxes recursively
+  void                   buildChildren();
+
   // Level of the Octree
   int            myLevel;
 
-  // MaxLevel of the Octree
-  int            myMaxLevel;
+  Bnd_B3d*       myBox;
+};
 
-  // Minimal size of the Box
-  double         myMinBoxSize;
+//================================================================================
+/*!
+ * \brief Return index of a child the given point is in
+ */
+//================================================================================
 
-  // Tell us if the Octree is a leaf or not (-1 if not initialized)
-  int            myIsLeaf;
-};
+inline int SMESH_Octree::getChildIndex(double x, double y, double z, const gp_XYZ& mid) const
+{
+  return (x > mid.X()) + ( y > mid.Y())*2 + (z > mid.Z())*4;
+}
 
 #endif
index 9a74d71bd7048db96817b792dad1b6ae5b703d54..8a230d72e5046c32dfc8009ecbcaaf05a5dab2f4 100644 (file)
@@ -46,18 +46,22 @@ using namespace std;
 //================================================================
 SMESH_OctreeNode::SMESH_OctreeNode (const set<const SMDS_MeshNode*> & theNodes, const int maxLevel,
                                     const int maxNbNodes , const double minBoxSize )
-  :SMESH_Octree(maxLevel,minBoxSize),
+  :SMESH_Octree( new SMESH_Octree::Limit( maxLevel,minBoxSize)),
   myMaxNbNodes(maxNbNodes),
   myNodes(theNodes)
 {
-  // We need to compute the first bounding box via a special method
-  computeBoxForFather();
-  myNbNodes = myNodes.size();
-  myIsLeaf = ((myLevel == myMaxLevel) ||
-              (myNbNodes <= myMaxNbNodes) ||
-              (maxSize(myBox) <= myMinBoxSize));
-  // All the children (Boxes and Data) are computed in Compute()
-  Compute();
+  compute();
+}
+
+//================================================================================
+/*!
+ * \brief Constructor used to allocate a child
+ */
+//================================================================================
+
+SMESH_OctreeNode::SMESH_OctreeNode (int maxNbNodes):
+  SMESH_Octree(), myMaxNbNodes(maxNbNodes)
+{
 }
 
 //==================================================================================
@@ -65,16 +69,10 @@ SMESH_OctreeNode::SMESH_OctreeNode (const set<const SMDS_MeshNode*> & theNodes,
  * \brief Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren()
  */
 //==================================================================================
-SMESH_Octree* SMESH_OctreeNode::allocateOctreeChild()
+
+SMESH_Octree* SMESH_OctreeNode::allocateOctreeChild() const
 {
-  SMESH_OctreeNode * theOctree = new SMESH_OctreeNode();
-  theOctree->myFather = this;
-  theOctree->myLevel = myLevel + 1;
-  theOctree->myMaxLevel = myMaxLevel;
-  theOctree->myMaxNbNodes = myMaxNbNodes;
-  theOctree->myMinBoxSize = myMinBoxSize;
-  theOctree->myNbNodes = 0;
-  return theOctree;
+  return new SMESH_OctreeNode(myMaxNbNodes);
 }
 
 //======================================
@@ -84,25 +82,20 @@ SMESH_Octree* SMESH_OctreeNode::allocateOctreeChild()
  * We take the max/min coord of the nodes
  */
 //======================================
-void SMESH_OctreeNode::computeBoxForFather()
+
+Bnd_B3d* SMESH_OctreeNode::buildRootBox()
 {
+  Bnd_B3d* box = new Bnd_B3d;
   set<const SMDS_MeshNode*>::iterator it = myNodes.begin();
   for (; it != myNodes.end(); it++) {
     const SMDS_MeshNode* n1 = *it;
     gp_XYZ p1( n1->X(), n1->Y(), n1->Z() );
-    myBox->Add(p1);
+    box->Add(p1);
   }
-}
+  if ( myNodes.size() <= myMaxNbNodes )
+    myIsLeaf = true;
 
-//====================================================================================
-/*!
- * \brief Tell if Octree is a leaf or not (has to be implemented in inherited classes)
- * \retval      - True if the Octree is a leaf
- */
-//====================================================================================
-const bool SMESH_OctreeNode::isLeaf()
-{
-  return myIsLeaf;
+  return box;
 }
 
 //====================================================================================
@@ -113,19 +106,15 @@ const bool SMESH_OctreeNode::isLeaf()
  * \retval bool - True if Node is in the box within precision
  */
 //====================================================================================
+
 const bool SMESH_OctreeNode::isInside (const SMDS_MeshNode * Node, const double precision)
 {
-  double X = Node->X();
-  double Y = Node->Y();
-  double Z = Node->Z();
-  bool Out = 1 ;
+  gp_XYZ p (Node->X(),Node->Y(),Node->Z());
   if (precision <= 0.)
-    return !(myBox->IsOut(gp_XYZ(X,Y,Z)));
-  Bnd_B3d BoxWithPrecision;
-  getBox(BoxWithPrecision);
+    return !(getBox().IsOut(p));
+  Bnd_B3d BoxWithPrecision = getBox();
   BoxWithPrecision.Enlarge(precision);
-  Out = BoxWithPrecision.IsOut(gp_XYZ(X,Y,Z));
-  return !(Out);
+  return ! BoxWithPrecision.IsOut(p);
 }
 
 //================================================
@@ -136,16 +125,15 @@ const bool SMESH_OctreeNode::isInside (const SMDS_MeshNode * Node, const double
 //================================================
 void SMESH_OctreeNode::buildChildrenData()
 {
-  gp_XYZ min = myBox->CornerMin();
-  gp_XYZ max = myBox->CornerMax();
+  gp_XYZ min = getBox().CornerMin();
+  gp_XYZ max = getBox().CornerMax();
   gp_XYZ mid = (min + max)/2.;
 
   set<const SMDS_MeshNode*>::iterator it = myNodes.begin();
-  int ChildBoxNum;
   while (it != myNodes.end())
   {
     const SMDS_MeshNode* n1 = *it;
-    ChildBoxNum = (n1->X() > mid.X()) + (n1->Y() > mid.Y())*2 + (n1->Z() > mid.Z())*4;
+    int ChildBoxNum = getChildIndex( n1->X(), n1->Y(), n1->Z(), mid );
     SMESH_OctreeNode* myChild = dynamic_cast<SMESH_OctreeNode*> (myChildren[ChildBoxNum]);
     myChild->myNodes.insert(myChild->myNodes.end(),n1);
     myNodes.erase( it );
@@ -154,10 +142,8 @@ void SMESH_OctreeNode::buildChildrenData()
   for (int i = 0; i < 8; i++)
   {
     SMESH_OctreeNode* myChild = dynamic_cast<SMESH_OctreeNode*> (myChildren[i]);
-    myChild->myNbNodes = (myChild->myNodes).size();
-    myChild->myIsLeaf = ((myChild->myLevel == myMaxLevel) ||
-                         (myChild->myNbNodes <= myMaxNbNodes) ||
-                         (maxSize(myChild->myBox) <= myMinBoxSize));
+    if ( myChild->myNodes.size() <= myMaxNbNodes )
+      myChild->myIsLeaf = true;
   }
 }
 
@@ -175,7 +161,7 @@ void SMESH_OctreeNode::NodesAround (const SMDS_MeshNode * Node,
 {
   if (isInside(Node,precision))
   {
-    if (myIsLeaf)
+    if (isLeaf())
     {
       Result->insert(Result->end(), myNodes.begin(), myNodes.end());
     }
@@ -190,6 +176,61 @@ void SMESH_OctreeNode::NodesAround (const SMDS_MeshNode * Node,
   }
 }
 
+//================================================================================
+/*!
+ * \brief Return in dist2Nodes nodes mapped to their square distance from Node
+ *  \param node - node to find nodes closest to
+ *  \param dist2Nodes - map of found nodes and their distances
+ *  \param precision - radius of a sphere to check nodes inside
+ *  \retval bool - true if an exact overlapping found
+ */
+//================================================================================
+
+bool SMESH_OctreeNode::NodesAround(const SMDS_MeshNode *              node,
+                                   map<double, const SMDS_MeshNode*>& dist2Nodes,
+                                   double                             precision)
+{
+  if ( !dist2Nodes.empty() )
+    precision = min ( precision, sqrt( dist2Nodes.begin()->first ));
+  else if ( precision == 0. )
+    precision = maxSize() / 2;
+
+  if (isInside(node,precision))
+  {
+    if (!isLeaf())
+    {
+      // first check a child containing node
+      gp_XYZ mid = (getBox().CornerMin() + getBox().CornerMax()) / 2.;
+      int nodeChild  = getChildIndex( node->X(), node->Y(), node->Z(), mid );
+      if ( ((SMESH_OctreeNode*) myChildren[nodeChild])->NodesAround(node, dist2Nodes, precision))
+        return true;
+      
+      for (int i = 0; i < 8; i++)
+        if ( i != nodeChild )
+          if (((SMESH_OctreeNode*) myChildren[i])->NodesAround(node, dist2Nodes, precision))
+            return true;
+    }
+    else if ( NbNodes() > 0 )
+    {
+      double minDist = precision * precision;
+      gp_Pnt p1 ( node->X(), node->Y(), node->Z() );
+      set<const SMDS_MeshNode*>::iterator nIt = myNodes.begin();
+      for ( ; nIt != myNodes.end(); ++nIt )
+      {
+        gp_Pnt p2 ( (*nIt)->X(), (*nIt)->Y(), (*nIt)->Z() );
+        double dist2 = p1.SquareDistance( p2 );
+        if ( dist2 < minDist )
+          dist2Nodes.insert( make_pair( minDist = dist2, *nIt ));
+      }
+//       if ( dist2Nodes.size() > 1 ) // leave only closest node in dist2Nodes
+//         dist2Nodes.erase( ++dist2Nodes.begin(), dist2Nodes.end());
+
+      return ( sqrt( minDist) <= precision * 1e-12 );
+    }
+  }
+  return false;
+}
+
 //=============================
 /*!
  * \brief  Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance
@@ -202,15 +243,14 @@ void SMESH_OctreeNode::NodesAround (const SMDS_MeshNode * Node,
  * \param maxNbNodes - maximum Nodes in a Leaf of the SMESH_OctreeNode constructed, default value is 5
  */
 //=============================
-void SMESH_OctreeNode::FindCoincidentNodes (set<const SMDS_MeshNode*> theSetOfNodes,
+void SMESH_OctreeNode::FindCoincidentNodes (set<const SMDS_MeshNode*>& theSetOfNodes,
                                             list< list< const SMDS_MeshNode*> >* theGroupsOfNodes,
                                             const double theTolerance,
                                             const int maxLevel,
                                             const int maxNbNodes)
 {
-  SMESH_OctreeNode* theOctreeNode = new SMESH_OctreeNode(theSetOfNodes, maxLevel, maxNbNodes, theTolerance);
-  theOctreeNode->FindCoincidentNodes (&theSetOfNodes, theTolerance, theGroupsOfNodes);
-  delete theOctreeNode;
+  SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel, maxNbNodes, theTolerance);
+  theOctreeNode.FindCoincidentNodes (&theSetOfNodes, theTolerance, theGroupsOfNodes);
 }
 
 //=============================
@@ -285,7 +325,7 @@ void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node,
   if (isInsideBool)
   {
     // I'm only looking in the leaves, since all the nodes are stored there.
-    if (myIsLeaf)
+    if (isLeaf())
     {
       gp_Pnt p1 (Node->X(), Node->Y(), Node->Z());
 
@@ -333,6 +373,43 @@ void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node,
   }
 }
 
+//================================================================================
+/*!
+ * \brief Update data according to node movement
+ */
+//================================================================================
+
+void SMESH_OctreeNode::UpdateByMoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt )
+{
+  if ( isLeaf() )
+  {
+    set<const SMDS_MeshNode*>::iterator pNode = myNodes.find( node );
+    bool nodeInMe = ( pNode != myNodes.end() );
+
+    SMDS_MeshNode pointNode( toPnt.X(), toPnt.Y(), toPnt.Z() );
+    bool pointInMe = isInside( &pointNode, 1e-10 );
+
+    if ( pointInMe != nodeInMe )
+    {
+      if ( pointInMe )
+        myNodes.insert( node );
+      else
+        myNodes.erase( node );
+    }
+  }
+  else if ( myChildren )
+  {
+    gp_XYZ mid = (getBox().CornerMin() + getBox().CornerMax()) / 2.;
+    int nodeChild  = getChildIndex( node->X(), node->Y(), node->Z(), mid );
+    int pointChild = getChildIndex( toPnt.X(), toPnt.Y(), toPnt.Z(), mid );
+    if ( nodeChild != pointChild )
+    {
+      ((SMESH_OctreeNode*) myChildren[ nodeChild  ])->UpdateByMoveNode( node, toPnt );
+      ((SMESH_OctreeNode*) myChildren[ pointChild ])->UpdateByMoveNode( node, toPnt );
+    }
+  }
+}
+
 //================================================================================
 /*!
  * \brief Return iterator over children
@@ -342,7 +419,7 @@ SMESH_OctreeNodeIteratorPtr SMESH_OctreeNode::GetChildrenIterator()
 {
   return SMESH_OctreeNodeIteratorPtr
     ( new SMDS_SetIterator< SMESH_OctreeNode*, SMESH_Octree** >
-      ( myChildren, ( isLeaf() ? myChildren : &myChildren[ 8 ] )));
+      ( myChildren, (( isLeaf() || !myChildren ) ? myChildren : &myChildren[ 8 ] )));
 }
 
 //================================================================================
@@ -354,5 +431,5 @@ SMDS_NodeIteratorPtr SMESH_OctreeNode::GetNodeIterator()
 {
   return SMDS_NodeIteratorPtr
     ( new SMDS_SetIterator< SMDS_pNode, set< SMDS_pNode >::const_iterator >
-      ( myNodes.begin(), myNodes.end() ));
+      ( myNodes.begin(), myNodes.size() ? myNodes.end() : myNodes.begin()));
 }
index 6a3b0cb39a1ec85b2d380995f55ad5f09f26e89e..7799765d0076a03d48cf88953eb02f34e7659df0 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <list>
 #include <set>
+#include <map>
 
 #include "SMDS_ElemIterator.hxx"
 
@@ -44,7 +45,7 @@ class SMESH_OctreeNode;
 typedef SMDS_Iterator<SMESH_OctreeNode*>            SMESH_OctreeNodeIterator;
 typedef boost::shared_ptr<SMESH_OctreeNodeIterator> SMESH_OctreeNodeIteratorPtr;
 
-class SMESH_OctreeNode : public SMESH_Octree{
+class SMESH_OctreeNode : public SMESH_Octree {
 
 public:
 
@@ -59,9 +60,6 @@ public:
 //=============================
   virtual ~SMESH_OctreeNode () {};
 
-  // Tells us if SMESH_OctreeNode is a leaf or not (-1 = not initialiazed)
-  virtual const bool isLeaf();
-
   // Tells us if Node is inside the current box with the precision "precision"
   virtual const bool isInside(const SMDS_MeshNode * Node, const double precision = 0.);
 
@@ -70,6 +68,11 @@ public:
                                  std::list<const SMDS_MeshNode*>* Result,
                                  const double precision = 0.);
 
+  // Return in dist2Nodes nodes mapped to their square distance from Node
+  bool               NodesAround(const SMDS_MeshNode *                   Node,
+                                 std::map<double, const SMDS_MeshNode*>& dist2Nodes,
+                                 double                                  precision);
+
   // Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance
   // Search for all the nodes in nodes
   void               FindCoincidentNodes ( std::set<const SMDS_MeshNode*>* nodes,
@@ -78,10 +81,15 @@ public:
 
   // Static method that return in theGroupsOfNodes a list of group of nodes close to each other within
   // theTolerance search for all the nodes in nodes
-  static void        FindCoincidentNodes ( std::set<const SMDS_MeshNode*> nodes,
+  static void        FindCoincidentNodes ( std::set<const SMDS_MeshNode*>& nodes,
                                            std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes,
-                                           const double theTolerance = 0.00001, const int maxLevel = -1,
+                                           const double theTolerance = 0.00001,
+                                           const int maxLevel = -1,
                                            const int maxNbNodes = 5);
+  /*!
+   * \brief Update data according to node movement
+   */
+  void                        UpdateByMoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt );
   /*!
    * \brief Return iterator over children
    */
@@ -93,25 +101,20 @@ public:
   /*!
    * \brief Return nb nodes in a tree
    */
-  int                         NbNodes() const { return myNbNodes; }
+  int                         NbNodes() const { return myNodes.size(); }
 
 protected:
 
-//=============================
-/*!
- * \brief Empty constructor
- */
-//=============================
-  SMESH_OctreeNode (){};
+  SMESH_OctreeNode (int maxNbNodes );
+
+  // Compute the bounding box of the whole set of nodes myNodes
+  virtual Bnd_B3d*      buildRootBox();
 
   // Shares the father's data with each of his child
   virtual void          buildChildrenData();
 
-  // Compute the bounding box of the whole set of nodes myNodes (only used for OctreeNode level 0)
-  void                  computeBoxForFather();
-
   // Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren()
-  virtual SMESH_Octree* allocateOctreeChild();
+  virtual SMESH_Octree* allocateOctreeChild() const;
 
   // Return in result a list of nodes closed to Node and remove it from SetOfNodes
   void                  FindCoincidentNodes( const SMDS_MeshNode * Node,
@@ -120,13 +123,11 @@ protected:
                                              const double precision);
 
   // The max number of nodes a leaf box can contain
-  int                         myMaxNbNodes;
+  int                              myMaxNbNodes;
 
   // The set of nodes inside the box of the Octree (Empty if Octree is not a leaf)
   std::set<const SMDS_MeshNode*>   myNodes;
 
-  // The number of nodes I have inside the box
-  int                         myNbNodes;
 };
 
 #endif
index ad59f98c97d069daa9a505525788684bf603ef3a..21d1675184e5ce3f911484c3b2308fab9430fe54 100644 (file)
@@ -82,22 +82,22 @@ SMESH_subMesh::SMESH_subMesh(int                  Id,
                              SMESHDS_Mesh *       meshDS,
                              const TopoDS_Shape & aSubShape)
 {
-       _subShape = aSubShape;
-       _subMeshDS = meshDS->MeshElements(_subShape);   // may be null ...
-       _father = father;
-       _Id = Id;
-       _dependenceAnalysed = _alwaysComputed = false;
-
-       if (_subShape.ShapeType() == TopAbs_VERTEX)
-       {
-               _algoState = HYP_OK;
-               _computeState = READY_TO_COMPUTE;
-       }
-       else
-       {
+        _subShape = aSubShape;
+        _subMeshDS = meshDS->MeshElements(_subShape);   // may be null ...
+        _father = father;
+        _Id = Id;
+        _dependenceAnalysed = _alwaysComputed = false;
+
+        if (_subShape.ShapeType() == TopAbs_VERTEX)
+        {
+                _algoState = HYP_OK;
+                _computeState = READY_TO_COMPUTE;
+        }
+        else
+        {
           _algoState = NO_ALGO;
           _computeState = NOT_READY;
-       }
+        }
 }
 
 //=============================================================================
@@ -392,7 +392,7 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn()
     }
   case TopAbs_COMPSOLID:
     {
-               //MESSAGE("compsolid");
+                //MESSAGE("compsolid");
       for (TopExp_Explorer exp(_subShape, TopAbs_SOLID); exp.More();
            exp.Next())
       {
@@ -448,7 +448,7 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn()
       for (TopExp_Explorer exp(_subShape, TopAbs_VERTEX); exp.More();
            exp.Next())
       {
-                       InsertDependence(exp.Current());
+                        InsertDependence(exp.Current());
                       }
       break;
     }
@@ -495,8 +495,8 @@ void SMESH_subMesh::InsertDependence(const TopoDS_Shape aSubShape)
 
 const TopoDS_Shape & SMESH_subMesh::GetSubShape() const
 {
-       //MESSAGE("SMESH_subMesh::GetSubShape");
-       return _subShape;
+        //MESSAGE("SMESH_subMesh::GetSubShape");
+        return _subShape;
 }
 
 
@@ -947,6 +947,12 @@ SMESH_Hypothesis::Hypothesis_Status
       break;
     }
     case REMOVE_FATHER_ALGO: {
+      // IPAL21346. Edges not removed when Netgen 1d-2d is removed from a SOLID.
+      // CLEAN was not called at event REMOVE_ALGO because the algo is not applicable to SOLID.
+      algo = dynamic_cast<SMESH_Algo*> (anHyp);
+      if (!algo->NeedDescretBoundary())
+        needFullClean = true;
+
       algo = gen->GetAlgo((*_father), _subShape);
       if (algo == NULL)  // no more applying algo on father
       {
@@ -1142,48 +1148,48 @@ void SMESH_subMesh::CleanDependsOn()
 
 void SMESH_subMesh::DumpAlgoState(bool isMain)
 {
-       int dim = SMESH_Gen::GetShapeDim(_subShape);
+        int dim = SMESH_Gen::GetShapeDim(_subShape);
 //   if (dim < 1) return;
-       if (isMain)
-       {
-               const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
-
-               map < int, SMESH_subMesh * >::const_iterator itsub;
-               for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
-               {
-                       SMESH_subMesh *sm = (*itsub).second;
-                       sm->DumpAlgoState(false);
-               }
-       }
-       int type = _subShape.ShapeType();
-       MESSAGE("dim = " << dim << " type of shape " << type);
-       switch (_algoState)
-       {
-       case NO_ALGO:
-               MESSAGE(" AlgoState = NO_ALGO");
-               break;
-       case MISSING_HYP:
-               MESSAGE(" AlgoState = MISSING_HYP");
-               break;
-       case HYP_OK:
-               MESSAGE(" AlgoState = HYP_OK");
-               break;
-       }
-       switch (_computeState)
-       {
-       case NOT_READY:
-               MESSAGE(" ComputeState = NOT_READY");
-               break;
-       case READY_TO_COMPUTE:
-               MESSAGE(" ComputeState = READY_TO_COMPUTE");
-               break;
-       case COMPUTE_OK:
-               MESSAGE(" ComputeState = COMPUTE_OK");
-               break;
-       case FAILED_TO_COMPUTE:
-               MESSAGE(" ComputeState = FAILED_TO_COMPUTE");
-               break;
-       }
+        if (isMain)
+        {
+                const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
+
+                map < int, SMESH_subMesh * >::const_iterator itsub;
+                for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
+                {
+                        SMESH_subMesh *sm = (*itsub).second;
+                        sm->DumpAlgoState(false);
+                }
+        }
+        int type = _subShape.ShapeType();
+        MESSAGE("dim = " << dim << " type of shape " << type);
+        switch (_algoState)
+        {
+        case NO_ALGO:
+                MESSAGE(" AlgoState = NO_ALGO");
+                break;
+        case MISSING_HYP:
+                MESSAGE(" AlgoState = MISSING_HYP");
+                break;
+        case HYP_OK:
+                MESSAGE(" AlgoState = HYP_OK");
+                break;
+        }
+        switch (_computeState)
+        {
+        case NOT_READY:
+                MESSAGE(" ComputeState = NOT_READY");
+                break;
+        case READY_TO_COMPUTE:
+                MESSAGE(" ComputeState = READY_TO_COMPUTE");
+                break;
+        case COMPUTE_OK:
+                MESSAGE(" ComputeState = COMPUTE_OK");
+                break;
+        case FAILED_TO_COMPUTE:
+                MESSAGE(" ComputeState = FAILED_TO_COMPUTE");
+                break;
+        }
 }
 
 //================================================================================
@@ -1278,13 +1284,13 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       if ( _algoState == HYP_OK )
         _computeState = READY_TO_COMPUTE;
       break;
-    case COMPUTE:              // nothing to do
+    case COMPUTE:               // nothing to do
       break;
     case CLEAN:
       CleanDependants();
       RemoveSubMeshElementsAndNodes();
       break;
-    case SUBMESH_COMPUTED:     // nothing to do
+    case SUBMESH_COMPUTED:      // nothing to do
       break;
     case SUBMESH_RESTORED:
       ComputeSubMeshStateEngine( SUBMESH_RESTORED );
index d4c0468f942dd8600297f5a9332a71dc435dd94a..3aaf987af75c48c885ddb0c7c3fa5685bf8bb6c7 100644 (file)
@@ -61,7 +61,7 @@ class SMESH_EXPORT SMESH_subMesh
 {
  public:
   SMESH_subMesh(int Id, SMESH_Mesh * father, SMESHDS_Mesh * meshDS,
-               const TopoDS_Shape & aSubShape);
+                const TopoDS_Shape & aSubShape);
   virtual ~ SMESH_subMesh();
 
   int GetId() const;
index a033961bc2f1d7522ec360011ccd7668238a55d5..7279ba932043b6e956350c586a6015735a5d89ce 100644 (file)
@@ -30,7 +30,6 @@
 
 enum SMESHDS_CommandType { 
   SMESHDS_AddNode,
-  SMESHDS_Add0DElement,
   SMESHDS_AddEdge,
   SMESHDS_AddTriangle,
   SMESHDS_AddQuadrangle,
@@ -54,7 +53,9 @@ enum SMESHDS_CommandType {
   SMESHDS_AddQuadTetrahedron,
   SMESHDS_AddQuadPyramid,
   SMESHDS_AddQuadPentahedron,
-  SMESHDS_AddQuadHexahedron
+  SMESHDS_AddQuadHexahedron,
+  // special type for 0D elements
+  SMESHDS_Add0DElement
 };
 
 
index ff27ae9153a2198bffc63f5e6cf5bbb92c07496d..34118b82907afab02291f4d9651c74a35fa22e27 100644 (file)
@@ -284,21 +284,21 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int ID)
 }
 
 SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2, 
-                                          int ID)
+                                           const SMDS_MeshNode * n2, 
+                                           int ID)
 {
   return AddEdgeWithID(n1->GetID(),
-                      n2->GetID(),
-                      ID);
+                       n2->GetID(),
+                       ID);
 }
 
 SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2)
+                                     const SMDS_MeshNode * n2)
 {
   SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdge(n1,n2);
   if(anElem) myScript->AddEdge(anElem->GetID(), 
-                              n1->GetID(), 
-                              n2->GetID());
+                               n1->GetID(), 
+                               n2->GetID());
   return anElem;
 }
 
@@ -314,25 +314,25 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int ID)
 }
 
 SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3, 
-                                          int ID)
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3, 
+                                           int ID)
 {
   return AddFaceWithID(n1->GetID(),
-                      n2->GetID(),
-                      n3->GetID(),
-                      ID);
+                       n2->GetID(),
+                       n3->GetID(),
+                       ID);
 }
 
 SMDS_MeshFace* SMESHDS_Mesh::AddFace( const SMDS_MeshNode * n1,
-                                     const SMDS_MeshNode * n2,
-                                     const SMDS_MeshNode * n3)
+                                      const SMDS_MeshNode * n2,
+                                      const SMDS_MeshNode * n3)
 {
   SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1, n2, n3);
   if(anElem) myScript->AddFace(anElem->GetID(), 
-                              n1->GetID(), 
-                              n2->GetID(),
-                              n3->GetID());
+                               n1->GetID(), 
+                               n2->GetID(),
+                               n3->GetID());
   return anElem;
 }
 
@@ -348,29 +348,29 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, int I
 }
 
 SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4, 
-                                          int ID)
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4, 
+                                           int ID)
 {
   return AddFaceWithID(n1->GetID(),
-                      n2->GetID(),
-                      n3->GetID(),
-                      n4->GetID(),
-                      ID);
+                       n2->GetID(),
+                       n3->GetID(),
+                       n4->GetID(),
+                       ID);
 }
 
 SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4)
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4)
 {
   SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1, n2, n3, n4);
   if(anElem) myScript->AddFace(anElem->GetID(), 
-                              n1->GetID(), 
-                              n2->GetID(), 
-                              n3->GetID(),
-                              n4->GetID());
+                               n1->GetID(), 
+                               n2->GetID(), 
+                               n3->GetID(),
+                               n4->GetID());
   return anElem;
 }
 
@@ -386,29 +386,29 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, i
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
-                                              const SMDS_MeshNode * n2,
-                                              const SMDS_MeshNode * n3,
-                                              const SMDS_MeshNode * n4, 
-                                              int ID)
+                                               const SMDS_MeshNode * n2,
+                                               const SMDS_MeshNode * n3,
+                                               const SMDS_MeshNode * n4, 
+                                               int ID)
 {
   return AddVolumeWithID(n1->GetID(), 
-                        n2->GetID(), 
-                        n3->GetID(),
-                        n4->GetID(),
-                        ID);
+                         n2->GetID(), 
+                         n3->GetID(),
+                         n4->GetID(),
+                         ID);
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
-                                        const SMDS_MeshNode * n2,
-                                        const SMDS_MeshNode * n3,
-                                        const SMDS_MeshNode * n4)
+                                         const SMDS_MeshNode * n2,
+                                         const SMDS_MeshNode * n3,
+                                         const SMDS_MeshNode * n4)
 {
   SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4);
   if(anElem) myScript->AddVolume(anElem->GetID(), 
-                                n1->GetID(), 
-                                n2->GetID(), 
-                                n3->GetID(),
-                                n4->GetID());
+                                 n1->GetID(), 
+                                 n2->GetID(), 
+                                 n3->GetID(),
+                                 n4->GetID());
   return anElem;
 }
 
@@ -424,33 +424,33 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, i
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
-                                              const SMDS_MeshNode * n2,
-                                              const SMDS_MeshNode * n3,
-                                              const SMDS_MeshNode * n4,
-                                              const SMDS_MeshNode * n5, 
-                                              int ID)
+                                               const SMDS_MeshNode * n2,
+                                               const SMDS_MeshNode * n3,
+                                               const SMDS_MeshNode * n4,
+                                               const SMDS_MeshNode * n5, 
+                                               int ID)
 {
   return AddVolumeWithID(n1->GetID(), 
-                        n2->GetID(), 
-                        n3->GetID(),
-                        n4->GetID(), 
-                        n5->GetID(),
-                        ID);
+                         n2->GetID(), 
+                         n3->GetID(),
+                         n4->GetID(), 
+                         n5->GetID(),
+                         ID);
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
-                                        const SMDS_MeshNode * n2,
-                                        const SMDS_MeshNode * n3,
-                                        const SMDS_MeshNode * n4,
-                                        const SMDS_MeshNode * n5)
+                                         const SMDS_MeshNode * n2,
+                                         const SMDS_MeshNode * n3,
+                                         const SMDS_MeshNode * n4,
+                                         const SMDS_MeshNode * n5)
 {
   SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5);
   if(anElem) myScript->AddVolume(anElem->GetID(), 
-                                n1->GetID(), 
-                                n2->GetID(), 
-                                n3->GetID(),
-                                n4->GetID(), 
-                                n5->GetID());
+                                 n1->GetID(), 
+                                 n2->GetID(), 
+                                 n3->GetID(),
+                                 n4->GetID(), 
+                                 n5->GetID());
   return anElem;
 }
 
@@ -466,37 +466,37 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, i
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
-                                              const SMDS_MeshNode * n2,
-                                              const SMDS_MeshNode * n3,
-                                              const SMDS_MeshNode * n4,
-                                              const SMDS_MeshNode * n5,
-                                              const SMDS_MeshNode * n6, 
-                                              int ID)
+                                               const SMDS_MeshNode * n2,
+                                               const SMDS_MeshNode * n3,
+                                               const SMDS_MeshNode * n4,
+                                               const SMDS_MeshNode * n5,
+                                               const SMDS_MeshNode * n6, 
+                                               int ID)
 {
   return AddVolumeWithID(n1->GetID(), 
-                        n2->GetID(), 
-                        n3->GetID(),
-                        n4->GetID(), 
-                        n5->GetID(), 
-                        n6->GetID(),
-                        ID);
+                         n2->GetID(), 
+                         n3->GetID(),
+                         n4->GetID(), 
+                         n5->GetID(), 
+                         n6->GetID(),
+                         ID);
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
-                                        const SMDS_MeshNode * n2,
-                                        const SMDS_MeshNode * n3,
-                                        const SMDS_MeshNode * n4,
-                                        const SMDS_MeshNode * n5,
-                                        const SMDS_MeshNode * n6)
+                                         const SMDS_MeshNode * n2,
+                                         const SMDS_MeshNode * n3,
+                                         const SMDS_MeshNode * n4,
+                                         const SMDS_MeshNode * n5,
+                                         const SMDS_MeshNode * n6)
 {
   SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5, n6);
   if(anElem) myScript->AddVolume(anElem->GetID(), 
-                                n1->GetID(), 
-                                n2->GetID(), 
-                                n3->GetID(),
-                                n4->GetID(), 
-                                n5->GetID(), 
-                                n6->GetID());
+                                 n1->GetID(), 
+                                 n2->GetID(), 
+                                 n3->GetID(),
+                                 n4->GetID(), 
+                                 n5->GetID(), 
+                                 n6->GetID());
   return anElem;
 }
 
@@ -512,45 +512,45 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, i
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
-                                              const SMDS_MeshNode * n2,
-                                              const SMDS_MeshNode * n3,
-                                              const SMDS_MeshNode * n4,
-                                              const SMDS_MeshNode * n5,
-                                              const SMDS_MeshNode * n6,
-                                              const SMDS_MeshNode * n7,
-                                              const SMDS_MeshNode * n8, 
-                                              int ID)
+                                               const SMDS_MeshNode * n2,
+                                               const SMDS_MeshNode * n3,
+                                               const SMDS_MeshNode * n4,
+                                               const SMDS_MeshNode * n5,
+                                               const SMDS_MeshNode * n6,
+                                               const SMDS_MeshNode * n7,
+                                               const SMDS_MeshNode * n8, 
+                                               int ID)
 {
   return AddVolumeWithID(n1->GetID(), 
-                        n2->GetID(), 
-                        n3->GetID(),
-                        n4->GetID(), 
-                        n5->GetID(), 
-                        n6->GetID(), 
-                        n7->GetID(), 
-                        n8->GetID(),
-                        ID);
+                         n2->GetID(), 
+                         n3->GetID(),
+                         n4->GetID(), 
+                         n5->GetID(), 
+                         n6->GetID(), 
+                         n7->GetID(), 
+                         n8->GetID(),
+                         ID);
 }
 
 SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
-                                        const SMDS_MeshNode * n2,
-                                        const SMDS_MeshNode * n3,
-                                        const SMDS_MeshNode * n4,
-                                        const SMDS_MeshNode * n5,
-                                        const SMDS_MeshNode * n6,
-                                        const SMDS_MeshNode * n7,
-                                        const SMDS_MeshNode * n8)
+                                         const SMDS_MeshNode * n2,
+                                         const SMDS_MeshNode * n3,
+                                         const SMDS_MeshNode * n4,
+                                         const SMDS_MeshNode * n5,
+                                         const SMDS_MeshNode * n6,
+                                         const SMDS_MeshNode * n7,
+                                         const SMDS_MeshNode * n8)
 {
   SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
   if(anElem) myScript->AddVolume(anElem->GetID(), 
-                                n1->GetID(), 
-                                n2->GetID(), 
-                                n3->GetID(),
-                                n4->GetID(), 
-                                n5->GetID(), 
-                                n6->GetID(), 
-                                n7->GetID(), 
-                                n8->GetID());
+                                 n1->GetID(), 
+                                 n2->GetID(), 
+                                 n3->GetID(),
+                                 n4->GetID(), 
+                                 n5->GetID(), 
+                                 n6->GetID(), 
+                                 n7->GetID(), 
+                                 n8->GetID());
   return anElem;
 }
 
@@ -1059,7 +1059,7 @@ void SMESHDS_Mesh::UnSetMeshElementOnShape(const SMDS_MeshElement * elem,
 //=======================================================================
 TopoDS_Shape SMESHDS_Mesh::ShapeToMesh() const
 {
-       return myShape;
+        return myShape;
 }
 
 //=======================================================================
@@ -1143,7 +1143,7 @@ SMESHDS_Mesh::GetHypothesis(const TopoDS_Shape & S) const
 //=======================================================================
 SMESHDS_Script* SMESHDS_Mesh::GetScript()
 {
-       return myScript;
+        return myScript;
 }
 
 //=======================================================================
@@ -1152,7 +1152,7 @@ SMESHDS_Script* SMESHDS_Mesh::GetScript()
 //=======================================================================
 void SMESHDS_Mesh::ClearScript()
 {
-       myScript->Clear();
+        myScript->Clear();
 }
 
 //=======================================================================
@@ -1161,9 +1161,9 @@ void SMESHDS_Mesh::ClearScript()
 //=======================================================================
 bool SMESHDS_Mesh::HasMeshElements(const TopoDS_Shape & S)
 {
-       if (myShape.IsNull()) MESSAGE("myShape is NULL");
-       int Index = myIndexToShape.FindIndex(S);
-       return myShapeIndexToSubMesh.find(Index)!=myShapeIndexToSubMesh.end();
+        if (myShape.IsNull()) MESSAGE("myShape is NULL");
+        int Index = myIndexToShape.FindIndex(S);
+        return myShapeIndexToSubMesh.find(Index)!=myShapeIndexToSubMesh.end();
 }
 
 //=======================================================================
@@ -1235,7 +1235,7 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S,
 //=======================================================================
 const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const
 {
-       return myIndexToShape.FindKey(ShapeIndex);
+        return myIndexToShape.FindKey(ShapeIndex);
 }
 
 //=======================================================================
@@ -1351,8 +1351,8 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode* n1,
 {
   SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdge(n1,n2,n12);
   if(anElem) myScript->AddEdge(anElem->GetID(), 
-                              n1->GetID(), 
-                              n2->GetID(),
+                               n1->GetID(), 
+                               n2->GetID(),
                                n12->GetID());
   return anElem;
 }
@@ -1367,9 +1367,9 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
                                            int ID)
 {
   return AddEdgeWithID(n1->GetID(),
-                      n2->GetID(),
+                       n2->GetID(),
                        n12->GetID(),
-                      ID);
+                       ID);
 }
 
 
@@ -1386,7 +1386,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
 {
   SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n12,n23,n31);
   if(anElem) myScript->AddFace(anElem->GetID(), 
-                              n1->GetID(), n2->GetID(), n3->GetID(),
+                               n1->GetID(), n2->GetID(), n3->GetID(),
                                n12->GetID(), n23->GetID(), n31->GetID());
   return anElem;
 }
@@ -1417,7 +1417,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
 {
   return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
                        n12->GetID(), n23->GetID(), n31->GetID(),
-                      ID);
+                       ID);
 }
 
 
@@ -1436,7 +1436,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
 {
   SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n4,n12,n23,n34,n41);
   if(anElem) myScript->AddFace(anElem->GetID(), 
-                              n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
+                               n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                                n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID());
   return anElem;
 }
@@ -1469,7 +1469,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
 {
   return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                        n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
-                      ID);
+                       ID);
 }
 
 
@@ -1490,8 +1490,8 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
 {
   SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n12,n23,n31,n14,n24,n34);
   if(anElem) myScript->AddVolume(anElem->GetID(), 
-                                n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
-                                n12->GetID(), n23->GetID(), n31->GetID(),
+                                 n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
+                                 n12->GetID(), n23->GetID(), n31->GetID(),
                                  n14->GetID(), n24->GetID(), n34->GetID());
   return anElem;
 }
@@ -1509,7 +1509,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
   if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n12,n23,n31,n14,n24,n34);
   return anElem;
 }
-       
+        
 //=======================================================================
 //function : AddVolumeWithID
 //purpose  : 2d order tetrahedron of 10 nodes
@@ -1575,7 +1575,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, i
                                  n15,n25,n35,n45);
   return anElem;
 }
-       
+        
 //=======================================================================
 //function : AddVolumeWithID
 //purpose  : 2d order pyramid of 13 nodes
@@ -1652,7 +1652,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
                                  n45,n56,n64,n14,n25,n36);
   return anElem;
 }
-       
+        
 //=======================================================================
 //function : AddVolumeWithID
 //purpose  : 2d order Pentahedron with 15 nodes
@@ -1740,7 +1740,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
                                  n56,n67,n78,n85,n15,n26,n37,n48);
   return anElem;
 }
-       
+        
 //=======================================================================
 //function : AddVolumeWithID
 //purpose  : 2d order Hexahedrons with 20 nodes
index 4c1398fef9a982bd7fdd9bc9cd272dd3f42c1c07..116deb607081194435817d4c2b8cfb289ac614f0 100644 (file)
@@ -75,156 +75,156 @@ public:
   
   virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID);
   virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2, 
-                                      int ID);
+                                       const SMDS_MeshNode * n2, 
+                                       int ID);
   virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2);
+                                 const SMDS_MeshNode * n2);
   
   // 2d order edge with 3 nodes: n12 - node between n1 and n2
   virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID);
   virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2, 
-                                      const SMDS_MeshNode * n12, 
-                                      int ID);
+                                       const SMDS_MeshNode * n2, 
+                                       const SMDS_MeshNode * n12, 
+                                       int ID);
   virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
                                  const SMDS_MeshNode * n2,
                                  const SMDS_MeshNode * n12);
 
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3, 
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3, 
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3);
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3);
 
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3,
-                                      const SMDS_MeshNode * n4, 
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3,
+                                       const SMDS_MeshNode * n4, 
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3,
-                                const SMDS_MeshNode * n4);
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n4);
 
   // 2d order triangle of 6 nodes
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
                                        int n12,int n23,int n31, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3, 
-                                      const SMDS_MeshNode * n12,
-                                      const SMDS_MeshNode * n23,
-                                      const SMDS_MeshNode * n31, 
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3, 
+                                       const SMDS_MeshNode * n12,
+                                       const SMDS_MeshNode * n23,
+                                       const SMDS_MeshNode * n31, 
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
                                  const SMDS_MeshNode * n12,
-                                const SMDS_MeshNode * n23,
-                                const SMDS_MeshNode * n31);
+                                 const SMDS_MeshNode * n23,
+                                 const SMDS_MeshNode * n31);
 
   // 2d order quadrangle
   virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
                                        int n12,int n23,int n34,int n41, int ID);
   virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
-                                      const SMDS_MeshNode * n2,
-                                      const SMDS_MeshNode * n3,
-                                      const SMDS_MeshNode * n4, 
-                                      const SMDS_MeshNode * n12,
-                                      const SMDS_MeshNode * n23,
-                                      const SMDS_MeshNode * n34,
-                                      const SMDS_MeshNode * n41, 
-                                      int ID);
+                                       const SMDS_MeshNode * n2,
+                                       const SMDS_MeshNode * n3,
+                                       const SMDS_MeshNode * n4, 
+                                       const SMDS_MeshNode * n12,
+                                       const SMDS_MeshNode * n23,
+                                       const SMDS_MeshNode * n34,
+                                       const SMDS_MeshNode * n41, 
+                                       int ID);
   virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
-                                const SMDS_MeshNode * n2,
-                                const SMDS_MeshNode * n3,
-                                const SMDS_MeshNode * n4,
+                                 const SMDS_MeshNode * n2,
+                                 const SMDS_MeshNode * n3,
+                                 const SMDS_MeshNode * n4,
                                  const SMDS_MeshNode * n12,
-                                const SMDS_MeshNode * n23,
-                                const SMDS_MeshNode * n34,
-                                const SMDS_MeshNode * n41);
+                                 const SMDS_MeshNode * n23,
+                                 const SMDS_MeshNode * n34,
+                                 const SMDS_MeshNode * n41);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6);
 
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6,
-                                          const SMDS_MeshNode * n7,
-                                          const SMDS_MeshNode * n8, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6,
+                                           const SMDS_MeshNode * n7,
+                                           const SMDS_MeshNode * n8, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6,
-                                    const SMDS_MeshNode * n7,
-                                    const SMDS_MeshNode * n8);
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6,
+                                     const SMDS_MeshNode * n7,
+                                     const SMDS_MeshNode * n8);
   
   // 2d order tetrahedron of 10 nodes
   virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
                                            int n12,int n23,int n31,
                                            int n14,int n24,int n34, int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4, 
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n31,
-                                          const SMDS_MeshNode * n14, 
-                                          const SMDS_MeshNode * n24,
-                                          const SMDS_MeshNode * n34, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4, 
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n31,
+                                           const SMDS_MeshNode * n14, 
+                                           const SMDS_MeshNode * n24,
+                                           const SMDS_MeshNode * n34, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n31,
@@ -238,24 +238,24 @@ public:
                                            int n15,int n25,int n35,int n45,
                                            int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5, 
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n34,
-                                          const SMDS_MeshNode * n41, 
-                                          const SMDS_MeshNode * n15,
-                                          const SMDS_MeshNode * n25,
-                                          const SMDS_MeshNode * n35,
-                                          const SMDS_MeshNode * n45, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5, 
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n34,
+                                           const SMDS_MeshNode * n41, 
+                                           const SMDS_MeshNode * n15,
+                                           const SMDS_MeshNode * n25,
+                                           const SMDS_MeshNode * n35,
+                                           const SMDS_MeshNode * n45, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n34,
@@ -273,27 +273,27 @@ public:
                                            int n14,int n25,int n36,
                                            int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6, 
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n31, 
-                                          const SMDS_MeshNode * n45,
-                                          const SMDS_MeshNode * n56,
-                                          const SMDS_MeshNode * n64, 
-                                          const SMDS_MeshNode * n14,
-                                          const SMDS_MeshNode * n25,
-                                          const SMDS_MeshNode * n36, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6, 
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n31, 
+                                           const SMDS_MeshNode * n45,
+                                           const SMDS_MeshNode * n56,
+                                           const SMDS_MeshNode * n64, 
+                                           const SMDS_MeshNode * n14,
+                                           const SMDS_MeshNode * n25,
+                                           const SMDS_MeshNode * n36, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6, 
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6, 
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n31, 
@@ -312,34 +312,34 @@ public:
                                            int n15,int n26,int n37,int n48,
                                            int ID);
   virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
-                                          const SMDS_MeshNode * n2,
-                                          const SMDS_MeshNode * n3,
-                                          const SMDS_MeshNode * n4,
-                                          const SMDS_MeshNode * n5,
-                                          const SMDS_MeshNode * n6,
-                                          const SMDS_MeshNode * n7,
-                                          const SMDS_MeshNode * n8, 
-                                          const SMDS_MeshNode * n12,
-                                          const SMDS_MeshNode * n23,
-                                          const SMDS_MeshNode * n34,
-                                          const SMDS_MeshNode * n41, 
-                                          const SMDS_MeshNode * n56,
-                                          const SMDS_MeshNode * n67,
-                                          const SMDS_MeshNode * n78,
-                                          const SMDS_MeshNode * n85, 
-                                          const SMDS_MeshNode * n15,
-                                          const SMDS_MeshNode * n26,
-                                          const SMDS_MeshNode * n37,
-                                          const SMDS_MeshNode * n48, 
-                                          int ID);
+                                           const SMDS_MeshNode * n2,
+                                           const SMDS_MeshNode * n3,
+                                           const SMDS_MeshNode * n4,
+                                           const SMDS_MeshNode * n5,
+                                           const SMDS_MeshNode * n6,
+                                           const SMDS_MeshNode * n7,
+                                           const SMDS_MeshNode * n8, 
+                                           const SMDS_MeshNode * n12,
+                                           const SMDS_MeshNode * n23,
+                                           const SMDS_MeshNode * n34,
+                                           const SMDS_MeshNode * n41, 
+                                           const SMDS_MeshNode * n56,
+                                           const SMDS_MeshNode * n67,
+                                           const SMDS_MeshNode * n78,
+                                           const SMDS_MeshNode * n85, 
+                                           const SMDS_MeshNode * n15,
+                                           const SMDS_MeshNode * n26,
+                                           const SMDS_MeshNode * n37,
+                                           const SMDS_MeshNode * n48, 
+                                           int ID);
   virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
-                                    const SMDS_MeshNode * n2,
-                                    const SMDS_MeshNode * n3,
-                                    const SMDS_MeshNode * n4,
-                                    const SMDS_MeshNode * n5,
-                                    const SMDS_MeshNode * n6,
-                                    const SMDS_MeshNode * n7,
-                                    const SMDS_MeshNode * n8, 
+                                     const SMDS_MeshNode * n2,
+                                     const SMDS_MeshNode * n3,
+                                     const SMDS_MeshNode * n4,
+                                     const SMDS_MeshNode * n5,
+                                     const SMDS_MeshNode * n6,
+                                     const SMDS_MeshNode * n7,
+                                     const SMDS_MeshNode * n8, 
                                      const SMDS_MeshNode * n12,
                                      const SMDS_MeshNode * n23,
                                      const SMDS_MeshNode * n34,
@@ -405,9 +405,9 @@ public:
   void SetNodeOnVertex(SMDS_MeshNode * aNode, const TopoDS_Vertex & S);
   void UnSetNodeOnShape(const SMDS_MeshNode * aNode);
   void SetMeshElementOnShape(const SMDS_MeshElement * anElt,
-                            const TopoDS_Shape & S);
+                             const TopoDS_Shape & S);
   void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt,
-                              const TopoDS_Shape & S);
+                               const TopoDS_Shape & S);
   bool HasMeshElements(const TopoDS_Shape & S);
   SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const;
   SMESHDS_SubMesh * MeshElements(const int Index);
index 94559f0989e455a833e3ba71584806e68ef411f0..1b278b946e70a226869b4b8072c4ce196139c810 100644 (file)
@@ -91,6 +91,7 @@ salomeinclude_HEADERS = \
        SMESHGUI_MeshEditPreview.h \
        SMESHGUI_IdValidator.h \
        SMESHGUI_MeshInfosBox.h \
+       SMESHGUI_Make2DFrom3DOp.h \
        SMESH_SMESHGUI.hxx
 
 # Libraries targets
@@ -159,7 +160,8 @@ dist_libSMESH_la_SOURCES = \
        SMESHGUI_MeshEditPreview.cxx \
        SMESHGUI_GroupOnShapeDlg.cxx \
        SMESHGUI_FileInfoDlg.cxx \
-       SMESHGUI_MeshInfosBox.cxx
+       SMESHGUI_MeshInfosBox.cxx \
+       SMESHGUI_Make2DFrom3DOp.cxx
 
 MOC_FILES = \
        SMESHGUI_moc.cxx \
@@ -212,7 +214,8 @@ MOC_FILES = \
        SMESHGUI_MakeNodeAtPointDlg_moc.cxx \
        SMESHGUI_GroupOnShapeDlg_moc.cxx \
        SMESHGUI_FileInfoDlg_moc.cxx \
-       SMESHGUI_MeshInfosBox_moc.cxx
+       SMESHGUI_MeshInfosBox_moc.cxx \
+       SMESHGUI_Make2DFrom3DOp_moc.cxx
 
 nodist_libSMESH_la_SOURCES= \
        $(MOC_FILES)
index 26e1de4dba9bfd21872ee9cbbb288c69c6ac6f1b..10e2d8820976b0972dd28381ac3be3523d3a4904 100644 (file)
@@ -67,6 +67,7 @@
 #include "SMESHGUI_BuildCompoundDlg.h"
 #include "SMESHGUI_ComputeDlg.h"
 #include "SMESHGUI_FileInfoDlg.h"
+#include "SMESHGUI_Make2DFrom3DOp.h"
 
 #include "SMESHGUI_Utils.h"
 #include "SMESHGUI_MeshUtils.h"
 #include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
 
 // Qt includes
-// #define      INCLUDE_MENUITEM_DEF // VSR commented ????????
+// #define       INCLUDE_MENUITEM_DEF // VSR commented ????????
 #include <QMenu>
 
 // BOOST includes
   // Declarations
   //=============================================================
   void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh,
-                           int theCommandID);
+                            int theCommandID);
 
   void ExportMeshToFile(int theCommandID);
 
   // Definitions
   //=============================================================
   void ImportMeshesFromFile( SMESH::SMESH_Gen_ptr theComponentMesh,
-                            int theCommandID )
+                             int theCommandID )
   {
     QStringList filter;
     std::string myExtension;
       anInitialPath = QDir::currentPath();
 
     QStringList filenames = SUIT_FileDlg::getOpenFileNames( SMESHGUI::desktop(),
-                                                           anInitialPath,
-                                                           filter,
-                                                           QObject::tr( "SMESH_IMPORT_MESH" ) );
+                                                            anInitialPath,
+                                                            filter,
+                                                            QObject::tr( "SMESH_IMPORT_MESH" ) );
     if ( filenames.count() > 0 ) {
       SUIT_OverrideCursor wc;
       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
       QStringList errors;
       bool isEmpty = false;
       for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
-       QString filename = *it;
-       SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
-       try {
-         switch ( theCommandID ) {
-         case 111:
-           {
-             // DAT format (currently unsupported)
-             errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                            arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) );
-             break;
-           }
-         case 112:
-           {
-             // UNV format
-             aMeshes->length( 1 );
-             aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.toLatin1().constData() );
-             if ( aMeshes[0]->_is_nil() )
-               errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                              arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
-             break;
-           }
-         case 113:
-           {
-             // MED format
-             SMESH::DriverMED_ReadStatus res;
-             aMeshes = theComponentMesh->CreateMeshesFromMED( filename.toLatin1().constData(), res );
-             if ( res != SMESH::DRS_OK ) {
-               errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                              arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) );
-             }
-             break;
-           }
-         }
-       }
-       catch ( const SALOME::SALOME_Exception& S_ex ) {
-         errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                        arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
-       }
-
-       for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
-         _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
-         if ( aMeshSO ) {
-           _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
-           _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
-           aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
-           if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
-             SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
-         }
-         else {
-           isEmpty = true;
-         }
-       }
+        QString filename = *it;
+        SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
+        try {
+          switch ( theCommandID ) {
+          case 111:
+            {
+              // DAT format (currently unsupported)
+              errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                             arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) );
+              break;
+            }
+          case 112:
+            {
+              // UNV format
+              aMeshes->length( 1 );
+              aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.toLatin1().constData() );
+              if ( aMeshes[0]->_is_nil() )
+                errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                               arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+              break;
+            }
+          case 113:
+            {
+              // MED format
+              SMESH::DriverMED_ReadStatus res;
+              aMeshes = theComponentMesh->CreateMeshesFromMED( filename.toLatin1().constData(), res );
+              if ( res != SMESH::DRS_OK ) {
+                errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                               arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) );
+              }
+              break;
+            }
+          }
+        }
+        catch ( const SALOME::SALOME_Exception& S_ex ) {
+          errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                         arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+        }
+
+        for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
+          _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
+          if ( aMeshSO ) {
+            _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+            _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
+            aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
+            if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
+              SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
+          }
+          else {
+            isEmpty = true;
+          }
+        }
       }
 
       // update Object browser
 
       // show Error message box if there were errors
       if ( errors.count() > 0 ) {
-       SUIT_MessageBox::critical( SMESHGUI::desktop(),
-                                  QObject::tr( "SMESH_ERROR" ),
-                                  QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+        SUIT_MessageBox::critical( SMESHGUI::desktop(),
+                                   QObject::tr( "SMESH_ERROR" ),
+                                   QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
       }
 
       // show warning message box, if some imported mesh is empty
       if ( isEmpty ) {
-         SUIT_MessageBox::warning( SMESHGUI::desktop(),
-                                   QObject::tr( "SMESH_WRN_WARNING" ),
-                                   QObject::tr( "SMESH_DRS_SOME_EMPTY" ) );
+          SUIT_MessageBox::warning( SMESHGUI::desktop(),
+                                    QObject::tr( "SMESH_WRN_WARNING" ),
+                                    QObject::tr( "SMESH_DRS_SOME_EMPTY" ) );
       }
     }
   }
   }
 
   inline void InverseEntityMode(unsigned int& theOutputMode,
-                               unsigned int theMode)
+                                unsigned int theMode)
   {
     bool anIsNotPresent = ~theOutputMode & theMode;
     if(anIsNotPresent)
     if(selected.Extent() >= 1){
       SALOME_ListIteratorOfListIO It( selected );
       for( ; It.More(); It.Next()){
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       if(IObject->hasEntry()){
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
-           unsigned int aMode = anActor->GetEntityMode();
-           switch(theCommandID){
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        if(IObject->hasEntry()){
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
+            unsigned int aMode = anActor->GetEntityMode();
+            switch(theCommandID){
             case 216:
               InverseEntityMode(aMode,SMESH_Actor::e0DElements);
               break;
-           case 217:
-             InverseEntityMode(aMode,SMESH_Actor::eEdges);
-             break;
-           case 218:
-             InverseEntityMode(aMode,SMESH_Actor::eFaces);
-             break;
-           case 219:
-             InverseEntityMode(aMode,SMESH_Actor::eVolumes);
-             break;
-           case 220:
-             aMode = SMESH_Actor::eAllEntity;
-             break;
-           }
-           if(aMode)
-             anActor->SetEntityMode(aMode);
-         }
-       }
+            case 217:
+              InverseEntityMode(aMode,SMESH_Actor::eEdges);
+              break;
+            case 218:
+              InverseEntityMode(aMode,SMESH_Actor::eFaces);
+              break;
+            case 219:
+              InverseEntityMode(aMode,SMESH_Actor::eVolumes);
+              break;
+            case 220:
+              aMode = SMESH_Actor::eAllEntity;
+              break;
+            }
+            if(aMode)
+              anActor->SetEntityMode(aMode);
+          }
+        }
       }
     }
   }
       _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
       if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str()))
       {
-       if( aGroupObject->GetType() == SMESH::NODE )
-         anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
-       else if( aGroupObject->GetType() == SMESH::EDGE )
-         anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
-       else
-         anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+        if( aGroupObject->GetType() == SMESH::NODE )
+          anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
+        else if( aGroupObject->GetType() == SMESH::EDGE )
+          anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+        else
+          anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
       }
     }
 
       Handle(SALOME_InteractiveObject) anIObject = selected.First();
       SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
       if ( !aMesh->_is_nil() ) {
-       aMesh->SetAutoColor( false );
+        aMesh->SetAutoColor( false );
       }
     }
   }
     if(selected.Extent() >= 1){
       switch(theCommandID){
       case 1134:{
-       SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
-       (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show();
-       return;
+        SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+        (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show();
+        return;
       }
       case 1133:{
-       SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
-       (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show();
-       return;
+        SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+        (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show();
+        return;
       }}
       SALOME_ListIteratorOfListIO It( selected );
       for( ; It.More(); It.Next()){
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       if(IObject->hasEntry()){
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
-           switch(theCommandID){
-           case 211:
-             anActor->SetRepresentation(SMESH_Actor::eEdge);
-             break;
-           case 212:
-             anActor->SetRepresentation(SMESH_Actor::eSurface);
-             break;
-           case 213:
-             if(anActor->IsShrunk())
-               anActor->UnShrink();
-             else
-               anActor->SetShrink();
-             break;
-           case 215:
-             anActor->SetRepresentation(SMESH_Actor::ePoint);
-             break;
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        if(IObject->hasEntry()){
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
+            switch(theCommandID){
+            case 211:
+              anActor->SetRepresentation(SMESH_Actor::eEdge);
+              break;
+            case 212:
+              anActor->SetRepresentation(SMESH_Actor::eSurface);
+              break;
+            case 213:
+              if(anActor->IsShrunk())
+                anActor->UnShrink();
+              else
+                anActor->SetShrink();
+              break;
+            case 215:
+              anActor->SetRepresentation(SMESH_Actor::ePoint);
+              break;
             case 231:
               if(anActor->GetQuadratic2DRepresentation() != SMESH_Actor::eLines)
                 anActor->SetQuadratic2DRepresentation(SMESH_Actor::eLines);
               if(anActor->GetQuadratic2DRepresentation() != SMESH_Actor::eArcs)
                 anActor->SetQuadratic2DRepresentation(SMESH_Actor::eArcs);
               break;
-           case 1132:{
-             vtkFloatingPointType color[3];
-             anActor->GetSufaceColor(color[0], color[1], color[2]);
-             int c0 = int (color[0] * 255);
-             int c1 = int (color[1] * 255);
-             int c2 = int (color[2] * 255);
-             QColor c(c0, c1, c2);
-
-             vtkFloatingPointType edgecolor[3];
-             anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]);
-             c0 = int (edgecolor[0] * 255);
-             c1 = int (edgecolor[1] * 255);
-             c2 = int (edgecolor[2] * 255);
-             QColor e(c0, c1, c2);
-
-             vtkFloatingPointType backfacecolor[3];
-             anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
-             c0 = int (backfacecolor[0] * 255);
-             c1 = int (backfacecolor[1] * 255);
-             c2 = int (backfacecolor[2] * 255);
-             QColor b(c0, c1, c2);
-
-             vtkFloatingPointType nodecolor[3];
-             anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
-             c0 = int (nodecolor[0] * 255);
-             c1 = int (nodecolor[1] * 255);
-             c2 = int (nodecolor[2] * 255);
-             QColor n(c0, c1, c2);
-
-             int Edgewidth = (int)anActor->GetLineWidth();
-             if(Edgewidth == 0)
-               Edgewidth = 1;
-             int intValue = int(anActor->GetNodeSize());
-             vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
-
-             SMESHGUI_Preferences_ColorDlg *aDlg =
-               new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
-             aDlg->SetColor(1, c);
-             aDlg->SetColor(2, e);
-             aDlg->SetColor(3, n);
-             aDlg->SetColor(4, b);
-             aDlg->SetIntValue(1, Edgewidth);
-             aDlg->SetIntValue(2, intValue);
-             aDlg->SetIntValue(3, int(Shrink*100.));
-             if(aDlg->exec()){
-               QColor color = aDlg->GetColor(1);
-               QColor edgecolor = aDlg->GetColor(2);
-               QColor nodecolor = aDlg->GetColor(3);
-               QColor backfacecolor = aDlg->GetColor(4);
-               /* actor color and backface color */
-               anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
-                                       vtkFloatingPointType (color.green()) / 255.,
-                                       vtkFloatingPointType (color.blue()) / 255.);
-               anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
-                                           vtkFloatingPointType (backfacecolor.green()) / 255.,
-                                           vtkFloatingPointType (backfacecolor.blue()) / 255.);
-
-               /* edge color */
-               anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
-                                     vtkFloatingPointType (edgecolor.green()) / 255.,
-                                     vtkFloatingPointType (edgecolor.blue()) / 255.);
-
-               /* Shrink factor and size edges */
-               anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
-               anActor->SetLineWidth(aDlg->GetIntValue(1));
-
-               /* Nodes color and size */
-               anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
-                                     vtkFloatingPointType (nodecolor.green()) / 255.,
-                                     vtkFloatingPointType (nodecolor.blue()) / 255.);
-               anActor->SetNodeSize(aDlg->GetIntValue(2));
-
-               SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
-               if( !aGroupObject->_is_nil() )
-               {
-                 SMESH::ElementType anElementType = aGroupObject->GetType();
-                 QColor aColor;
-                 switch( anElementType )
-                 {
-                   case SMESH::NODE: aColor = nodecolor; break;
-                   case SMESH::EDGE: aColor = edgecolor; break;
-                   default: aColor = color; break;
-                 }
-
-                 SALOMEDS::Color aGroupColor;
-                 aGroupColor.R = (float)aColor.red() / 255.0;
-                 aGroupColor.G = (float)aColor.green() / 255.0;
-                 aGroupColor.B = (float)aColor.blue() / 255.0;
-                 aGroupObject->SetColor( aGroupColor );
-               }
-
-               delete aDlg;
-             }
-             break;
-           }}
-         }
-       }
+            case 1132:{
+              vtkFloatingPointType color[3];
+              anActor->GetSufaceColor(color[0], color[1], color[2]);
+              int c0 = int (color[0] * 255);
+              int c1 = int (color[1] * 255);
+              int c2 = int (color[2] * 255);
+              QColor c(c0, c1, c2);
+
+              vtkFloatingPointType edgecolor[3];
+              anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]);
+              c0 = int (edgecolor[0] * 255);
+              c1 = int (edgecolor[1] * 255);
+              c2 = int (edgecolor[2] * 255);
+              QColor e(c0, c1, c2);
+
+              vtkFloatingPointType backfacecolor[3];
+              anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
+              c0 = int (backfacecolor[0] * 255);
+              c1 = int (backfacecolor[1] * 255);
+              c2 = int (backfacecolor[2] * 255);
+              QColor b(c0, c1, c2);
+
+              vtkFloatingPointType nodecolor[3];
+              anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
+              c0 = int (nodecolor[0] * 255);
+              c1 = int (nodecolor[1] * 255);
+              c2 = int (nodecolor[2] * 255);
+              QColor n(c0, c1, c2);
+
+              int Edgewidth = (int)anActor->GetLineWidth();
+              if(Edgewidth == 0)
+                Edgewidth = 1;
+              int intValue = int(anActor->GetNodeSize());
+              vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
+
+              SMESHGUI_Preferences_ColorDlg *aDlg =
+                new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
+              aDlg->SetColor(1, c);
+              aDlg->SetColor(2, e);
+              aDlg->SetColor(3, n);
+              aDlg->SetColor(4, b);
+              aDlg->SetIntValue(1, Edgewidth);
+              aDlg->SetIntValue(2, intValue);
+              aDlg->SetIntValue(3, int(Shrink*100.));
+              if(aDlg->exec()){
+                QColor color = aDlg->GetColor(1);
+                QColor edgecolor = aDlg->GetColor(2);
+                QColor nodecolor = aDlg->GetColor(3);
+                QColor backfacecolor = aDlg->GetColor(4);
+                /* actor color and backface color */
+                anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
+                                        vtkFloatingPointType (color.green()) / 255.,
+                                        vtkFloatingPointType (color.blue()) / 255.);
+                anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
+                                            vtkFloatingPointType (backfacecolor.green()) / 255.,
+                                            vtkFloatingPointType (backfacecolor.blue()) / 255.);
+
+                /* edge color */
+                anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
+                                      vtkFloatingPointType (edgecolor.green()) / 255.,
+                                      vtkFloatingPointType (edgecolor.blue()) / 255.);
+
+                /* Shrink factor and size edges */
+                anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
+                anActor->SetLineWidth(aDlg->GetIntValue(1));
+
+                /* Nodes color and size */
+                anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
+                                      vtkFloatingPointType (nodecolor.green()) / 255.,
+                                      vtkFloatingPointType (nodecolor.blue()) / 255.);
+                anActor->SetNodeSize(aDlg->GetIntValue(2));
+
+                SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
+                if( !aGroupObject->_is_nil() )
+                {
+                  SMESH::ElementType anElementType = aGroupObject->GetType();
+                  QColor aColor;
+                  switch( anElementType )
+                  {
+                    case SMESH::NODE: aColor = nodecolor; break;
+                    case SMESH::EDGE: aColor = edgecolor; break;
+                    default: aColor = color; break;
+                  }
+
+                  SALOMEDS::Color aGroupColor;
+                  aGroupColor.R = (float)aColor.red() / 255.0;
+                  aGroupColor.G = (float)aColor.green() / 255.0;
+                  aGroupColor.B = (float)aColor.blue() / 255.0;
+                  aGroupObject->SetColor( aGroupColor );
+                }
+
+                delete aDlg;
+              }
+              break;
+            }}
+          }
+        }
       }
       SMESH::RepaintCurrentView();
     }
     if( !selected.IsEmpty() ){
       Handle(SALOME_InteractiveObject) anIO = selected.First();
       if(!anIO.IsNull()){
-       QString aTitle;
-       SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
-       if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){
-         switch ( theCommandID ){
-         case 6001:
-           aTitle = QObject::tr( "LENGTH_EDGES" );
-           aControl = SMESH_Actor::eLength;
-           break;
-         case 6018:
-           aTitle = QObject::tr( "LENGTH2D_EDGES" );
-           aControl = SMESH_Actor::eLength2D;
-           break;
-         case 6002:
-           aTitle = QObject::tr( "FREE_EDGES" );
-           aControl = SMESH_Actor::eFreeEdges;
-           break;
-         case 6003:
-           aTitle = QObject::tr( "FREE_BORDERS" );
-           aControl = SMESH_Actor::eFreeBorders;
-           break;
-         case 6004:
-           aTitle = QObject::tr( "MULTI_BORDERS" );
-           aControl = SMESH_Actor::eMultiConnection;
-           break;
-         case 6005:
-           aTitle = QObject::tr( "FREE_NODES" );
-           aControl = SMESH_Actor::eFreeNodes;
-           break;
-         case 6019:
-           aTitle = QObject::tr( "MULTI2D_BORDERS" );
-           aControl = SMESH_Actor::eMultiConnection2D;
-           break;
-         case 6011:
-           aTitle = QObject::tr( "AREA_ELEMENTS" );
-           aControl = SMESH_Actor::eArea;
-           break;
-         case 6012:
-           aTitle = QObject::tr( "TAPER_ELEMENTS" );
-           aControl = SMESH_Actor::eTaper;
-           break;
-         case 6013:
-           aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
-           aControl = SMESH_Actor::eAspectRatio;
-           break;
-         case 6017:
-           aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
-           aControl = SMESH_Actor::eAspectRatio3D;
-           break;
-         case 6014:
-           aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
-           aControl = SMESH_Actor::eMinimumAngle;
-           break;
-         case 6015:
-           aTitle = QObject::tr( "WARP_ELEMENTS" );
-           aControl = SMESH_Actor::eWarping;
-           break;
-         case 6016:
-           aTitle = QObject::tr( "SKEW_ELEMENTS" );
-           aControl = SMESH_Actor::eSkew;
-           break;
-         case 6009:
-           aTitle = QObject::tr( "SMESH_VOLUME" );
-           aControl = SMESH_Actor::eVolume3D;
-           break;
-         case 6021:
-           aTitle = QObject::tr( "FREE_FACES" );
-           aControl = SMESH_Actor::eFreeFaces;
-           break;
-         }
-         anActor->SetControlMode(aControl);
-         anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data());
-         SMESH::RepaintCurrentView();
-       }
+        QString aTitle;
+        SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
+        if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){
+          switch ( theCommandID ){
+          case 6001:
+            aTitle = QObject::tr( "LENGTH_EDGES" );
+            aControl = SMESH_Actor::eLength;
+            break;
+          case 6018:
+            aTitle = QObject::tr( "LENGTH2D_EDGES" );
+            aControl = SMESH_Actor::eLength2D;
+            break;
+          case 6002:
+            aTitle = QObject::tr( "FREE_EDGES" );
+            aControl = SMESH_Actor::eFreeEdges;
+            break;
+          case 6003:
+            aTitle = QObject::tr( "FREE_BORDERS" );
+            aControl = SMESH_Actor::eFreeBorders;
+            break;
+          case 6004:
+            aTitle = QObject::tr( "MULTI_BORDERS" );
+            aControl = SMESH_Actor::eMultiConnection;
+            break;
+          case 6005:
+            aTitle = QObject::tr( "FREE_NODES" );
+            aControl = SMESH_Actor::eFreeNodes;
+            break;
+          case 6019:
+            aTitle = QObject::tr( "MULTI2D_BORDERS" );
+            aControl = SMESH_Actor::eMultiConnection2D;
+            break;
+          case 6011:
+            aTitle = QObject::tr( "AREA_ELEMENTS" );
+            aControl = SMESH_Actor::eArea;
+            break;
+          case 6012:
+            aTitle = QObject::tr( "TAPER_ELEMENTS" );
+            aControl = SMESH_Actor::eTaper;
+            break;
+          case 6013:
+            aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
+            aControl = SMESH_Actor::eAspectRatio;
+            break;
+          case 6017:
+            aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
+            aControl = SMESH_Actor::eAspectRatio3D;
+            break;
+          case 6014:
+            aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
+            aControl = SMESH_Actor::eMinimumAngle;
+            break;
+          case 6015:
+            aTitle = QObject::tr( "WARP_ELEMENTS" );
+            aControl = SMESH_Actor::eWarping;
+            break;
+          case 6016:
+            aTitle = QObject::tr( "SKEW_ELEMENTS" );
+            aControl = SMESH_Actor::eSkew;
+            break;
+          case 6009:
+            aTitle = QObject::tr( "SMESH_VOLUME" );
+            aControl = SMESH_Actor::eVolume3D;
+            break;
+          case 6021:
+            aTitle = QObject::tr( "FREE_FACES" );
+            aControl = SMESH_Actor::eFreeFaces;
+            break;
+          }
+          anActor->SetControlMode(aControl);
+          anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data());
+          SMESH::RepaintCurrentView();
+        }
       }
     }
   }
 
 
   bool CheckOIType(const Handle(SALOME_InteractiveObject) & theIO,
-                  MeshObjectType                           theType,
-                  const QString                            theInTypeName,
-                  QString &                                theOutTypeName)
+                   MeshObjectType                           theType,
+                   const QString                            theInTypeName,
+                   QString &                                theOutTypeName)
   {
     SMESH_TypeFilter aTypeFilter( theType );
     QString entry;
       _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
       CORBA::String_var anID = aSComp->GetID().c_str();
       if (!strcmp(anID.in(),theIO->getEntry()))
-       return "Component";
+        return "Component";
     }
 
     QString aTypeName;
     if (
-       CheckOIType ( theIO, HYPOTHESIS,    "Hypothesis", aTypeName ) ||
-       CheckOIType ( theIO, ALGORITHM,     "Algorithm",  aTypeName ) ||
-       CheckOIType ( theIO, MESH,          "Mesh",       aTypeName ) ||
-       CheckOIType ( theIO, SUBMESH,       "SubMesh",    aTypeName ) ||
-       CheckOIType ( theIO, GROUP,         "Group",      aTypeName )
-       )
+        CheckOIType ( theIO, HYPOTHESIS,    "Hypothesis", aTypeName ) ||
+        CheckOIType ( theIO, ALGORITHM,     "Algorithm",  aTypeName ) ||
+        CheckOIType ( theIO, MESH,          "Mesh",       aTypeName ) ||
+        CheckOIType ( theIO, SUBMESH,       "SubMesh",    aTypeName ) ||
+        CheckOIType ( theIO, GROUP,         "Group",      aTypeName )
+        )
       return aTypeName;
 
     return "NoType";
     SALOME_ListIteratorOfListIO It(selected);
     for ( ; It.More(); It.Next())
       {
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       QString Type = CheckTypeObject(IObject);
-       if (Type.compare(RefType) != 0)
-         return "Heterogeneous Selection";
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        QString Type = CheckTypeObject(IObject);
+        if (Type.compare(RefType) != 0)
+          return "Heterogeneous Selection";
       }
 
     return RefType;
       QString cur = anIO->getComponentDataType();
       _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
       if (aSO) {
-       // check if object is reference
-       _PTR(SObject) aRefSObj;
-       aNameList.append("\n    - ");
-       if ( aSO->ReferencedObject( aRefSObj ) ) {
-         QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
-         aNameList.append( aRefName );
-         cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
-       }
-       else
-         aNameList.append(anIO->getName());
-       objectCount++;
+        // check if object is reference
+        _PTR(SObject) aRefSObj;
+        aNameList.append("\n    - ");
+        if ( aSO->ReferencedObject( aRefSObj ) ) {
+          QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
+          aNameList.append( aRefName );
+          cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
+        }
+        else
+          aNameList.append(anIO->getName());
+        objectCount++;
       }
 
       if( aParentComponent.isNull() )
 
     if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() )  {
       SUIT_MessageBox::warning( SMESHGUI::desktop(),
-                               QObject::tr("ERR_ERROR"),
-                               QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
+                                QObject::tr("ERR_ERROR"),
+                                QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
       return;
     }
     // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
     if (SUIT_MessageBox::warning
-       (SMESHGUI::desktop(),
-        QObject::tr("SMESH_WRN_WARNING"),
-        QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
-        SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-        SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
+        (SMESHGUI::desktop(),
+         QObject::tr("SMESH_WRN_WARNING"),
+         QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
+         SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+         SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
       return;
 
     SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
     for( ; It.More(); It.Next()){ // loop on selected IO's
       Handle(SALOME_InteractiveObject) IObject = It.Value();
       if(IObject->hasEntry()) {
-       _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
-
-       // disable removal of "SMESH" component object
-       if(aSO->FindAttribute(anAttr, "AttributeIOR")){
-         anIOR = anAttr;
-         if ( engineIOR() == anIOR->Value().c_str() )
-           continue;
-       }
-       //Check the referenced object
-       _PTR(SObject) aRefSObject;
-       if ( aSO && aSO->ReferencedObject( aRefSObject ) )
-         aSO = aRefSObject; // Delete main Object instead of reference
+        _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
+
+        // disable removal of "SMESH" component object
+        if(aSO->FindAttribute(anAttr, "AttributeIOR")){
+          anIOR = anAttr;
+          if ( engineIOR() == anIOR->Value().c_str() )
+            continue;
+        }
+        //Check the referenced object
+        _PTR(SObject) aRefSObject;
+        if ( aSO && aSO->ReferencedObject( aRefSObject ) )
+          aSO = aRefSObject; // Delete main Object instead of reference
 
         // put the whole hierarchy of sub-objects of the selected SO into a list and
         // then treat them all starting from the deepest objects (at list back)
           std::string anEntry = SO->GetID();
 
           /** Erase graphical object **/
-         if(SO->FindAttribute(anAttr, "AttributeIOR")){
-           QVector<SUIT_ViewWindow*> aViews = vm->getViews();
-           for(int i = 0; i < nbSf; i++){
-             SUIT_ViewWindow *sf = aViews[i];
-             if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
-               SMESH::RemoveActor(sf,anActor);
-             }
-           }
-         }
+          if(SO->FindAttribute(anAttr, "AttributeIOR")){
+            QVector<SUIT_ViewWindow*> aViews = vm->getViews();
+            for(int i = 0; i < nbSf; i++){
+              SUIT_ViewWindow *sf = aViews[i];
+              if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
+                SMESH::RemoveActor(sf,anActor);
+              }
+            }
+          }
 
           /** Remove an object from data structures **/
           SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
               //op->finish();
             }
           }
-       } /* listSO back loop */
+        } /* listSO back loop */
       } /* IObject->hasEntry() */
     } /* more/next */
     aStudyBuilder->CommitCommand();
@@ -1179,7 +1180,7 @@ SMESHGUI* SMESHGUI::GetSMESHGUI()
     {
       _PTR(Study) aStudy = study->studyDS();
       if ( aStudy )
-       GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
+        GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
     }
   }
 
@@ -1244,6 +1245,16 @@ void SMESHGUI::EmitSignalCloseAllDialogs()
   emit SignalCloseAllDialogs();
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void SMESHGUI::EmitSignalVisibilityChanged()
+{
+  emit SignalVisibilityChanged();
+}
+
 //=============================================================================
 /*!
  *
@@ -1293,16 +1304,6 @@ SalomeApp_Study* SMESHGUI::activeStudy()
     return NULL;
 }
 
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-char* SMESHGUI::JoinObjectParameters(const QStringList& theParametersList)
-{
-  return theParametersList.join(":").toLatin1().data();
-}
-
 //=============================================================================
 /*!
  *
@@ -1331,8 +1332,8 @@ static int isStudyLocked(_PTR(Study) theStudy){
 static bool checkLock(_PTR(Study) theStudy) {
   if (isStudyLocked(theStudy)) {
     SUIT_MessageBox::warning( SMESHGUI::desktop(),
-                             QObject::tr("WRN_WARNING"),
-                             QObject::tr("WRN_STUDY_LOCKED") );
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("WRN_STUDY_LOCKED") );
     return true;
   }
   return false;
@@ -1374,13 +1375,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   //QAction* act = action( theCommandID );
 
-  switch (theCommandID)        {
-  case 33:                                     // DELETE
+  switch (theCommandID) {
+  case 33:                                      // DELETE
     if(checkLock(aStudy)) break;
     OnEditDelete();
     break;
 
-  case 113:                                    // IMPORT
+  case 113:                                     // IMPORT
   case 112:
   case 111:
     {
@@ -1408,7 +1409,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 122:                                    // EXPORT MED
+  case 122:                                     // EXPORT MED
   case 121:
   case 123:
   case 124:
@@ -1421,7 +1422,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 200:                                    // SCALAR BAR
+  case 200:                                     // SCALAR BAR
     {
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
       SALOME_ListIO selected;
@@ -1429,12 +1430,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         aSel->selectedObjects( selected );
 
       if( selected.Extent() ) {
-       Handle(SALOME_InteractiveObject) anIO = selected.First();
-       if( anIO->hasEntry() ) {
-         if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
-           anActor->SetControlMode( SMESH_Actor::eNone );
-         }
-       }
+        Handle(SALOME_InteractiveObject) anIO = selected.First();
+        if( anIO->hasEntry() ) {
+          if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
+            anActor->SetControlMode( SMESH_Actor::eNone );
+          }
+        }
       }
       break;
     }
@@ -1488,16 +1489,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       SALOME_ListIteratorOfListIO it(selected);
       for( ; it.More(); it.Next()) {
         Handle(SALOME_InteractiveObject) anIObject = it.Value();
-       if(anIObject->hasEntry()) {
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
-           anActor->SetFacesOriented( !anActor->GetFacesOriented() );
-         }
-       }
+        if(anIObject->hasEntry()) {
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+            anActor->SetFacesOriented( !anActor->GetFacesOriented() );
+          }
+        }
       }
       break;
     }
 
-  case 214:                                    // UPDATE
+  case 214:                                     // UPDATE
     {
       if(checkLock(aStudy)) break;
       try {
@@ -1520,15 +1521,15 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 300:                                    // ERASE
-  case 301:                                    // DISPLAY
-  case 302:                                    // DISPLAY ONLY
+  case 300:                                     // ERASE
+  case 301:                                     // DISPLAY
+  case 302:                                     // DISPLAY ONLY
     {
       SMESH::EDisplaing anAction;
       switch (theCommandID) {
-      case 300:        anAction = SMESH::eErase; break;
-      case 301:        anAction = SMESH::eDisplay; break;
-      case 302:        anAction = SMESH::eDisplayOnly; break;
+      case 300: anAction = SMESH::eErase; break;
+      case 301: anAction = SMESH::eDisplay; break;
+      case 302: anAction = SMESH::eDisplayOnly; break;
       }
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -1537,7 +1538,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         aSel->selectedObjects( sel_objects );
 
       if( theCommandID==302 )
-       startOperation( myEraseAll );
+        startOperation( myEraseAll );
 
       extractContainers( sel_objects, to_process );
 
@@ -1550,8 +1551,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
           for ( ; It.More(); It.Next()) {
             Handle(SALOME_InteractiveObject) IOS = It.Value();
             if (IOS->hasEntry()) {
-              if (!SMESH::UpdateView(anAction, IOS->getEntry()))
+              if (!SMESH::UpdateView(anAction, IOS->getEntry())) {
+                SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
                 break; // PAL16774 (Crash after display of many groups)
+              }
               if (anAction == SMESH::eDisplayOnly)
                 anAction = SMESH::eDisplay;
             }
@@ -1559,8 +1562,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
 
         // PAL13338 + PAL15161 -->
-        if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy))
+        if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy)) {
           SMESH::UpdateView();
+          SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
+        }
         // PAL13338 + PAL15161 <--
       }
       catch (...) { // PAL16774 (Crash after display of many groups)
@@ -1568,28 +1573,28 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       }
 
       if (anAction == SMESH::eErase) {
-       SALOME_ListIO l1;
-       aSel->setSelectedObjects( l1 );
+        SALOME_ListIO l1;
+        aSel->setSelectedObjects( l1 );
       }
       else
-       aSel->setSelectedObjects( to_process );
-
+        aSel->setSelectedObjects( to_process );
+      
       break;
     }
 
-  case 4000:                                   // NODES
+  case 4000:                                    // NODES
     {
       if(checkLock(aStudy)) break;
 
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
+        EmitSignalDeactivateDialog();
 
-       ( new SMESHGUI_NodesDlg( this ) )->show();
+        ( new SMESHGUI_NodesDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"),
-                                tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"),
+                                 tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -1604,12 +1609,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     break;
   }
 
-  case 406:                                    // MOVE NODE
+  case 406:                                     // MOVE NODE
     {
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1618,9 +1623,9 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 701:                                    // COMPUTE MESH
-  case 711:                                    // PRECOMPUTE MESH
-  case 712:                                    // EVALUATE MESH
+  case 701:                                     // COMPUTE MESH
+  case 711:                                     // PRECOMPUTE MESH
+  case 712:                                     // EVALUATE MESH
     {
       if (checkLock(aStudy)) break;
       startOperation( theCommandID );
@@ -1646,7 +1651,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1676,7 +1681,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1699,12 +1704,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_SmoothingDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_SmoothingDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -1712,11 +1717,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
       } else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -1724,12 +1729,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_RevolutionDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_RevolutionDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -1743,8 +1748,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         ( new SMESHGUI_MeshPatternDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -1752,11 +1757,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
       } else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -1765,12 +1770,17 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     startOperation( 417 );
       /*      if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_ConvToQuadDlg();
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_ConvToQuadDlg();
       } else {
-       SUIT_MessageBox::warning(desktop(),
+        SUIT_MessageBox::warning(desktop(),
                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
-                              }*/
+                               }*/
+      break;
+    }
+  case 418: // create 2D mesh from 3D
+    {
+      startOperation( 418 );
       break;
     }
   case 806:                                     // CREATE GEO GROUP
@@ -1783,7 +1793,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1798,7 +1808,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       int nbSel = selected.Extent();
       if (nbSel == 1) {
-       // check if mesh is selected
+        // check if mesh is selected
         aMesh = SMESH::GetMeshByIO( selected.First() );
       }
       SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aMesh);
@@ -1811,7 +1821,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1825,52 +1835,52 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       int nbSel = selected.Extent();
       if (nbSel == 1) {
-       // check if submesh is selected
-       Handle(SALOME_InteractiveObject) IObject = selected.First();
-       if (IObject->hasEntry()) {
-         _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
-         if( aSObj ) {
-           SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
-           if (!aSubMesh->_is_nil()) {
-             try {
-               SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
-               // get submesh elements list by types
-               SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
-               SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
-               SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
-               SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
-               // create group for each type o elements
-               QString aName = IObject->getName();
-               if (aNodes->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
-                 aGroup->Add(aNodes.inout());
-               }
-               if (aEdges->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
-                 aGroup->Add(aEdges.inout());
-               }
-               if (aFaces->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
-                 aGroup->Add(aFaces.inout());
-               }
-               if (aVolumes->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
-                 aGroup->Add(aVolumes.inout());
-               }
-               updateObjBrowser();
-
-             }
+        // check if submesh is selected
+        Handle(SALOME_InteractiveObject) IObject = selected.First();
+        if (IObject->hasEntry()) {
+          _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
+          if( aSObj ) {
+            SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
+            if (!aSubMesh->_is_nil()) {
+              try {
+                SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
+                // get submesh elements list by types
+                SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
+                SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
+                SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
+                SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
+                // create group for each type o elements
+                QString aName = IObject->getName();
+                if (aNodes->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
+                  aGroup->Add(aNodes.inout());
+                }
+                if (aEdges->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
+                  aGroup->Add(aEdges.inout());
+                }
+                if (aFaces->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
+                  aGroup->Add(aFaces.inout());
+                }
+                if (aVolumes->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
+                  aGroup->Add(aVolumes.inout());
+                }
+                updateObjBrowser();
+
+              }
               catch(const SALOME::SALOME_Exception & S_ex){
-               SalomeApp_Tools::QtCatchCorbaException(S_ex);
-             }
-           }
-         }
-       }
+                SalomeApp_Tools::QtCatchCorbaException(S_ex);
+              }
+            }
+          }
+        }
       }
       else if(nbSel==0) {
         SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"),
-                                tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+                                 tr("SMESH_WRN_WARNING"),
+                                 tr("SMESH_WRN_NO_AVAILABLE_DATA"));
       }
       break;
     }
@@ -1880,7 +1890,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1899,16 +1909,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SMESH::SMESH_GroupBase_var aGroup =
           SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(It.Value());
         if (!aGroup->_is_nil()) {
-         nbSelectedGroups++;
+          nbSelectedGroups++;
           SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup);
           aDlg->show();
-       }
+        }
       }
       if (nbSelectedGroups == 0)
-       {
-         SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil());
-         aDlg->show();
-       }
+        {
+          SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil());
+          aDlg->show();
+        }
       break;
     }
 
@@ -1916,8 +1926,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if (myState == 800) {
-       SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
-       if (aDlg) aDlg->onAdd();
+        SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
+        if (aDlg) aDlg->onAdd();
       }
       break;
     }
@@ -1926,8 +1936,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if (myState == 800) {
-       SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
-       if (aDlg) aDlg->onRemove();
+        SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
+        if (aDlg) aDlg->onRemove();
       }
       break;
     }
@@ -1937,7 +1947,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -1957,7 +1967,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         if (!aGroup->_is_nil()) {
           SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup, true );
           aDlg->show();
-       }
+        }
       }
       break;
     }
@@ -1969,7 +1979,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -2008,7 +2018,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if ( !vtkwnd )
       {
         SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                                 tr( "NOT_A_VTK_VIEWER" ) );
+                                  tr( "NOT_A_VTK_VIEWER" ) );
         break;
       }
 
@@ -2021,7 +2031,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 900:                                    // MESH INFOS
+  case 900:                                     // MESH INFOS
     {
       EmitSignalDeactivateDialog();
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -2033,8 +2043,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SALOME_ListIO IOs;
         SALOME_ListIteratorOfListIO It (selected);
         for ( ; It.More(); It.Next() ) {
-         IOs.Clear(); IOs.Append( It.Value() );
-         aSel->setSelectedObjects( IOs );
+          IOs.Clear(); IOs.Append( It.Value() );
+          aSel->setSelectedObjects( IOs );
           ( new SMESHGUI_MeshInfosDlg( this ) )->show();
         }
         // restore selection
@@ -2045,7 +2055,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 902:                                    // STANDARD MESH INFOS
+  case 902:                                     // STANDARD MESH INFOS
     {
       EmitSignalDeactivateDialog();
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -2057,27 +2067,27 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SALOME_ListIO IOs;
         SALOME_ListIteratorOfListIO It (selected);
         for ( ; It.More(); It.Next() ) {
-         IOs.Clear();
-         IOs.Append( It.Value() );
-         aSel->setSelectedObjects( IOs );
+          IOs.Clear();
+          IOs.Append( It.Value() );
+          aSel->setSelectedObjects( IOs );
           ( new SMESHGUI_StandardMeshInfosDlg( this ) )->show();
         }
         // restore selection
-       aSel->setSelectedObjects( selected );
+        aSel->setSelectedObjects( selected );
       }
       else
         ( new SMESHGUI_StandardMeshInfosDlg( this ) )->show();
       break;
     }
 
-  case 903:                                    // WHAT IS
+  case 903:                                     // WHAT IS
     {
       EmitSignalDeactivateDialog();
       ( new SMESHGUI_WhatIsDlg( this ) )->show();
       break;
     }
 
-  case 1100:                                   // EDIT HYPOTHESIS
+  case 1100:                                    // EDIT HYPOTHESIS
     {
       if(checkLock(aStudy)) break;
 
@@ -2090,7 +2100,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       if (nbSel == 1) {
         Handle(SALOME_InteractiveObject) anIObject = selected.First();
-       SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface<SMESH::SMESH_Hypothesis>(anIObject);
+        SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface<SMESH::SMESH_Hypothesis>(anIObject);
 
         /* Look for all mesh objects that have this hypothesis affected in order to flag as ModifiedMesh */
         /* At end below '...->updateObjBrowser(true)' will change icon of mesh objects                   */
@@ -2112,7 +2122,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 1101:                                   // RENAME
+  case 1101:                                    // RENAME
     {
       if ( checkLock( aStudy ) )
         break;
@@ -2152,14 +2162,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
               {
                 SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), newName.toLatin1().data());
 
-               // update name of group object and its actor
-               SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
-               if( !aGroupObject->_is_nil() )
-               {
-                 aGroupObject->SetName( newName.toLatin1().data() );
-                 if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( IObject->getEntry() ) )
-                   anActor->setName( newName.toLatin1().data() );
-               }
+                // update name of group object and its actor
+                SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
+                if( !aGroupObject->_is_nil() )
+                {
+                  aGroupObject->SetName( newName.toLatin1().data() );
+                  if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( IObject->getEntry() ) )
+                    anActor->setName( newName.toLatin1().data() );
+                }
 
                 updateObjBrowser();
               }
@@ -2170,13 +2180,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       if (!isAny) {
         SUIT_MessageBox::warning(desktop(),
-                                QObject::tr("SMESH_WRN_WARNING"),
-                                QObject::tr("SMESH_WRN_NO_APPROPRIATE_SELECTION"));
+                                 QObject::tr("SMESH_WRN_WARNING"),
+                                 QObject::tr("SMESH_WRN_NO_APPROPRIATE_SELECTION"));
       }
       break;
     }
 
-  case 1102:                                   // REMOVE HYPOTHESIS / ALGORITHMS
+  case 1102:                                    // REMOVE HYPOTHESIS / ALGORITHMS
     {
       if(checkLock(aStudy)) break;
       SUIT_OverrideCursor wc;
@@ -2188,8 +2198,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       SALOME_ListIteratorOfListIO It(selected);
       for (int i = 0; It.More(); It.Next(), i++) {
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
       }
       SALOME_ListIO l1;
       aSel->setSelectedObjects( l1 );
@@ -2197,17 +2207,17 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 4009:                                   // ELEM0D
-  case 4010:                                   // GEOM::EDGE
-  case 4021:                                   // TRIANGLE
-  case 4022:                                   // QUAD
-  case 4023:                                   // POLYGON
-  case 4031:                                   // TETRA
-  case 4032:                                   // HEXA
+  case 4009:                                    // ELEM0D
+  case 4010:                                    // GEOM::EDGE
+  case 4021:                                    // TRIANGLE
+  case 4022:                                    // QUAD
+  case 4023:                                    // POLYGON
+  case 4031:                                    // TETRA
+  case 4032:                                    // HEXA
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
+        EmitSignalDeactivateDialog();
         SMDSAbs_ElementType type    = SMDSAbs_Edge;
         int                 nbNodes = 2;
         switch (theCommandID) {
@@ -2219,32 +2229,32 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
           type = SMDSAbs_Face; nbNodes = 4; break;
         case 4031:                                      // TETRA
           type = SMDSAbs_Volume; nbNodes = 4; break;
-       case 4023:                                      // POLYGON
-         type = SMDSAbs_Face; nbNodes = 5; break;     // 5 - identificator for POLYGON
+        case 4023:                                      // POLYGON
+          type = SMDSAbs_Face; nbNodes = 5; break;     // 5 - identificator for POLYGON
         case 4032:                                      // HEXA
           type = SMDSAbs_Volume; nbNodes = 8; break;
-       case 4033:                                      // POLYHEDRE
-         type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
+        case 4033:                                      // POLYHEDRE
+          type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
         default:;
         }
-       ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show();
+        ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
-  case 4033:                                   // POLYHEDRON
+  case 4033:                                    // POLYHEDRON
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2258,60 +2268,60 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       int type;
-
-       switch (theCommandID) {
-       case 4034:
-         type = QUAD_EDGE; break;
-       case 4035:
-         type = QUAD_TRIANGLE; break;
-       case 4036:
-         type = QUAD_QUADRANGLE; break;
-       case 4037:
-         type = QUAD_TETRAHEDRON; break;
-       case 4038:
-         type = QUAD_PYRAMID; break;
-       case 4039:
-         type = QUAD_PENTAHEDRON; break;
-       case 4040:
-         type = QUAD_HEXAHEDRON;
-         break;
-       default:;
-       }
-        ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show();
+        EmitSignalDeactivateDialog();
+        int type;
+
+        switch (theCommandID) {
+        case 4034:
+          type = QUAD_EDGE; break;
+        case 4035:
+          type = QUAD_TRIANGLE; break;
+        case 4036:
+          type = QUAD_QUADRANGLE; break;
+        case 4037:
+          type = QUAD_TETRAHEDRON; break;
+        case 4038:
+          type = QUAD_PYRAMID; break;
+        case 4039:
+          type = QUAD_PENTAHEDRON; break;
+        case 4040:
+          type = QUAD_HEXAHEDRON;
+          break;
+        default:;
+        }
+         ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
-  case 4041:                                   // REMOVES NODES
+  case 4041:                                    // REMOVES NODES
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
-  case 4042:                                   // REMOVES ELEMENTS
+  case 4042:                                    // REMOVES ELEMENTS
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
       }
       else
-       {
-         SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                  tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
-       }
+        {
+          SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                   tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        }
       break;
     }
   case 4043: {                                // CLEAR_MESH
@@ -2345,53 +2355,53 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       }
       catch (const SALOME::SALOME_Exception& S_ex){
-       wc.suspend();
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
-       wc.resume();
+        wc.suspend();
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        wc.resume();
       }
     }
     SMESH::UpdateView();
     updateObjBrowser();
     break;
   }
-  case 4051:                                   // RENUMBERING NODES
+  case 4051:                                    // RENUMBERING NODES
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
       }
       else
-       {
-         SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                  tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
-       }
+        {
+          SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                   tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        }
       break;
     }
-  case 4052:                                   // RENUMBERING ELEMENTS
+  case 4052:                                    // RENUMBERING ELEMENTS
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
       }
       else
-       {
-         SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                  tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
-       }
+        {
+          SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                   tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        }
       break;
     }
   case 4061:                                   // TRANSLATION
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_TranslationDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_TranslationDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2399,12 +2409,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_RotationDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_RotationDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2412,12 +2422,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if(vtkwnd) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_SymmetryDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_SymmetryDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2425,12 +2435,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if(vtkwnd) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_SewingDlg( this ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_SewingDlg( this ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2438,12 +2448,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if(vtkwnd) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show();
       }
       else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2451,11 +2461,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show();
+        EmitSignalDeactivateDialog();
+        ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show();
       } else {
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
       }
       break;
     }
@@ -2482,7 +2492,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   }
   break;
 
-  case 6017:                                   // CONTROLS
+  case 6017:                                    // CONTROLS
   case 6016:
   case 6015:
   case 6014:
@@ -2504,27 +2514,27 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       SALOME_ListIO selected; mgr->selectedObjects( selected );
 
       if ( selected.Extent() == 1 && selected.First()->hasEntry() ) {
-       _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() );
-       if ( SO ) {
-         CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
-         SMESH::SMESH_Mesh_var      aMesh    = SMESH::SMESH_Mesh::_narrow( aObject );
-         SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
-         SMESH::SMESH_GroupBase_var aGroup   = SMESH::SMESH_GroupBase::_narrow( aObject );
-         if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
-           ::Control( theCommandID );
-           break;
-         }
-       }
+        _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() );
+        if ( SO ) {
+          CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
+          SMESH::SMESH_Mesh_var      aMesh    = SMESH::SMESH_Mesh::_narrow( aObject );
+          SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
+          SMESH::SMESH_GroupBase_var aGroup   = SMESH::SMESH_GroupBase::_narrow( aObject );
+          if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
+            ::Control( theCommandID );
+            break;
+          }
+        }
       }
       SUIT_MessageBox::warning(desktop(),
-                              tr( "SMESH_WRN_WARNING" ),
-                              tr( "SMESH_BAD_SELECTION" ) );
+                               tr( "SMESH_WRN_WARNING" ),
+                               tr( "SMESH_BAD_SELECTION" ) );
       break;
     }
     else {
       SUIT_MessageBox::warning(desktop(),
-                              tr( "SMESH_WRN_WARNING" ),
-                              tr( "NOT_A_VTK_VIEWER" ) );
+                               tr( "SMESH_WRN_WARNING" ),
+                               tr( "NOT_A_VTK_VIEWER" ) );
     }
     break;
   case 9010:
@@ -2535,11 +2545,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       SALOME_ListIteratorOfListIO it(selected);
       for( ; it.More(); it.Next()) {
         Handle(SALOME_InteractiveObject) anIObject = it.Value();
-       if(anIObject->hasEntry()) {
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
-           anActor->SetPointsLabeled( !anActor->GetPointsLabeled() );
-         }
-       }
+        if(anIObject->hasEntry()) {
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+            anActor->SetPointsLabeled( !anActor->GetPointsLabeled() );
+          }
+        }
       }
       break;
     }
@@ -2548,12 +2558,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       LightApp_SelectionMgr* mgr = selectionMgr();
       SALOME_ListIO selected; mgr->selectedObjects( selected );
 
-      if (selected.Extent() == 1)      {
-       Handle(SALOME_InteractiveObject) anIObject = selected.First();
-       if(anIObject->hasEntry())
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
-           anActor->SetCellsLabeled( !anActor->GetCellsLabeled() );
-         }
+      if (selected.Extent() == 1)       {
+        Handle(SALOME_InteractiveObject) anIObject = selected.First();
+        if(anIObject->hasEntry())
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+            anActor->SetCellsLabeled( !anActor->GetCellsLabeled() );
+          }
       }
       break;
     }
@@ -2640,7 +2650,7 @@ void SMESHGUI::createPopupItem( const int id,
                                 const QString& clients,
                                 const QString& types,
                                 const QString& theRule,
-                               const int pId )
+                                const int pId )
 {
   int parentId = pId;
   if( pId!=-1 )
@@ -2768,6 +2778,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   createSMESHAction(  415, "MAP",             "ICON_MAP" );
   createSMESHAction(  416, "EXTRUSION_ALONG", "ICON_EXTRUSION_ALONG" );
   createSMESHAction(  417, "CONV_TO_QUAD",    "ICON_CONV_TO_QUAD" );
+  createSMESHAction(  418, "2D_FROM_3D",      "ICON_2D_FROM_3D" );
   createSMESHAction(  200, "RESET" );
   createSMESHAction(  201, "SCALAR_BAR_PROP" );
   createSMESHAction(  211, "WIRE",           "ICON_WIRE", 0, true );
@@ -2937,6 +2948,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   createMenu( 414, modifyId, -1 );
   createMenu( 415, modifyId, -1 );
   createMenu( 417, modifyId, -1 );
+  createMenu( 418, modifyId, -1 );
 
   createMenu( 214, viewId, -1 );
 
@@ -3033,6 +3045,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   createTool( 414, modifyTb );
   createTool( 415, modifyTb );
   createTool( 417, modifyTb );
+  createTool( 418, modifyTb );
 
   createTool( 214, dispModeTb );
 
@@ -3041,24 +3054,37 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   myRules.clear();
   QString OB = "'ObjectBrowser'",
-         View = "'" + SVTK_Viewer::Type() + "'",
-         pat = "'%1'",
-         mesh    = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
-         group   = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
-         hypo    = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
-         algo    = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
-         elems   = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
+          View = "'" + SVTK_Viewer::Type() + "'",
+          pat = "'%1'",
+          mesh    = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
+          group   = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
+          hypo    = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
+          algo    = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
+          elems   = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
                        arg( SMESHGUI_Selection::typeName( SUBMESH_VERTEX ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH ) ),
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH ) ),
           subMesh = elems,
-         mesh_group = mesh + " " + subMesh + " " + group,
-         hyp_alg = hypo + " " + algo;
+          mesh_group = mesh + " " + subMesh + " " + group,
+          hyp_alg = hypo + " " + algo;
 
   // popup for object browser
+  QString
+    isInvisible("not( isVisible )"),
+    isEmpty("numberOfNodes = 0"),
+    isNotEmpty("numberOfNodes <> 0"),
+
+    // has nodes, edges, etc in VISIBLE! actor
+    hasNodes("(numberOfNodes > 0 )"),//&& isVisible)"),
+    hasElems("(count( elemTypes ) > 0)"),
+    hasDifferentElems("(count( elemTypes ) > 1)"),
+    hasElems0d("({'Elem0d'} in elemTypes)"),
+    hasEdges("({'Edge'} in elemTypes)"),
+    hasFaces("({'Face'} in elemTypes)"),
+    hasVolumes("({'Volume'} in elemTypes)");
 
   createPopupItem( 150, OB, mesh, "&& selcount=1 && isImported" );      // FILE INFORMATION
   createPopupItem( 703, OB, mesh, "&& isComputable");      // CREATE_SUBMESH
@@ -3087,6 +3113,9 @@ void SMESHGUI::initialize( CAM_Application* app )
   popupMgr()->insert( separator(), -1, 0 );
   createPopupItem( 4043, OB, mesh );                       // CLEAR_MESH
   popupMgr()->insert( separator(), -1, 0 );
+  createPopupItem( 417, OB, mesh/*, "&& " + hasElems*/);       // convert to quadratic
+  createPopupItem( 418, OB, mesh/*, "&& " + hasVolumes*/);     // create 2D mesh on 3D
+  popupMgr()->insert( separator(), -1, 0 );
 
   QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
 
@@ -3114,20 +3143,6 @@ void SMESHGUI::initialize( CAM_Application* app )
   popupMgr()->insert( separator(), -1, 0 );
 
   int anId;
-  QString
-    isInvisible("not( isVisible )"),
-    isEmpty("numberOfNodes = 0"),
-    isNotEmpty("numberOfNodes <> 0"),
-
-    // has nodes, edges, etc in VISIBLE! actor
-    hasNodes("(numberOfNodes > 0 )"),//&& isVisible)"),
-    hasElems("(count( elemTypes ) > 0)"),
-    hasDifferentElems("(count( elemTypes ) > 1)"),
-    hasElems0d("({'Elem0d'} in elemTypes)"),
-    hasEdges("({'Edge'} in elemTypes)"),
-    hasFaces("({'Face'} in elemTypes)"),
-    hasVolumes("({'Volume'} in elemTypes)");
-
   QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer'" );
   QString aType = QString( "%1type in {%2}" ).arg( lc );
   aType = aType.arg( mesh_group );
@@ -3352,7 +3367,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   popupMgr()->insert( separator(), -1, -1 );
 
   connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ),
-          this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
+           this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
 }
 
 //================================================================================
@@ -3474,7 +3489,7 @@ void SMESHGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& ti
     if ( obj ) {
       QString aName = QString( obj->GetName().c_str() );
       while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup
-         aName.remove( (aName.length() - 1), 1 );
+          aName.remove( (aName.length() - 1), 1 );
       title = aName;
     }
   }
@@ -3751,48 +3766,48 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
     if( name=="selection_object_color" || name=="selection_element_color" ||
         name=="selection_width" || name=="highlight_color" || name=="highlight_width" ||
         name=="selection_precision_node" || name=="selection_precision_element" ||
-       name=="selection_precision_object")
+        name=="selection_precision_object")
       SMESH::UpdateSelectionProp( this );
     else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){
       sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1);
       sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW);
       if(sbX1+sbW > aTol){
-       aWarning = "Origin and Size Vertical: X+Width > 1\n";
-       sbX1=0.01;
-       sbW=0.08;
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
+        aWarning = "Origin and Size Vertical: X+Width > 1\n";
+        sbX1=0.01;
+        sbW=0.08;
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
       }
     }
     else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){
       sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1);
       sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH);
       if(sbY1+sbH > aTol){
-       aWarning = "Origin and Size Vertical: Y+Height > 1\n";
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
+        aWarning = "Origin and Size Vertical: Y+Height > 1\n";
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
       }
     }
     else if(name ==  QString("scalar_bar_horizontal_x") || name ==  QString("scalar_bar_horizontal_width")){
       sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1);
       sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
       if(sbX1+sbW > aTol){
-       aWarning = "Origin and Size Horizontal: X+Width > 1\n";
-       sbX1=0.1;
-       sbW=0.08;
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
+        aWarning = "Origin and Size Horizontal: X+Width > 1\n";
+        sbX1=0.1;
+        sbW=0.08;
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
       }
     }
     else if(name ==  QString("scalar_bar_horizontal_y") || name ==  QString("scalar_bar_horizontal_height")){
       sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1);
       sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH);
       if(sbY1+sbH > aTol){
-       aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
-       sbY1=0.01;
-       sbH=0.08;
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
+        aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
+        sbY1=0.01;
+        sbH=0.08;
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
       }
     }
     else if ( name == "segmentation" ) {
@@ -3807,8 +3822,8 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
     if(aWarning.size() != 0){
       aWarning += "The default values are applied instead.";
       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                              QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
-                              QObject::tr(aWarning.c_str()));
+                               QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
+                               QObject::tr(aWarning.c_str()));
     }
   }
 }
@@ -3900,6 +3915,9 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
     case 417: //convert to quadratic
       op = new SMESHGUI_ConvToQuadOp();
     break;
+    case 418: // create 2D mesh as boundary on 3D
+      op = new SMESHGUI_Make2DFrom3DOp();
+    break;
     case 4067: // make mesh pass through point
       op = new SMESHGUI_MakeNodeAtPointOp();
       break;
@@ -3947,7 +3965,7 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QList<SALOMEDS::Color>& theReser
     {
       aTolerance /= 2;
       if( aTolerance < 1 )
-       break;
+        break;
     }
     //cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< endl;
 
@@ -3968,9 +3986,9 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QList<SALOMEDS::Color>& theReser
       //cout << h << " ";
       if( abs( h - aHue ) < aTolerance )
       {
-       ok = false;
-       //cout << "break (diff = " << abs( h - aHue ) << ")";
-       break;
+        ok = false;
+        //cout << "break (diff = " << abs( h - aHue ) << ")";
+        break;
       }
     }
     //cout << endl;
@@ -4036,19 +4054,19 @@ void SMESHGUI::storeVisualParameters (int savePoint)
       QVector<SUIT_ViewWindow*> views = vman->getViews();
       for (int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++)
       {
-       if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
+        if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
         {
-         VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
-         vtkActorCollection* allActors = aCopy.GetActors();
-         allActors->InitTraversal();
-         while (vtkActor* actor = allActors->GetNextActor())
+          VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+          vtkActorCollection* allActors = aCopy.GetActors();
+          allActors->InitTraversal();
+          while (vtkActor* actor = allActors->GetNextActor())
           {
-           if (actor->GetVisibility()) // store only visible actors
+            if (actor->GetVisibility()) // store only visible actors
             {
               SMESH_Actor* aSmeshActor = 0;
               if (actor->IsA("SMESH_Actor"))
                 aSmeshActor = SMESH_Actor::SafeDownCast(actor);
-             if (aSmeshActor && aSmeshActor->hasIO())
+              if (aSmeshActor && aSmeshActor->hasIO())
               {
                 Handle(SALOME_InteractiveObject) io = aSmeshActor->getIO();
                 if (io->hasEntry())
@@ -4157,10 +4175,10 @@ void SMESHGUI::storeVisualParameters (int savePoint)
                     ip->setParameter(entry, param + QString::number(ipl+1).toLatin1().data(), planeValue);
                   }
                 } // if (io->hasEntry())
-             } // SMESH_Actor && hasIO
-           } // isVisible
-         } // while.. actors traversal
-       } // if (vtkView)
+              } // SMESH_Actor && hasIO
+            } // isVisible
+          } // while.. actors traversal
+        } // if (vtkView)
       } // for (views)
       vtkViewers++;
     } // if (SVTK view model)
@@ -4228,7 +4246,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
       bool ok;
       int viewIndex = viewIndexStr.toUInt(&ok);
       if (!ok) // bad conversion of view index to integer
-       continue;
+        continue;
 
       // viewers
       if (viewerTypStr == SVTK_Viewer::Type())
@@ -4255,7 +4273,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
               // access later when restoring other parameters
               SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
               vtkRenderer* Renderer = vtkView->getRenderer();
-             VTK::ActorCollectionCopy aCopy(Renderer->GetActors());
+              VTK::ActorCollectionCopy aCopy(Renderer->GetActors());
               vtkActorCollection* theActors = aCopy.GetActors();
               theActors->InitTraversal();
               bool isFound = false;
@@ -4276,10 +4294,10 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
             }
           }
         } // if (paramNameStr == "Visibility")
-       else
+        else
         {
           // the rest properties "work" with SMESH_Actor
-         if (aSmeshActor)
+          if (aSmeshActor)
           {
             QString val ((*valuesIt).c_str());
 
@@ -4382,7 +4400,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
               }
             }
           } // if (aSmeshActor)
-       } // other parameters than Visibility
+        } // other parameters than Visibility
       }
     } // for names/parameters iterator
   } // for entries iterator
index 23af4d0e29b541697ff4510af8bb4dd8ab1a33b1..f6960a481de9ab267d1e82ae6464e7fd9b63091b 100644 (file)
@@ -70,7 +70,6 @@ public :
   static SUIT_ResourceMgr*        resourceMgr();
   static SUIT_Desktop*            desktop();
   static SalomeApp_Study*         activeStudy();
-  static char*                    JoinObjectParameters(const QStringList& theParametersList);
   
   bool                            isActiveStudyLocked();
 
@@ -104,6 +103,7 @@ public :
   void                            EmitSignalDeactivateDialog();
   void                            EmitSignalStudyFrameChanged();
   void                            EmitSignalCloseAllDialogs();
+  void                            EmitSignalVisibilityChanged();
 
   virtual void                    contextMenuPopup( const QString&, QMenu*, QString& );
   virtual void                    createPreferences();
@@ -132,6 +132,7 @@ signals:
   void                            SignalDeactivateActiveDialog();
   void                            SignalStudyFrameChanged();
   void                            SignalCloseAllDialogs();
+  void                            SignalVisibilityChanged();
 
 protected:
   void                            createSMESHAction( const int,
index fd617e809019894c351bbf567ae0915e6ecb6847..33c410193b8e2af5db679aaa152ec13da2bed0ca 100644 (file)
@@ -186,11 +186,11 @@ namespace SMESH
       vtkIdList *anIds = vtkIdList::New();
 
       if(aConn)
-       for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
-         anIds->InsertId(i,theIds[aConn[i]]);
+        for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
+          anIds->InsertId(i,theIds[aConn[i]]);
       else
-       for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
-         anIds->InsertId(i,theIds[i]);
+        for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
+          anIds->InsertId(i,theIds[i]);
 
       myGrid->InsertNextCell(theType,anIds);
       anIds->Delete();
@@ -212,8 +212,8 @@ namespace SMESH
     ~TElementSimulation()
     {
       if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
-       myVTKViewWindow->RemoveActor(myPreviewActor);
-       myVTKViewWindow->RemoveActor(myFaceOrientation);
+        myVTKViewWindow->RemoveActor(myPreviewActor);
+        myVTKViewWindow->RemoveActor(myFaceOrientation);
       }
       myPreviewActor->Delete();
       myFaceOrientation->Delete();
@@ -237,7 +237,7 @@ namespace SMESH
 //=================================================================================
 SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
                                                         SMDSAbs_ElementType ElementType,
-                                                       int nbNodes )
+                                                        int nbNodes )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
@@ -466,9 +466,9 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
       aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
     case SMDSAbs_Face: {
       if(myIsPoly)
-       aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
+        aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
       else
-       aMeshEditor->AddFace(anArrayOfIndices.inout());
+        aMeshEditor->AddFace(anArrayOfIndices.inout());
       break;
     }
     case SMDSAbs_Volume:
@@ -536,10 +536,10 @@ void SMESHGUI_AddMeshElementDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -571,12 +571,12 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
     bool allOk = true;
     for (int i = 0; i < aListId.count(); i++) {
       if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
-       {
-         newIndices.Add( n->GetID() );
-         myNbOkNodes++;
-       }
+        {
+          newIndices.Add( n->GetID() );
+          myNbOkNodes++;
+        }
       else
-       allOk = false;  
+        allOk = false;  
     }
 
     mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
@@ -587,10 +587,10 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
 
     if (myIsPoly)
       {
-       if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
-         myNbOkNodes = 0;
-       else
-         myNbOkNodes = aListId.count();
+        if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
+          myNbOkNodes = 0;
+        else
+          myNbOkNodes = aListId.count();
       }
   }
 
index 1c3106e735eb3c1ed149aceebfa603bd56d8d136..4a9fa18acb5efd73a78a38d9d403b79a94a6d581 100644 (file)
@@ -221,7 +221,7 @@ namespace SMESH
     void SetPosition (SMESH_Actor* theActor,
                       const int    theType,
                       TVTKIds&     theIds,
-                     const int    theMode,
+                      const int    theMode,
                       const bool   theReverse)
     {
       vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
@@ -311,8 +311,8 @@ namespace SMESH
     ~TElementSimulation()
     {
       if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
-       myVTKViewWindow->RemoveActor(myPreviewActor);
-       myVTKViewWindow->RemoveActor(myFaceOrientation);
+        myVTKViewWindow->RemoveActor(myPreviewActor);
+        myVTKViewWindow->RemoveActor(myFaceOrientation);
       }
       myPreviewActor->Delete();
       myFaceOrientation->Delete();
@@ -411,7 +411,7 @@ QWidget* IdEditItem::createEditor() const
 // purpose  : constructor
 //=================================================================================
 SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
-                                                                 const int theType )
+                                                                  const int theType )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
@@ -766,10 +766,10 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -797,12 +797,12 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
     for (int i = 0; i < aListId.count(); i++) {
       if ( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
       {
-       newIndices.Add( n->GetID() );
+        newIndices.Add( n->GetID() );
       }
       else
       {
-       allOk = false;
-       break;
+        allOk = false;
+        break;
       }
     }
     
@@ -914,16 +914,16 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
     else
     {
       for ( int row = 0; row < myNbCorners; row++ )
-       anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
+        anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
       
       for ( int row = 0; row < myTable->rowCount(); row++ )
       {
-       anID = myTable->item(row, 1)->text().toInt(&ok);
-       if (!ok) {
-         anID = myTable->item(row, 0)->text().toInt();
-         aDisplayMode = VTK_WIREFRAME;
-       }
-       anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
+        anID = myTable->item(row, 1)->text().toInt(&ok);
+        if (!ok) {
+          anID = myTable->item(row, 0)->text().toInt();
+          aDisplayMode = VTK_WIREFRAME;
+        }
+        anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
       }
     }
     
@@ -1117,7 +1117,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
     // clear table
     for ( int row = 0; row < myTable->rowCount(); row++ )
       for ( int col = 0; col < myTable->columnCount(); col++ )
-       if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
+        if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
     
     myTable->setEnabled( false );
   }
index 2d6b7435bfb7dbc0b048ddf0f0a4495e9904e29a..1e58867d020b787d620e2ecf65bac563ffbd279d 100644 (file)
@@ -289,27 +289,28 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
   if (!isValid())
     return false;
 
+  SMESH::SMESH_Mesh_var aCompoundMesh;
+
   if (!myMesh->_is_nil()) {
     QStringList aParameters;
     aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
-    try        {
+    try {
       SUIT_OverrideCursor aWaitCursor;
 
       SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
       // concatenate meshes
-      SMESH::SMESH_Mesh_var aCompoundMesh;
       if(CheckBoxCommon->isChecked())
-       aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, 
-                                                        !(ComboBoxUnion->currentIndex()), 
-                                                        CheckBoxMerge->isChecked(), 
-                                                        SpinBoxTol->GetValue());
+        aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, 
+                                                         !(ComboBoxUnion->currentIndex()), 
+                                                         CheckBoxMerge->isChecked(), 
+                                                         SpinBoxTol->GetValue());
       else
-       aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, 
-                                              !(ComboBoxUnion->currentIndex()), 
-                                              CheckBoxMerge->isChecked(), 
-                                              SpinBoxTol->GetValue());
+        aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, 
+                                               !(ComboBoxUnion->currentIndex()), 
+                                               CheckBoxMerge->isChecked(), 
+                                               SpinBoxTol->GetValue());
      
-      aCompoundMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+      aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
 
       SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
       mySMESHGUI->updateObjBrowser();
@@ -319,8 +320,16 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
 
     LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH")));
 
-    //mySelectionMgr->clearSelected();
-    SMESH::UpdateView();
+    // IPAL21468 Compound is hidden after creation.
+    if ( SMESHGUI::automaticUpdate() ) {
+      mySelectionMgr->clearSelected();
+      SMESH::UpdateView();
+      
+      _PTR(SObject) aSO = SMESH::FindSObject(aCompoundMesh.in());
+      if ( SMESH_Actor* anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()) )
+        SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
+    }// end IPAL21468
+
     return true;
   }
   return false;
@@ -360,10 +369,10 @@ void SMESHGUI_BuildCompoundDlg::ClickOnHelp()
     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
   else {
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                "application")).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 "application")).
+                             arg(myHelpFileName));
   }
 }
 
index 6f2d9293ecc4f9f201f17a46a447273302202bfc..be11acf6cd20a9c0955a1b37113c7d7c7656c18b 100644 (file)
@@ -72,7 +72,7 @@
 
 class OrientedPlane: public vtkPlane
 {
-  SVTK_ViewWindow* myViewWindow;
+  QPointer<SVTK_ViewWindow> myViewWindow;
 
   vtkDataSetMapper* myMapper;
 
@@ -168,7 +168,8 @@ protected:
   }
 
   ~OrientedPlane(){
-    myViewWindow->RemoveActor(myActor);
+    if (myViewWindow)
+      myViewWindow->RemoveActor(myActor);
     myActor->Delete();
     
     myMapper->RemoveAllInputs();
@@ -264,31 +265,31 @@ void SMESHGUI_ClippingDlg::AddPlane (SMESH_Actor*         theActor,
   vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
 
   vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
-                                      {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+                                       {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
   vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
 
   vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
-                                   aPnt[1] - aDelta[0][1] - aDelta[1][1],
-                                   aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+                                    aPnt[1] - aDelta[0][1] - aDelta[1][1],
+                                    aPnt[2] - aDelta[0][2] - aDelta[1][2]};
   vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
-                                   aPnt01[1] + aNormal[1],
-                                   aPnt01[2] + aNormal[2]};
+                                    aPnt01[1] + aNormal[1],
+                                    aPnt01[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
 
   vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
-                                   aPnt[1] - aDelta[0][1] + aDelta[1][1],
-                                   aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+                                    aPnt[1] - aDelta[0][1] + aDelta[1][1],
+                                    aPnt[2] - aDelta[0][2] + aDelta[1][2]};
   vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
-                                   aPnt11[1] + aNormal[1],
-                                   aPnt11[2] + aNormal[2]};
+                                    aPnt11[1] + aNormal[1],
+                                    aPnt11[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
 
   vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
-                                   aPnt[1] + aDelta[0][1] - aDelta[1][1],
-                                   aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+                                    aPnt[1] + aDelta[0][1] - aDelta[1][1],
+                                    aPnt[2] + aDelta[0][2] - aDelta[1][2]};
   vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
-                                   aPnt21[1] + aNormal[1],
-                                   aPnt21[2] + aNormal[2]};
+                                    aPnt21[1] + aNormal[1],
+                                    aPnt21[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
 
   vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
@@ -555,17 +556,17 @@ void SMESHGUI_ClippingDlg::ClickOnHelp()
   if (app) 
     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
   else {
-               QString platform;
+                QString platform;
 #ifdef WIN32
-               platform = "winapplication";
+                platform = "winapplication";
 #else
-               platform = "application";
+                platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -581,24 +582,24 @@ void SMESHGUI_ClippingDlg::onSelectionChanged()
       Handle(SALOME_InteractiveObject) IOS = aList.First();
       myActor = SMESH::FindActorByEntry(IOS->getEntry());
       if (myActor) {
-       std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
-       myPlanes.clear();
-
-       vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
-       for ( ; anId < anEnd; anId++) {
-         if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
-           if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
-             OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
-             SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
-             anOrientedPlane->Delete();
-             aTVTKPlane->ShallowCopy(aPlane);
-             myPlanes.push_back(aTVTKPlane);
-           }
-         }
-       }
-
-       std::for_each(myPlanes.begin(),myPlanes.end(),
-                     TSetVisiblity(PreviewCheckBox->isChecked()));
+        std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
+        myPlanes.clear();
+
+        vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
+        for ( ; anId < anEnd; anId++) {
+          if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
+            if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
+              OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
+              SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
+              anOrientedPlane->Delete();
+              aTVTKPlane->ShallowCopy(aPlane);
+              myPlanes.push_back(aTVTKPlane);
+            }
+          }
+        }
+
+        std::for_each(myPlanes.begin(),myPlanes.end(),
+                      TSetVisiblity(PreviewCheckBox->isChecked()));
       }
     }
     SMESH::RenderViewWindow(aViewWindow);
@@ -840,31 +841,31 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
   vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
 
   vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
-                                      {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+                                       {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
   vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
 
   vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
-                                   aPnt[1] - aDelta[0][1] - aDelta[1][1],
-                                   aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+                                    aPnt[1] - aDelta[0][1] - aDelta[1][1],
+                                    aPnt[2] - aDelta[0][2] - aDelta[1][2]};
   vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
-                                   aPnt01[1] + aNormal[1],
-                                   aPnt01[2] + aNormal[2]};
+                                    aPnt01[1] + aNormal[1],
+                                    aPnt01[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
 
   vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
-                                   aPnt[1] - aDelta[0][1] + aDelta[1][1],
-                                   aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+                                    aPnt[1] - aDelta[0][1] + aDelta[1][1],
+                                    aPnt[2] - aDelta[0][2] + aDelta[1][2]};
   vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
-                                   aPnt11[1] + aNormal[1],
-                                   aPnt11[2] + aNormal[2]};
+                                    aPnt11[1] + aNormal[1],
+                                    aPnt11[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
 
   vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
-                                   aPnt[1] + aDelta[0][1] - aDelta[1][1],
-                                   aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+                                    aPnt[1] + aDelta[0][1] - aDelta[1][1],
+                                    aPnt[2] + aDelta[0][2] - aDelta[1][2]};
   vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
-                                   aPnt21[1] + aNormal[1],
-                                   aPnt21[2] + aNormal[2]};
+                                    aPnt21[1] + aNormal[1],
+                                    aPnt21[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
 
   vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
index af9829762b20cf065cb3f82ef5f8a5e11171d918..ed92330f27031525500e2a878919f8441eb2c4b7 100644 (file)
@@ -82,16 +82,16 @@ public:
   // used in SMESHGUI::restoreVisualParameters() to avoid
   // declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
   static void             AddPlane (SMESH_Actor*         theActor,
-                                   SVTK_ViewWindow*     theViewWindow,
-                                   SMESH::Orientation   theOrientation,
-                                   double               theDistance,
-                                   vtkFloatingPointType theAngle[2]);
+                                    SVTK_ViewWindow*     theViewWindow,
+                                    SMESH::Orientation   theOrientation,
+                                    double               theDistance,
+                                    vtkFloatingPointType theAngle[2]);
 
   static void             GetPlaneParam (SMESH_Actor*          theActor,
-                                        int                   thePlaneIndex,
-                                        SMESH::Orientation&   theOrientation,
-                                        double&               theDistance,
-                                        vtkFloatingPointType* theAngle);
+                                         int                   thePlaneIndex,
+                                         SMESH::Orientation&   theOrientation,
+                                         double&               theDistance,
+                                         vtkFloatingPointType* theAngle);
 
 protected:  
   void                    keyPressEvent( QKeyEvent* );
index 087c102dfc2667c7eafbb305f5bef61fd867fe0c..60042708182ece6acfc5f87afcd7a7fd97604fb7 100644 (file)
@@ -638,8 +638,8 @@ void SMESHGUI_BaseComputeOp::startOperation()
   int nbSel = selected.Extent();
   if (nbSel != 1) {
     SUIT_MessageBox::warning(desktop(),
-                            tr("SMESH_WRN_WARNING"),
-                            tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+                             tr("SMESH_WRN_WARNING"),
+                             tr("SMESH_WRN_NO_AVAILABLE_DATA"));
     onCancel();
     return;
   }
@@ -648,8 +648,8 @@ void SMESHGUI_BaseComputeOp::startOperation()
   myMesh = SMESH::GetMeshByIO(myIObject);
   if (myMesh->_is_nil()) {
     SUIT_MessageBox::warning(desktop(),
-                            tr("SMESH_WRN_WARNING"),
-                            tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+                             tr("SMESH_WRN_WARNING"),
+                             tr("SMESH_WRN_NO_AVAILABLE_DATA"));
     onCancel();
     return;
   }
@@ -742,9 +742,9 @@ void SMESHGUI_BaseComputeOp::computeMesh()
       LightApp_SelectionMgr *Sel = selectionMgr();
       if ( Sel )
       {
-       SALOME_ListIO selected;
-       selected.Append( myIObject );
-       Sel->setSelectedObjects( selected );
+        SALOME_ListIO selected;
+        selected.Append( myIObject );
+        Sel->setSelectedObjects( selected );
       }
     }
   }
@@ -787,10 +787,10 @@ void SMESHGUI_BaseComputeOp::computeMesh()
 }
 
 void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
-                                               const bool theNoCompError,
-                                               SMESH::compute_error_array_var& theCompErrors,
-                                               const bool     theNoHypoError,
-                                               const QString& theHypErrors )
+                                                const bool theNoCompError,
+                                                SMESH::compute_error_array_var& theCompErrors,
+                                                const bool     theNoHypoError,
+                                                const QString& theHypErrors )
 {
   bool hasShape = myMesh->HasShapeToMesh();
   SMESHGUI_ComputeDlg* aCompDlg = computeDlg();
@@ -855,29 +855,29 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
       {
         SMESH::ComputeError & err = theCompErrors[ row ];
 
-       QString text = err.algoName.in();
-       if ( !tbl->item( row, COL_ALGO ) ) tbl->setItem( row, COL_ALGO, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_ALGO )->setText( text );
+        QString text = err.algoName.in();
+        if ( !tbl->item( row, COL_ALGO ) ) tbl->setItem( row, COL_ALGO, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_ALGO )->setText( text );
 
-       text = SMESH::errorText( err.code, err.comment.in() );
-       if ( !tbl->item( row, COL_ERROR ) ) tbl->setItem( row, COL_ERROR, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_ERROR )->setText( text );
+        text = SMESH::errorText( err.code, err.comment.in() );
+        if ( !tbl->item( row, COL_ERROR ) ) tbl->setItem( row, COL_ERROR, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_ERROR )->setText( text );
 
-       text = QString("%1").arg( err.subShapeID );
-       if ( !tbl->item( row, COL_SHAPEID ) ) tbl->setItem( row, COL_SHAPEID, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_SHAPEID )->setText( text );
+        text = QString("%1").arg( err.subShapeID );
+        if ( !tbl->item( row, COL_SHAPEID ) ) tbl->setItem( row, COL_SHAPEID, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_SHAPEID )->setText( text );
 
         text = hasShape ? SMESH::shapeText( err.subShapeID, myMainShape ) : QString("");
-       if ( !tbl->item( row, COL_SHAPE ) ) tbl->setItem( row, COL_SHAPE, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_SHAPE )->setText( text );
+        if ( !tbl->item( row, COL_SHAPE ) ) tbl->setItem( row, COL_SHAPE, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_SHAPE )->setText( text );
 
         text = ( !hasShape || SMESH::getSubShapeSO( err.subShapeID, myMainShape )) ? "PUBLISHED" : "";
-       if ( !tbl->item( row, COL_PUBLISHED ) ) tbl->setItem( row, COL_PUBLISHED, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
+        if ( !tbl->item( row, COL_PUBLISHED ) ) tbl->setItem( row, COL_PUBLISHED, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
 
         text = err.hasBadMesh ? "hasBadMesh" : "";
-       if ( !tbl->item( row, COL_BAD_MESH ) ) tbl->setItem( row, COL_BAD_MESH, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_BAD_MESH )->setText( text );
+        if ( !tbl->item( row, COL_BAD_MESH ) ) tbl->setItem( row, COL_BAD_MESH, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_BAD_MESH )->setText( text );
         if ( err.hasBadMesh ) hasBadMesh = true;
 
         //tbl->item( row, COL_ERROR )->setWordWrap( true ); // VSR: TODO ???
@@ -1166,6 +1166,8 @@ SMESHGUI_ComputeOp::~SMESHGUI_ComputeOp()
 void SMESHGUI_ComputeOp::startOperation()
 {
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
   computeMesh();
 }
 
@@ -1268,6 +1270,8 @@ void SMESHGUI_PrecomputeOp::startOperation()
   }
 
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
 
   // disconnect slot from preview dialog to have Apply from results of compute operation only 
   disconnect( myDlg, SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
@@ -1377,7 +1381,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
           default: break;
           }
           if ( !algo->_is_nil() )
-           theModeMap[ dim ] = 0;
+            theModeMap[ dim ] = 0;
         }
       }
     }
@@ -1487,7 +1491,7 @@ void SMESHGUI_PrecomputeOp::onPreview()
       myPreviewDisplayer->SetData( previewRes );
       // append shape indeces with computed mesh entities
       for ( int i = 0, n = aShapesId->length(); i < n; i++ )
-       myMapShapeId[ aShapesId[ i ] ] = 0;
+        myMapShapeId[ aShapesId[ i ] ] = 0;
     }
     else
       myPreviewDisplayer->SetVisibility(false);
@@ -1647,6 +1651,8 @@ void SMESHGUI_EvaluateOp::startOperation()
 {
   SMESHGUI_BaseComputeOp::evaluateDlg();
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
   evaluateMesh();
 }
 
@@ -1664,7 +1670,7 @@ LightApp_Dialog* SMESHGUI_EvaluateOp::dlg() const
 
 //================================================================================
 /*!
- * \brief evaluaateMesh()
+ * \brief evaluateMesh()
 */
 //================================================================================
 
@@ -1681,9 +1687,12 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
   SMESH::long_array_var aRes;
 
   _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
+  if ( !aMeshSObj ) //  IPAL21340
+    return;
+
   bool hasShape = myMesh->HasShapeToMesh();
   bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
-  if ( shapeOK && aMeshSObj )
+  if ( shapeOK )
   {
     myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
     SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
@@ -1750,16 +1759,16 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
   // SHOW RESULTS
   if ( isShowResultDlg )
     showEvaluateResult( aRes, memoryLack, noCompError, aCompErrors,
-                       noHypoError, aHypErrors);
+                        noHypoError, aHypErrors);
 }
 
 
 void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes,
-                                               const bool theMemoryLack,
-                                               const bool theNoCompError,
-                                               SMESH::compute_error_array_var& theCompErrors,
-                                               const bool theNoHypoError,
-                                               const QString& theHypErrors)
+                                                const bool theMemoryLack,
+                                                const bool theNoCompError,
+                                                SMESH::compute_error_array_var& theCompErrors,
+                                                const bool theNoHypoError,
+                                                const QString& theHypErrors)
 {
   bool hasShape = myMesh->HasShapeToMesh();
   SMESHGUI_ComputeDlg* aCompDlg = evaluateDlg();
@@ -1816,29 +1825,29 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes,
       {
         SMESH::ComputeError & err = theCompErrors[ row ];
 
-       QString text = err.algoName.in();
-       if ( !tbl->item( row, COL_ALGO ) ) tbl->setItem( row, COL_ALGO, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_ALGO )->setText( text );
+        QString text = err.algoName.in();
+        if ( !tbl->item( row, COL_ALGO ) ) tbl->setItem( row, COL_ALGO, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_ALGO )->setText( text );
 
-       text = SMESH::errorText( err.code, err.comment.in() );
-       if ( !tbl->item( row, COL_ERROR ) ) tbl->setItem( row, COL_ERROR, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_ERROR )->setText( text );
+        text = SMESH::errorText( err.code, err.comment.in() );
+        if ( !tbl->item( row, COL_ERROR ) ) tbl->setItem( row, COL_ERROR, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_ERROR )->setText( text );
 
-       text = QString("%1").arg( err.subShapeID );
-       if ( !tbl->item( row, COL_SHAPEID ) ) tbl->setItem( row, COL_SHAPEID, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_SHAPEID )->setText( text );
+        text = QString("%1").arg( err.subShapeID );
+        if ( !tbl->item( row, COL_SHAPEID ) ) tbl->setItem( row, COL_SHAPEID, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_SHAPEID )->setText( text );
 
         text = hasShape ? SMESH::shapeText( err.subShapeID, myMainShape ) : QString("");
-       if ( !tbl->item( row, COL_SHAPE ) ) tbl->setItem( row, COL_SHAPE, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_SHAPE )->setText( text );
+        if ( !tbl->item( row, COL_SHAPE ) ) tbl->setItem( row, COL_SHAPE, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_SHAPE )->setText( text );
 
         text = ( !hasShape || SMESH::getSubShapeSO( err.subShapeID, myMainShape )) ? "PUBLISHED" : "";
-       if ( !tbl->item( row, COL_PUBLISHED ) ) tbl->setItem( row, COL_PUBLISHED, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
+        if ( !tbl->item( row, COL_PUBLISHED ) ) tbl->setItem( row, COL_PUBLISHED, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
 
         text = err.hasBadMesh ? "hasBadMesh" : "";
-       if ( !tbl->item( row, COL_BAD_MESH ) ) tbl->setItem( row, COL_BAD_MESH, new QTableWidgetItem( text ) );
-       else tbl->item( row, COL_BAD_MESH )->setText( text );
+        if ( !tbl->item( row, COL_BAD_MESH ) ) tbl->setItem( row, COL_BAD_MESH, new QTableWidgetItem( text ) );
+        else tbl->item( row, COL_BAD_MESH )->setText( text );
         if ( err.hasBadMesh ) hasBadMesh = true;
 
         //tbl->item( row, COL_ERROR )->setWordWrap( true ); // VSR: TODO ???
index 85102f3b155c89ccf0cfbc758b63e654e60c3ea2..858cb0b48f05bb50e5bf628c4683b95123a6add1 100644 (file)
@@ -79,18 +79,18 @@ protected:
   SMESHGUI_ComputeDlg*           computeDlg() const;
   void                           computeMesh();
   void                           showComputeResult( const bool,
-                                                   const bool,
-                                                   SMESH::compute_error_array_var&,
-                                                   const bool,
-                                                   const QString& );
+                                                    const bool,
+                                                    SMESH::compute_error_array_var&,
+                                                    const bool,
+                                                    const QString& );
   SMESHGUI_ComputeDlg*           evaluateDlg() const;
   void                           evaluateMesh();
   void                           showEvaluateResult(const SMESH::long_array& theRes,
-                                                   const bool,
-                                                   const bool,
-                                                   SMESH::compute_error_array_var&,
-                                                   const bool,
-                                                   const QString&);
+                                                    const bool,
+                                                    const bool,
+                                                    SMESH::compute_error_array_var&,
+                                                    const bool,
+                                                    const QString&);
     
 protected slots:
   virtual bool                   onApply();
index 962b11abdf95ddca42b1ac344acaa8c4961664b3..15a6d8ff80b15fe5860f6921cffdfdfd203f7373 100644 (file)
 #include <SMESH_TypeFilter.hxx>
 
 // SALOME GUI includes
-#include <SalomeApp_Tools.h>
-#include <SUIT_MessageBox.h>
 #include <LightApp_UpdateFlags.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SalomeApp_Tools.h>
 
 // IDL includes
 #include <SALOMEconfig.h>
@@ -176,6 +177,7 @@ SUIT_SelectionFilter* SMESHGUI_ConvToQuadOp::createFilter( const int theId ) con
 //================================================================================
 bool SMESHGUI_ConvToQuadOp::onApply()
 {
+  SUIT_OverrideCursor aWaitCursor;
 
   QString aMess;
 
@@ -185,7 +187,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
   {
     dlg()->show();
     SUIT_MessageBox::warning( myDlg,
-                             tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
+                              tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
    
     return false;
   }
@@ -196,7 +198,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
   if( CORBA::is_nil(mesh) )
   {
     SUIT_MessageBox::warning( myDlg,
-                             tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
+                              tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
 
     return false;
   } 
@@ -210,7 +212,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
     {
       bool aParam = true;
       if( myDlg->IsEnabledCheck() )
-       aParam = myDlg->IsMediumNdsOnGeom();
+        aParam = myDlg->IsMediumNdsOnGeom();
 
       aEditor->ConvertToQuadratic( aParam );
       aResult = true; 
index e50b7048ca01c56b79aba75afbdbb4dd81f19ed4..5ee6ade482b4bf05fef0da14ef7c594ea18f171f 100755 (executable)
@@ -193,11 +193,11 @@ QWidget* SMESHGUI_CreatePatternDlg::createMainFrame( QWidget* theParent )
   // Connect signals and slots
 
   connect( myTypeGrp,    SIGNAL( buttonClicked( int )  ),
-          this,         SLOT( onTypeChanged( int ) ) );
+           this,         SLOT( onTypeChanged( int ) ) );
   connect( myProjectChk, SIGNAL( toggled( bool ) ),
-          this,         SLOT( onProject( bool ) ) );
+           this,         SLOT( onProject( bool ) ) );
   connect( aSelBtn,      SIGNAL( clicked() ),
-          this,         SLOT( onSelBtnClicked() ) );
+           this,         SLOT( onSelBtnClicked() ) );
 
   return aMainGrp;
 }
@@ -274,11 +274,11 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType )
 
   // selection and SMESHGUI
   connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),
-          this,           SLOT( onSelectionDone() ) );
+           this,           SLOT( onSelectionDone() ) );
   connect( mySMESHGUI,     SIGNAL( SignalDeactivateActiveDialog() ),
-          this,           SLOT( onDeactivate() ) );
+           this,           SLOT( onDeactivate() ) );
   connect( mySMESHGUI,     SIGNAL( SignalCloseAllDialogs() ),
-          this,           SLOT( onClose() ) );
+           this,           SLOT( onClose() ) );
 
   mySwitch2d->setEnabled( theType == Type_2d );
   mySwitch3d->setEnabled( theType == Type_3d );
@@ -342,8 +342,8 @@ bool SMESHGUI_CreatePatternDlg::isValid()
 {
   if ( myGeomObj->_is_nil() ) {
     SUIT_MessageBox::information( this,
-                                 tr( "SMESH_INSUFFICIENT_DATA" ),
-                                 tr( "SMESHGUI_INVALID_PARAMETERS" ) );
+                                  tr( "SMESH_INSUFFICIENT_DATA" ),
+                                  tr( "SMESHGUI_INVALID_PARAMETERS" ) );
     return false;
   }
   return true;
@@ -406,13 +406,13 @@ void SMESHGUI_CreatePatternDlg::onSave()
 
     if ( aWritten != aLen ) {
       SUIT_MessageBox::information( this,
-                                   tr( "SMESH_ERROR" ),
-                                   tr( "ERROR_OF_SAVING" ) );
+                                    tr( "SMESH_ERROR" ),
+                                    tr( "ERROR_OF_SAVING" ) );
     } 
     else {
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
-       aViewWindow->SetSelectionMode( ActorSelection );
+        aViewWindow->SetSelectionMode( ActorSelection );
       disconnect( mySelectionMgr, 0, this, 0 );
       disconnect( mySMESHGUI, 0, this, 0 );
       mySMESHGUI->ResetState();
@@ -465,7 +465,7 @@ void SMESHGUI_CreatePatternDlg::onOk()
     else {
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
-       aViewWindow->SetSelectionMode( ActorSelection );
+        aViewWindow->SetSelectionMode( ActorSelection );
       disconnect( mySelectionMgr, 0, this, 0 );
       disconnect( mySMESHGUI, 0, this, 0 );
       mySMESHGUI->ResetState();
@@ -512,11 +512,11 @@ void SMESHGUI_CreatePatternDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning( this, 
-                             tr( "WRN_WARNING" ),
-                             tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
-                             arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
-                                                                   platform ) ).
-                             arg( myHelpFileName ) );
+                              tr( "WRN_WARNING" ),
+                              tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+                              arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
+                                                                    platform ) ).
+                              arg( myHelpFileName ) );
   }
 }
 
@@ -754,20 +754,20 @@ void SMESHGUI_CreatePatternDlg::activateSelection()
 
   if ( myType == Type_2d ) {
     mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
-                                                          TopAbs_SHAPE,
-                                                          -1,
-                                                          TopAbs_FACE ) );
+                                                           TopAbs_SHAPE,
+                                                           -1,
+                                                           TopAbs_FACE ) );
   } 
   else {
     TColStd_MapOfInteger aTypes;
     aTypes.Add( TopAbs_SHELL );
     aTypes.Add( TopAbs_SOLID );
     mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
-                                                          TopAbs_FACE,
-                                                          6,
-                                                          aTypes,
-                                                          GEOM::GEOM_Object::_nil(),
-                                                          true ) );
+                                                           TopAbs_FACE,
+                                                           6,
+                                                           aTypes,
+                                                           GEOM::GEOM_Object::_nil(),
+                                                           true ) );
   }
 }
 
index a9736fd6155595fc73581cdee274357465eee728..c62b83711ee7a945af2c8762951cc29da944f8e2 100644 (file)
@@ -129,9 +129,9 @@ namespace SMESH
 
     typedef std::vector<vtkIdType> TVTKIds;
     void SetPosition(SMESH_Actor* theActor, 
-                    vtkIdType theType, 
-                    const TVTKIds& theIds,
-                    bool theReset=true)
+                     vtkIdType theType, 
+                     const TVTKIds& theIds,
+                     bool theReset=true)
     {
       vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
       myGrid->SetPoints(aGrid->GetPoints());
@@ -141,14 +141,14 @@ namespace SMESH
       vtkIdList *anIds = vtkIdList::New();
 
       for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
-       anIds->InsertId(i,theIds[i]);
+        anIds->InsertId(i,theIds[i]);
 
       myGrid->InsertNextCell(theType,anIds);
       if(theIds.size()!=0){
-       myGrid->InsertNextCell(theType,anIds);
-       myGrid->Modified();
+        myGrid->InsertNextCell(theType,anIds);
+        myGrid->Modified();
       }
-       
+        
       anIds->Delete();
 
       SetVisibility(true);
@@ -167,7 +167,7 @@ namespace SMESH
 
     ~TPolySimulation(){
       if( myViewWindow )
-       myViewWindow->RemoveActor(myPreviewActor);
+        myViewWindow->RemoveActor(myPreviewActor);
 
       myPreviewActor->Delete();
 
@@ -358,42 +358,42 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
     {
     case 0 :
       { 
-       if ( myActor ){
+        if ( myActor ){
           myActor->SetPointRepresentation(true);
-       }
+        }
         else
           SMESH::SetPointRepresentation(true);
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(NodeSelection);
-       
-       AddButton->setEnabled(false);
-       RemoveButton->setEnabled(false);
-       TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
-       myFacesByNodesLabel->show();
-       myFacesByNodes->clear();
-       myFacesByNodes->show();
-       AddButton->show();
-       RemoveButton->show();
-       Preview->show();
-       break;
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(NodeSelection);
+        
+        AddButton->setEnabled(false);
+        RemoveButton->setEnabled(false);
+        TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
+        myFacesByNodesLabel->show();
+        myFacesByNodes->clear();
+        myFacesByNodes->show();
+        AddButton->show();
+        RemoveButton->show();
+        Preview->show();
+        break;
       }
     case 1 :
       {
-       if( myActor ){
-         myActor->SetPointRepresentation(false);
-       } else {
-         SMESH::SetPointRepresentation(false);
-       }
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(FaceSelection);
-       
-       TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
-       myFacesByNodesLabel->hide();
-       myFacesByNodes->hide();
-       AddButton->hide();
-       RemoveButton->hide();
-       Preview->show();
-       break;
+        if( myActor ){
+          myActor->SetPointRepresentation(false);
+        } else {
+          SMESH::SetPointRepresentation(false);
+        }
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(FaceSelection);
+        
+        TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
+        myFacesByNodesLabel->hide();
+        myFacesByNodes->hide();
+        AddButton->hide();
+        RemoveButton->hide();
+        Preview->show();
+        break;
       }
     }
   
@@ -425,71 +425,71 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
       if(checkEditLine(false) == -1) {return;}
       busy = true;
       if (GetConstructorId() == 0)
-       {
-         SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
-         SMESH::long_array_var aQuantities  = new SMESH::long_array;
-
-         aQuantities->length( myFacesByNodes->count() );
-
-         TColStd_ListOfInteger aNodesIds;
-
-         int aNbQuantities = 0;
-         for (int i = 0; i < myFacesByNodes->count(); i++ ) {
-           QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
-           for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
-             aNodesIds.Append( (*it).toInt() );
-
-           aQuantities[aNbQuantities++] = anIds.count();
-         }
-
-         anIdsOfNodes->length(aNodesIds.Extent());
-
-         int aNbIdsOfNodes = 0;
-         TColStd_ListIteratorOfListOfInteger It;
-         It.Initialize(aNodesIds);
-         for( ;It.More();It.Next())
-           anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
-           
-         try{
-           SUIT_OverrideCursor aWaitCursor;
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
-           aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
-         }catch(SALOME::SALOME_Exception& exc){
-           INFOS("Follow exception was cought:\n\t"<<exc.details.text);
-         }catch(std::exception& exc){
-           INFOS("Follow exception was cought:\n\t"<<exc.what());
-         }catch(...){
-           INFOS("Unknown exception was cought !!!");
-         }
-       }
+        {
+          SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
+          SMESH::long_array_var aQuantities  = new SMESH::long_array;
+
+          aQuantities->length( myFacesByNodes->count() );
+
+          TColStd_ListOfInteger aNodesIds;
+
+          int aNbQuantities = 0;
+          for (int i = 0; i < myFacesByNodes->count(); i++ ) {
+            QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
+            for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
+              aNodesIds.Append( (*it).toInt() );
+
+            aQuantities[aNbQuantities++] = anIds.count();
+          }
+
+          anIdsOfNodes->length(aNodesIds.Extent());
+
+          int aNbIdsOfNodes = 0;
+          TColStd_ListIteratorOfListOfInteger It;
+          It.Initialize(aNodesIds);
+          for( ;It.More();It.Next())
+            anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
+            
+          try{
+            SUIT_OverrideCursor aWaitCursor;
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+            aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
+          }catch(SALOME::SALOME_Exception& exc){
+            INFOS("Follow exception was cought:\n\t"<<exc.details.text);
+          }catch(std::exception& exc){
+            INFOS("Follow exception was cought:\n\t"<<exc.what());
+          }catch(...){
+            INFOS("Unknown exception was cought !!!");
+          }
+        }
       else if (GetConstructorId() == 1)
-       {
-         SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
-         
-         QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
-         anIdsOfFaces->length(aListId.count());
-         for ( int i = 0; i < aListId.count(); i++ )
-           anIdsOfFaces[i] = aListId[i].toInt();
-         
-         try{
-           SUIT_OverrideCursor aWaitCursor;
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
-           aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
-         }catch(SALOME::SALOME_Exception& exc){
-           INFOS("Follow exception was cought:\n\t"<<exc.details.text);
-         }catch(std::exception& exc){
-           INFOS("Follow exception was cought:\n\t"<<exc.what());
-         }catch(...){
-           INFOS("Unknown exception was cought !!!");
-         }
-       }
+        {
+          SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
+          
+          QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+          anIdsOfFaces->length(aListId.count());
+          for ( int i = 0; i < aListId.count(); i++ )
+            anIdsOfFaces[i] = aListId[i].toInt();
+          
+          try{
+            SUIT_OverrideCursor aWaitCursor;
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+            aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
+          }catch(SALOME::SALOME_Exception& exc){
+            INFOS("Follow exception was cought:\n\t"<<exc.details.text);
+          }catch(std::exception& exc){
+            INFOS("Follow exception was cought:\n\t"<<exc.what());
+          }catch(...){
+            INFOS("Unknown exception was cought !!!");
+          }
+        }
       
       //SALOME_ListIO aList;
       //mySelectionMgr->setSelectedObjects( aList );
       SMESH::UpdateView();
       if( myActor ){
-       unsigned int anEntityMode = myActor->GetEntityMode();
-       myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
+        unsigned int anEntityMode = myActor->GetEntityMode();
+        myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
       }
       //ConstructorsClicked( GetConstructorId() );
       busy = false;
@@ -507,7 +507,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk()
   ClickOnCancel();
 }
 
-       
+        
 //=================================================================================
 // function : ClickOnCancel()
 // purpose  :
@@ -543,10 +543,10 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -570,67 +570,67 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
   if (GetConstructorId() == 0)
     {
       if ( aMesh ) {
-       TColStd_MapOfInteger newIndices;
+        TColStd_MapOfInteger newIndices;
       
-       QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
-       for ( int i = 0; i < aListId.count(); i++ ) {
-         const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
-         if ( n ) {
-           newIndices.Add(n->GetID());
-           myNbOkElements++;
-         }
-       }
+        QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
+        for ( int i = 0; i < aListId.count(); i++ ) {
+          const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
+          if ( n ) {
+            newIndices.Add(n->GetID());
+            myNbOkElements++;
+          }
+        }
       
-       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+        mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
       
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->highlight( myActor->getIO(), true, true );
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->highlight( myActor->getIO(), true, true );
       
-       if ( myNbOkElements>0 && aListId.count()>=3)
-         AddButton->setEnabled(true);
-       else
-         AddButton->setEnabled(false);
+        if ( myNbOkElements>0 && aListId.count()>=3)
+          AddButton->setEnabled(true);
+        else
+          AddButton->setEnabled(false);
       
-       displaySimulation();
+        displaySimulation();
       }
     } else if (GetConstructorId() == 1)
       {
-       myNbOkElements = 0;
-       buttonOk->setEnabled( false );
-       buttonApply->setEnabled( false );
+        myNbOkElements = 0;
+        buttonOk->setEnabled( false );
+        buttonApply->setEnabled( false );
       
-       // check entered ids of faces and hilight them
-       QStringList aListId;
-       if ( aMesh ) {
-         TColStd_MapOfInteger newIndices;
+        // check entered ids of faces and hilight them
+        QStringList aListId;
+        if ( aMesh ) {
+          TColStd_MapOfInteger newIndices;
       
-         aListId = theNewText.split( " ", QString::SkipEmptyParts );
-
-         for ( int i = 0; i < aListId.count(); i++ ) {
-           const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
-           if ( e ) {
-             newIndices.Add(e->GetID());
-             myNbOkElements++;  
-           }
-         }
-
-         mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->highlight( myActor->getIO(), true, true );
+          aListId = theNewText.split( " ", QString::SkipEmptyParts );
+
+          for ( int i = 0; i < aListId.count(); i++ ) {
+            const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
+            if ( e ) {
+              newIndices.Add(e->GetID());
+              myNbOkElements++;  
+            }
+          }
+
+          mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->highlight( myActor->getIO(), true, true );
       
-         if ( myNbOkElements ) {
-           if (aListId.count()>1){ 
-             buttonOk->setEnabled( true );
-             buttonApply->setEnabled( true );
-           }
-           else{
-             buttonOk->setEnabled( false );
-             buttonApply->setEnabled( false );
-           }
-           if(aListId.count()>1)
-             displaySimulation();
-         }
-       }
+          if ( myNbOkElements ) {
+            if (aListId.count()>1){ 
+              buttonOk->setEnabled( true );
+              buttonApply->setEnabled( true );
+            }
+            else{
+              buttonOk->setEnabled( false );
+              buttonApply->setEnabled( false );
+            }
+            if(aListId.count()>1)
+              displaySimulation();
+          }
+        }
       }
   busy = false;
 }
@@ -749,13 +749,13 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast)
     case 0:{ // nodes
       const SMDS_MeshNode    * aNode = aMesh->FindNode( aListId[ i ].toInt() );
       if( !aNode ){
-       SUIT_MessageBox::warning(this,
-                                tr("SMESH_POLYEDRE_CREATE_ERROR"),
-                                tr("The incorrect indices of nodes!"));
-       
-       myEditCurrentArgument->clear();
-       myEditCurrentArgument->setText( aString );
-       return -1;
+        SUIT_MessageBox::warning(this,
+                                 tr("SMESH_POLYEDRE_CREATE_ERROR"),
+                                 tr("The incorrect indices of nodes!"));
+        
+        myEditCurrentArgument->clear();
+        myEditCurrentArgument->setText( aString );
+        return -1;
       }
 
       break;
@@ -764,24 +764,24 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast)
       bool aElemIsOK = true;
       const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() );
       if (!aElem)
-       {
-         aElemIsOK = false;
-       }
+        {
+          aElemIsOK = false;
+        }
       else
-       {
-         SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
-         if (aType != SMDSAbs_Face){
-           aElemIsOK = false;
-         }
-       }
+        {
+          SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
+          if (aType != SMDSAbs_Face){
+            aElemIsOK = false;
+          }
+        }
       if (!aElemIsOK){
-       SUIT_MessageBox::warning(this,
-                                tr("SMESH_POLYEDRE_CREATE_ERROR"),
-                                tr("The incorrect indices of faces!"));
-       
-       myEditCurrentArgument->clear();
-       myEditCurrentArgument->setText( aString );
-       return -1;
+        SUIT_MessageBox::warning(this,
+                                 tr("SMESH_POLYEDRE_CREATE_ERROR"),
+                                 tr("The incorrect indices of faces!"));
+        
+        myEditCurrentArgument->clear();
+        myEditCurrentArgument->setText( aString );
+        return -1;
       }
       break;
     }
@@ -804,66 +804,66 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation()
       vtkIdType aType = VTK_CONVEX_POINT_SET;
       SMDS_Mesh* aMesh = 0;
       if ( myActor ){
-       aMesh = myActor->GetObject()->GetMesh();
+        aMesh = myActor->GetObject()->GetMesh();
       }
       if (GetConstructorId() == 0 && aMesh){
-       if (!AddButton->isEnabled()){
-         mySimulation->ResetGrid(true);
-         for (int i = 0; i < myFacesByNodes->count(); i++) {
-           QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
-           SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
-           for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
-             const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
-             if (!aNode) continue;
-             vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
-             aVTKIds.push_back(aId);
-             aVTKIds_faces.push_back(aId);
-           }
-           if(!Preview->isChecked()){
-             aType = VTK_POLYGON;
-             mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
-           }
-         }
-         if(myFacesByNodes->count() == 0){
-           mySimulation->SetVisibility(false);
-         } else {
-           mySimulation->SetVisibility(true);
-         }
-         if(Preview->isChecked()){
-           mySimulation->SetPosition(myActor, aType, aVTKIds);
-         }
-       } else {
-         // add ids from edit line
-         QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
-         for ( int i = 0; i < anEditIds.count(); i++ )
-           aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
-         aType = VTK_POLYGON;
-         mySimulation->SetPosition(myActor, aType, aVTKIds);
-       }
+        if (!AddButton->isEnabled()){
+          mySimulation->ResetGrid(true);
+          for (int i = 0; i < myFacesByNodes->count(); i++) {
+            QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
+            SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
+            for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
+              const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
+              if (!aNode) continue;
+              vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
+              aVTKIds.push_back(aId);
+              aVTKIds_faces.push_back(aId);
+            }
+            if(!Preview->isChecked()){
+              aType = VTK_POLYGON;
+              mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
+            }
+          }
+          if(myFacesByNodes->count() == 0){
+            mySimulation->SetVisibility(false);
+          } else {
+            mySimulation->SetVisibility(true);
+          }
+          if(Preview->isChecked()){
+            mySimulation->SetPosition(myActor, aType, aVTKIds);
+          }
+        } else {
+          // add ids from edit line
+          QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+          for ( int i = 0; i < anEditIds.count(); i++ )
+            aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
+          aType = VTK_POLYGON;
+          mySimulation->SetPosition(myActor, aType, aVTKIds);
+        }
       }else if(GetConstructorId() == 1 && aMesh){
-       QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
-       for ( int i = 0; i < aListId.count(); i++ )
-         {
-           const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
-           if ( !anElem ) continue;
-           SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
-           if (aFaceType != SMDSAbs_Face) continue;
-             
-           SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
-           SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
-           while( anIter->more() )
-             if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
-               vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
-               aVTKIds.push_back(aId);
-               aVTKIds_faces.push_back(aId);
-             }
-           if(!Preview->isChecked()){
-             aType = VTK_POLYGON;
-             mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
-           }
-         }
-       if(Preview->isChecked())
-         mySimulation->SetPosition(myActor, aType, aVTKIds);
+        QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+        for ( int i = 0; i < aListId.count(); i++ )
+          {
+            const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
+            if ( !anElem ) continue;
+            SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
+            if (aFaceType != SMDSAbs_Face) continue;
+              
+            SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
+            SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
+            while( anIter->more() )
+              if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
+                vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
+                aVTKIds.push_back(aId);
+                aVTKIds_faces.push_back(aId);
+              }
+            if(!Preview->isChecked()){
+              aType = VTK_POLYGON;
+              mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
+            }
+          }
+        if(Preview->isChecked())
+          mySimulation->SetPosition(myActor, aType, aVTKIds);
       }
       SMESH::UpdateView();
     }
index 6e2a106a244b79dd743e9cc90c6de371c518d177..1922e70deab2a5cadf395655f4e18650979800ba 100644 (file)
@@ -189,7 +189,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid()
 {
   if (myListBox->count() == 0) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                tr("NO_SELECTED_GROUPS"));
+                                 tr("NO_SELECTED_GROUPS"));
     return false;
   }
 
@@ -266,10 +266,10 @@ void SMESHGUI_DeleteGroupDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
index 7da64f71ee55f1f57991d6121361a8dca0cc6967..eb60f800b4b295d51fe6605563268c4ae3923b4d 100644 (file)
@@ -44,8 +44,8 @@ class SMESHGUI_EXPORT SMESHGUI_Dialog : public LightApp_Dialog
   Q_OBJECT
   
 public:
-  SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false, 
-                  const int = OK | Close | Apply | Help );
+  SMESHGUI_Dialog( QWidget* = 0, const bool modal = false, const bool allowResize = false, 
+                   const int = OK | Close | Apply | Help );
   virtual ~SMESHGUI_Dialog();
 
   virtual void      show();
index 613fbb9e4349512b65c611b9c7b4d371140b999a..0b41a00d0a20c63f7e3e5fb18d7a2155adafe88a 100644 (file)
@@ -59,16 +59,16 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
       SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
       SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
       if( !anActor )
-       anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
+        anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
       if( anActor )
       {
-       SMESH::DisplayActor( wnd, anActor );
+        SMESH::DisplayActor( wnd, anActor );
         prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame );
       }
       if( prs )
-       UpdatePrs( prs );
+        UpdatePrs( prs );
       else if( anActor )
-       SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
+        SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
     }
   }
 
index c8aa3710d2feee3cbab5bfc885446167c9a7096b..5c84c204b21e0656ad24293091323b7b2b13cb12 100644 (file)
@@ -169,7 +169,7 @@ namespace SMESH
     }
 
     void SetPointsData ( SMDS_Mesh* theMesh, 
-                        TColStd_MapOfInteger & theNodesIdMap )
+                         TColStd_MapOfInteger & theNodesIdMap )
     {
       vtkPoints* aPoints = vtkPoints::New();
       aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
@@ -177,9 +177,9 @@ namespace SMESH
       
       TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
       for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
-       const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
-       aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
-       myIDs.push_back(idIter.Key());
+        const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
+        aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
+        myIDs.push_back(idIter.Key());
       }
 
       myIdGrid->SetPoints(aPoints);
@@ -190,7 +190,7 @@ namespace SMESH
     }
 
     void SetElemsData( TColStd_MapOfInteger & theElemsIdMap, 
-                      std::list<gp_XYZ> & aGrCentersXYZ )
+                       std::list<gp_XYZ> & aGrCentersXYZ )
     {
       vtkPoints* aPoints = vtkPoints::New();
       aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
@@ -198,14 +198,14 @@ namespace SMESH
       
       TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
       for( ; idIter.More(); idIter.Next() ) {
-       myIDs.push_back(idIter.Key());
+        myIDs.push_back(idIter.Key());
       }
 
       gp_XYZ aXYZ;
       std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
       for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
-       aXYZ = *coordIt;
-       aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
+        aXYZ = *coordIt;
+        aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
       }
       myIdGrid->SetPoints(aPoints);
       aPoints->Delete();
@@ -234,20 +234,20 @@ namespace SMESH
       myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
       
       if ( myIsPointsLabeled ) {
-       myPointsNumDataSet->ShallowCopy(myIdGrid);
-       vtkDataSet *aDataSet = myPointsNumDataSet;
-       int aNbElem = myIDs.size();
-       vtkIntArray *anArray = vtkIntArray::New();
-       anArray->SetNumberOfValues( aNbElem );
-       for ( int i = 0; i < aNbElem; i++ )
-         anArray->SetValue( i, myIDs[i] );
-       aDataSet->GetPointData()->SetScalars( anArray );
-       anArray->Delete();
-       myPtsMaskPoints->SetInput( aDataSet );
-       myPointLabels->SetVisibility( theIsActorVisible );
+        myPointsNumDataSet->ShallowCopy(myIdGrid);
+        vtkDataSet *aDataSet = myPointsNumDataSet;
+        int aNbElem = myIDs.size();
+        vtkIntArray *anArray = vtkIntArray::New();
+        anArray->SetNumberOfValues( aNbElem );
+        for ( int i = 0; i < aNbElem; i++ )
+          anArray->SetValue( i, myIDs[i] );
+        aDataSet->GetPointData()->SetScalars( anArray );
+        anArray->Delete();
+        myPtsMaskPoints->SetInput( aDataSet );
+        myPointLabels->SetVisibility( theIsActorVisible );
       }
       else {
-       myPointLabels->SetVisibility( false );
+        myPointLabels->SetVisibility( false );
       }
     }
     
@@ -270,7 +270,7 @@ namespace SMESH
       //myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
       myPtsSelectVisiblePoints->Delete();
 
-      //myPtsMaskPoints->UnRegisterAllOutputs();         //vtk 5.0 porting
+      //myPtsMaskPoints->UnRegisterAllOutputs();          //vtk 5.0 porting
       myPtsMaskPoints->Delete();
 
       myPointLabels->Delete();
@@ -282,8 +282,8 @@ namespace SMESH
 
 static const char * IconFirst[] = {
 "18 10 2 1",
-"      g None",
-".     g #000000",
+"       g None",
+".      g #000000",
 "         .     .  ",
 "  ..    ..    ..  ",
 "  ..   ...   ...  ",
@@ -300,7 +300,7 @@ static const char * IconFirst[] = {
 // purpose  :
 //=================================================================================
 SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, 
-                                           int theAction)
+                                            int theAction)
   : QDialog(SMESH::GetDesktop(theModule)),
     mySMESHGUI(theModule),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
@@ -327,9 +327,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
 
   /***************************************************************/
   GroupConstructors = new QGroupBox(myAction == 1 ? 
-                                   tr("SMESH_MERGE_ELEMENTS") : 
-                                   tr("SMESH_MERGE_NODES"), 
-                                   this);
+                                    tr("SMESH_MERGE_ELEMENTS") : 
+                                    tr("SMESH_MERGE_NODES"), 
+                                    this);
 
   QButtonGroup* ButtonGroup = new QButtonGroup(this);
   QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
@@ -362,9 +362,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
   /***************************************************************/
   // Controls for coincident elements detecting
   GroupCoincident = new QGroupBox(myAction == 1 ? 
-                                 tr("COINCIDENT_ELEMENTS") : 
-                                 tr("COINCIDENT_NODES"), 
-                                 this);
+                                  tr("COINCIDENT_ELEMENTS") : 
+                                  tr("COINCIDENT_NODES"), 
+                                  this);
 
   QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
   GroupCoincidentLayout->setSpacing(SPACING);
@@ -542,7 +542,7 @@ void SMESHGUI_EditMeshDlg::Init()
 // purpose  :
 //=================================================================================
 void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap, 
-                                            std::list< gp_XYZ > & theGrCentersXYZ)
+                                             std::list< gp_XYZ > & theGrCentersXYZ)
 {
   if (!myActor)
     return;
@@ -659,10 +659,10 @@ void SMESHGUI_EditMeshDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -722,15 +722,15 @@ void SMESHGUI_EditMeshDlg::onDetect()
     switch (myAction) {
     case 0 :
       if(!mySubMeshOrGroup->_is_nil())
-       aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
+        aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
       else
-       aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
+        aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
       break;
     case 1 :
       if(!mySubMeshOrGroup->_is_nil())
-       aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
+        aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
       else
-       aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
+        aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
       break;
     }
     
@@ -739,7 +739,7 @@ void SMESHGUI_EditMeshDlg::onDetect()
 
       QStringList anIDs;
       for (int j = 0; j < aGroup.length(); j++)
-       anIDs.append(QString::number(aGroup[j]));
+        anIDs.append(QString::number(aGroup[j]));
 
       ListCoincident->addItem(anIDs.join(" "));
     }
@@ -1044,11 +1044,11 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument()
     if (myAction == 0) {
       SMESH::SetPointRepresentation(true);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(NodeSelection);
+        aViewWindow->SetSelectionMode(NodeSelection);
     }
     else
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(CellSelection);
+        aViewWindow->SetSelectionMode(CellSelection);
   }
 }
 
index 3b96bede4aaa0842ad95e7ead9ab2f2db9e98ebb..14b3d9ff77c33e9fc22a69965b5160a952d4514e 100644 (file)
@@ -83,7 +83,7 @@ private:
   void                      onEditGroup();
 
   void                      FindGravityCenter( TColStd_MapOfInteger&, 
-                                              std::list<gp_XYZ>& );
+                                               std::list<gp_XYZ>& );
   // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
 
 private:
index 8d1d9c300495462cc4eb31d76c81c8da8e94e78a..2131b25e6c403ce886222b302a82541b1ecc1090 100644 (file)
@@ -354,9 +354,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
   connect(mySMESHGUI,  SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
 
   connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
-         SLOT(onTextChange(const QString&)));
+          SLOT(onTextChange(const QString&)));
   connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
-         SLOT(onTextChange(const QString&)));
+          SLOT(onTextChange(const QString&)));
 
   connect(MeshCheck,      SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
 
@@ -440,19 +440,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
     SMESH::SetPointRepresentation(false);
     if (MeshCheck->isChecked()) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(ActorSelection);
+        aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myElementsFilter);
     } else {
       if (type == 0)
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(EdgeSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(EdgeSelection);
+        }
       if (type == 1)
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(FaceSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(FaceSelection);
+        }
     }
   }
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@@ -492,16 +492,16 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
       bool bOk;
       int j = 0;
       for (int i = 0; i < aListElementsId.count(); i++) {
-       long ind = aListElementsId[ i ].toLong(&bOk);
-       if  (bOk) {
-         const SMDS_MeshElement* e = aMesh->FindElement(ind);
-         if (e) {
-           bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
-                            Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
-           if (typeMatch)
-             anElementsId[ j++ ] = ind;
-         }
-       }
+        long ind = aListElementsId[ i ].toLong(&bOk);
+        if  (bOk) {
+          const SMDS_MeshElement* e = aMesh->FindElement(ind);
+          if (e) {
+            bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
+                             Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
+            if (typeMatch)
+              anElementsId[ j++ ] = ind;
+          }
+        }
       }
       anElementsId->length(j);
     }
@@ -559,44 +559,44 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
     /*
     if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
       if( MeshCheck->isChecked() ) {
-       if( GetConstructorId() == 0 )
-         SMESH::ListOfGroups_var groups = 
-           aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
-                                                             myPathShape, aNodeStart,
-                                                             AnglesGrp->isChecked(), anAngles,
-                                                             BasePointGrp->isChecked(), aBasePoint, retVal);
-       else
-         SMESH::ListOfGroups_var groups = 
-           aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
-                                                             myPathShape, aNodeStart,
-                                                             AnglesGrp->isChecked(), anAngles,
-                                                             BasePointGrp->isChecked(), aBasePoint, retVal);
+        if( GetConstructorId() == 0 )
+          SMESH::ListOfGroups_var groups = 
+            aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
+                                                              myPathShape, aNodeStart,
+                                                              AnglesGrp->isChecked(), anAngles,
+                                                              BasePointGrp->isChecked(), aBasePoint, retVal);
+        else
+          SMESH::ListOfGroups_var groups = 
+            aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
+                                                              myPathShape, aNodeStart,
+                                                              AnglesGrp->isChecked(), anAngles,
+                                                              BasePointGrp->isChecked(), aBasePoint, retVal);
       }
       else
-       SMESH::ListOfGroups_var groups = 
-         aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
-                                                   myPathShape, aNodeStart,
-                                                   AnglesGrp->isChecked(), anAngles,
-                                                   BasePointGrp->isChecked(), aBasePoint, retVal);
+        SMESH::ListOfGroups_var groups = 
+          aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
+                                                    myPathShape, aNodeStart,
+                                                    AnglesGrp->isChecked(), anAngles,
+                                                    BasePointGrp->isChecked(), aBasePoint, retVal);
     }
     else {
       if( MeshCheck->isChecked() ) {
-       if( GetConstructorId() == 0 )
-         retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
-                                                          myPathShape, aNodeStart,
-                                                          AnglesGrp->isChecked(), anAngles,
-                                                          BasePointGrp->isChecked(), aBasePoint);
-       else
-         retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
-                                                          myPathShape, aNodeStart,
-                                                          AnglesGrp->isChecked(), anAngles,
-                                                          BasePointGrp->isChecked(), aBasePoint);
+        if( GetConstructorId() == 0 )
+          retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
+                                                           myPathShape, aNodeStart,
+                                                           AnglesGrp->isChecked(), anAngles,
+                                                           BasePointGrp->isChecked(), aBasePoint);
+        else
+          retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
+                                                           myPathShape, aNodeStart,
+                                                           AnglesGrp->isChecked(), anAngles,
+                                                           BasePointGrp->isChecked(), aBasePoint);
       }
       else
-       retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
-                                                myPathShape, aNodeStart,
-                                                AnglesGrp->isChecked(), anAngles,
-                                                BasePointGrp->isChecked(), aBasePoint);
+        retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
+                                                 myPathShape, aNodeStart,
+                                                 AnglesGrp->isChecked(), anAngles,
+                                                 BasePointGrp->isChecked(), aBasePoint);
     }
     */
 
@@ -606,55 +606,55 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
       ElemType = SMESH::EDGE;
     if( !MeshCheck->isChecked() ) {
       SMESH::ListOfGroups_var groups = 
-       aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
-                                        anAngles, LinearAnglesCheck->isChecked(),
-                                        BasePointGrp->isChecked(), aBasePoint,
-                                        NeedGroups, ElemType, retVal);
+        aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
+                                         anAngles, LinearAnglesCheck->isChecked(),
+                                         BasePointGrp->isChecked(), aBasePoint,
+                                         NeedGroups, ElemType, retVal);
     }
     else {
       SMESH::ListOfGroups_var groups = 
-       aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
-                                         anAngles, LinearAnglesCheck->isChecked(),
-                                         BasePointGrp->isChecked(), aBasePoint,
-                                         NeedGroups, ElemType, retVal);
+        aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
+                                          anAngles, LinearAnglesCheck->isChecked(),
+                                          BasePointGrp->isChecked(), aBasePoint,
+                                          NeedGroups, ElemType, retVal);
     }
 
 
     if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
-      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
 
     //wc.stop();
     wc.suspend();
     switch (retVal) {
     case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
       SUIT_MessageBox::warning(this,
-                              tr("SMESH_ERROR"),
-                              tr("NO_ELEMENTS_SELECTED"));
+                               tr("SMESH_ERROR"),
+                               tr("NO_ELEMENTS_SELECTED"));
       return false; break;
     case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
       SUIT_MessageBox::warning(this,
-                              tr("SMESH_ERROR"),
-                              tr("SELECTED_PATH_IS_NOT_EDGE"));
+                               tr("SMESH_ERROR"),
+                               tr("SELECTED_PATH_IS_NOT_EDGE"));
       return false; break;
     case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
       SUIT_MessageBox::warning(this,
-                              tr("SMESH_ERROR"),
-                              tr("BAD_SHAPE_TYPE"));
+                               tr("SMESH_ERROR"),
+                               tr("BAD_SHAPE_TYPE"));
       return false; break;
     case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
       SUIT_MessageBox::warning(this,
-                              tr("SMESH_ERROR"),
-                              tr("EXTR_BAD_STARTING_NODE"));
+                               tr("SMESH_ERROR"),
+                               tr("EXTR_BAD_STARTING_NODE"));
       return false; break;
     case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
       SUIT_MessageBox::warning(this,
-                              tr("SMESH_ERROR"),
-                              tr("WRONG_ANGLES_NUMBER"));
+                               tr("SMESH_ERROR"),
+                               tr("WRONG_ANGLES_NUMBER"));
       return false; break;
     case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
       SUIT_MessageBox::warning(this,
-                              tr("SMESH_ERROR"),
-                              tr("CANT_GET_TANGENT"));
+                               tr("SMESH_ERROR"),
+                               tr("CANT_GET_TANGENT"));
       return false; break;
     case SMESH::SMESH_MeshEditor::EXTR_OK:
       break;
@@ -700,10 +700,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -762,21 +762,21 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
       const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
       TColStd_MapOfInteger newIndices;
       for (int i = 0; i < aListId.count(); i++) {
-       long ind = aListId[ i ].toLong(&bOk);
-       if (bOk) {
-         const SMDS_MeshElement* e = aMesh->FindElement(ind);
-         if (e) {
-           // check also type of element
-           bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
-                            Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
-           if (typeMatch)
-             newIndices.Add(e->GetID());
-         }
-       }
+        long ind = aListId[ i ].toLong(&bOk);
+        if (bOk) {
+          const SMDS_MeshElement* e = aMesh->FindElement(ind);
+          if (e) {
+            // check also type of element
+            bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
+                             Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
+            if (typeMatch)
+              newIndices.Add(e->GetID());
+          }
+        }
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( anIO, true, true );
+        aViewWindow->highlight( anIO, true, true );
     }
   }
   else if (send == StartPointLineEdit &&
@@ -785,27 +785,27 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
       SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
       SMDS_Mesh* aMesh = 0;
       if (aPathActor)
-       aMesh = aPathActor->GetObject()->GetMesh();
+        aMesh = aPathActor->GetObject()->GetMesh();
       if (aMesh) {
-       //mySelectionMgr->clearSelected();
-       //mySelectionMgr->AddIObject(aPathActor->getIO());
+        //mySelectionMgr->clearSelected();
+        //mySelectionMgr->AddIObject(aPathActor->getIO());
         SALOME_ListIO aList;
         aList.Append(aPathActor->getIO());
         mySelectionMgr->setSelectedObjects(aList, false);
 
-       bool bOk;
-       long ind = theNewText.toLong(&bOk);
-       if (bOk) {
-         const SMDS_MeshNode* n = aMesh->FindNode(ind);
-         if (n) {
-           //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
+        bool bOk;
+        long ind = theNewText.toLong(&bOk);
+        if (bOk) {
+          const SMDS_MeshNode* n = aMesh->FindNode(ind);
+          if (n) {
+            //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
             TColStd_MapOfInteger newIndices;
-           newIndices.Add(n->GetID());
-           mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
-           if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-             aViewWindow->highlight( aPathActor->getIO(), true, true );
-         }
-       }
+            newIndices.Add(n->GetID());
+            mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
+            if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+              aViewWindow->highlight( aPathActor->getIO(), true, true );
+          }
+        }
       }
     }
   }
@@ -929,10 +929,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
     TopoDS_Vertex aVertex;
     if (!aGeomObj->_is_nil()) {
       if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
-       gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
-       XSpin->SetValue(aPnt.X());
-       YSpin->SetValue(aPnt.Y());
-       ZSpin->SetValue(aPnt.Z());
+        gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
+        XSpin->SetValue(aPnt.X());
+        YSpin->SetValue(aPnt.Y());
+        ZSpin->SetValue(aPnt.Z());
       }
       return;
     }
@@ -997,19 +997,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
     SMESH::SetPointRepresentation(false);
     if (MeshCheck->isChecked()) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(ActorSelection);
+        aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myElementsFilter);
     } else {
       if (Elements1dRB->isChecked())
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(EdgeSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(EdgeSelection);
+        }
       else if (Elements2dRB->isChecked())
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(FaceSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(FaceSelection);
+        }
     }
   } else if (button == SelectPathMeshButton) {
     myEditCurrentArgument = PathMeshLineEdit;
@@ -1024,10 +1024,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
     if (!myPath->_is_nil()) {
       SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
       if (aPathActor) {
-       SMESH::SetPointRepresentation(true);
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(NodeSelection);
-       SMESH::SetPickable(aPathActor);
+        SMESH::SetPointRepresentation(true);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(NodeSelection);
+        SMESH::SetPickable(aPathActor);
       }
     }
   }
@@ -1172,21 +1172,21 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event
     QKeyEvent* ke = (QKeyEvent*)event;
     if (object == AnglesList) {
       if (ke->key() == Qt::Key_Delete)
-       OnAngleRemoved();
+        OnAngleRemoved();
     }
   }
   else if (event->type() == QEvent::FocusIn) {
     if (object == ElementsLineEdit) {
       if (myEditCurrentArgument != ElementsLineEdit)
-       SetEditCurrentArgument(SelectElementsButton);
+        SetEditCurrentArgument(SelectElementsButton);
     }
     else if (object == StartPointLineEdit) {
       if (myEditCurrentArgument != StartPointLineEdit)
-       SetEditCurrentArgument(SelectStartPointButton);
+        SetEditCurrentArgument(SelectStartPointButton);
     }
     else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
       if (myEditCurrentArgument != XSpin)
-       SetEditCurrentArgument(SelectBasePointButton);
+        SetEditCurrentArgument(SelectBasePointButton);
     }
   }
   return QDialog::eventFilter(object, event);
@@ -1216,8 +1216,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
@@ -1270,7 +1270,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
       enableLinear = false;
       anItem->text().toDouble(&enableLinear);
       if( !enableLinear )
-       break;
+        break;
     }
   }
   if( !enableLinear )
index 2ed9123835b509ec3bde2c6d902449c572bd2f66..7c32fc1e24b9b94fd64d8344609f63923d715dd4 100644 (file)
@@ -400,24 +400,24 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
     {
       GroupArguments->setTitle(tr("EXTRUSION_1D"));
       if (!CheckBoxMesh->isChecked())
-       {
-         LineEditElements->clear();
-         myIDs.clear();
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(EdgeSelection);
-       }
+        {
+          LineEditElements->clear();
+          myIDs.clear();
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(EdgeSelection);
+        }
       break;
     }
   case 1:
     {
       GroupArguments->setTitle(tr("EXTRUSION_2D"));
       if (!CheckBoxMesh->isChecked())
-       {
-         LineEditElements->clear();
-         myIDs.clear();
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(FaceSelection);
-       }
+        {
+          LineEditElements->clear();
+          myIDs.clear();
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(FaceSelection);
+        }
       break;
     }
   }
@@ -509,8 +509,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
       aParameters << SpinBox_Dz->text();
     } else if ( RadioButton4->isChecked() ) {
       gp_XYZ aNormale(SpinBox_Vx->GetValue(),
-                     SpinBox_Vy->GetValue(),
-                     SpinBox_Vz->GetValue());
+                      SpinBox_Vy->GetValue(),
+                      SpinBox_Vz->GetValue());
     
      
       aNormale /= aNormale.Modulus();
@@ -536,29 +536,29 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
 
       if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
         if( CheckBoxMesh->isChecked() ) {
-         if( GetConstructorId() == 0 )
-           SMESH::ListOfGroups_var groups = 
-             aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
-         else
-           SMESH::ListOfGroups_var groups = 
-             aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
-       }
-       else
-         SMESH::ListOfGroups_var groups = 
-           aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
+          if( GetConstructorId() == 0 )
+            SMESH::ListOfGroups_var groups = 
+              aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
+          else
+            SMESH::ListOfGroups_var groups = 
+              aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
+        }
+        else
+          SMESH::ListOfGroups_var groups = 
+            aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
       }
       else {
-       if( CheckBoxMesh->isChecked() ) {
-         if( GetConstructorId() == 0 )
-           aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
-         else
-           aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
-       }
-       else
-         aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+        if( CheckBoxMesh->isChecked() ) {
+          if( GetConstructorId() == 0 )
+            aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
+          else
+            aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+        }
+        else
+          aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
       }
 
-      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
 
     } catch (...) {
     }
@@ -611,10 +611,10 @@ void SMESHGUI_ExtrusionDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -666,7 +666,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
       myElementsId->length( myNbOkElements = newIndices.Extent() );
       mySelector->AddOrRemoveIndex(myIO, newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( myIO, true, true );
+        aViewWindow->highlight( myIO, true, true );
     }
   }
 
@@ -744,7 +744,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
       aNbElements = aMapIndex.Extent();
 
       if (aNbElements < 1)
-       return;
+        return;
 
       myElementsId = new SMESH::long_array;
       myElementsId->length( aNbElements );
@@ -802,20 +802,20 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
     myEditCurrentArgument = (QWidget*)LineEditElements;
     if (CheckBoxMesh->isChecked()) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(ActorSelection);
+        aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       int aConstructorId = GetConstructorId();
       if (aConstructorId == 0)
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(EdgeSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(EdgeSelection);
+        }
       else if (aConstructorId == 1)
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(FaceSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(FaceSelection);
+        }
     }
   }
   else if (send == SelectVectorButton){
@@ -930,13 +930,13 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(EdgeSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(EdgeSelection);
       }
     else if (aConstructorId == 1)
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(FaceSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(FaceSelection);
       }
 
     LineEditElements->setReadOnly(false);
@@ -983,8 +983,8 @@ void SMESHGUI_ExtrusionDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index c6b4b699fe38ba7e4090eb5aa6b9fedb7b60d7c3..4cc5d3fdce49a8a6d0a9ef7c216716acece5f3e1 100755 (executable)
@@ -210,7 +210,7 @@ bool SMESHGUI_FilterTable::AdditionalWidget::IsValid (const bool theMsg) const
     if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) {
       if (theMsg)
         SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                    tr("SMESHGUI_INVALID_PARAMETERS"));
+                                     tr("SMESHGUI_INVALID_PARAMETERS"));
       return false;
     }
   }
@@ -423,13 +423,13 @@ public:
   ~ComboDelegate();
   
   QWidget*      createEditor( QWidget*, const QStyleOptionViewItem&,
-                             const QModelIndex& ) const;
+                              const QModelIndex& ) const;
   
   void          setEditorData( QWidget*, const QModelIndex& ) const;
   void          setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
   
   void          updateEditorGeometry( QWidget*, const QStyleOptionViewItem&, 
-                                     const QModelIndex& ) const;
+                                      const QModelIndex& ) const;
 private:
   QTableWidget* myTable;
 };
@@ -445,8 +445,8 @@ SMESHGUI_FilterTable::ComboDelegate::~ComboDelegate()
 }
 
 QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
-                                                           const QStyleOptionViewItem& option,
-                                                           const QModelIndex& index ) const
+                                                            const QStyleOptionViewItem& option,
+                                                            const QModelIndex& index ) const
 {
   QStringList l = index.data( Qt::UserRole ).toStringList();
   if ( !l.isEmpty() ) {
@@ -459,7 +459,7 @@ QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
 }
 
 void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor, 
-                                                        const QModelIndex& index ) const
+                                                         const QModelIndex& index ) const
 {
   QString value = index.model()->data( index, Qt::DisplayRole ).toString();
   QComboBox* cb = dynamic_cast<QComboBox*>( editor );
@@ -475,8 +475,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
 }
 
 void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
-                                                       QAbstractItemModel* model,
-                                                       const QModelIndex& index) const
+                                                        QAbstractItemModel* model,
+                                                        const QModelIndex& index) const
 {
   QComboBox* cb = dynamic_cast<QComboBox*>( editor );
   if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole );
@@ -484,8 +484,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
 }
 
 void SMESHGUI_FilterTable::ComboDelegate::updateEditorGeometry( QWidget* editor,
-                                                               const QStyleOptionViewItem& option, 
-                                                               const QModelIndex& index ) const
+                                                                const QStyleOptionViewItem& option, 
+                                                                const QModelIndex& index ) const
 {
   editor->setGeometry( option.rect );
 }
@@ -597,8 +597,8 @@ bool SMESHGUI_FilterTable::Table::isEditable (int row, int col) const
 void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
 {
   setEditTriggers( on ? 
-                  QAbstractItemView::NoEditTriggers  :
-                  QAbstractItemView::AllEditTriggers );
+                   QAbstractItemView::NoEditTriggers  :
+                   QAbstractItemView::AllEditTriggers );
 }
 
 bool SMESHGUI_FilterTable::Table::isReadOnly() const
@@ -1031,10 +1031,10 @@ void SMESHGUI_FilterTable::GetCriterion (const int                 theRow,
     theCriterion.Threshold = (double)((ComboItem*)aTable->item(theRow, 2))->value();
   else if ( aCriterionType != SMESH::FT_RangeOfIds &&
             aCriterionType != SMESH::FT_BelongToGeom &&
-           aCriterionType != SMESH::FT_BelongToPlane &&
-           aCriterionType != SMESH::FT_BelongToCylinder &&
-           aCriterionType != SMESH::FT_BelongToGenSurface &&
-           aCriterionType != SMESH::FT_LyingOnGeom)
+            aCriterionType != SMESH::FT_BelongToPlane &&
+            aCriterionType != SMESH::FT_BelongToCylinder &&
+            aCriterionType != SMESH::FT_BelongToGenSurface &&
+            aCriterionType != SMESH::FT_LyingOnGeom)
   {
     theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value();
     theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
@@ -1462,9 +1462,9 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
       aText.toDouble(&isOk);
       aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
       if (!aTable->isEditable(row, 1))
-       aTable->setEditable(true, row, 1);
+        aTable->setEditable(true, row, 1);
       if (!aTable->isEditable(row, 2))
-       aTable->setEditable(true, row, 2);
+        aTable->setEditable(true, row, 2);
     }
   }
 
@@ -1781,7 +1781,7 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget*  thePar
   }
 
   static int aLenCr = qAbs( aMaxLenCr -
-                           aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
+                            aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
 
   QString aCrStr;
   aCrStr.fill(' ', aLenCr);
@@ -1811,10 +1811,10 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget*  thePar
   aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
 
   connect(aTable, SIGNAL(cellChanged(int, int)),
-         this,   SLOT(onCriterionChanged(int, int)));
+          this,   SLOT(onCriterionChanged(int, int)));
 
   connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)),
-         this,   SLOT(onCurrentChanged(int, int)));
+          this,   SLOT(onCurrentChanged(int, int)));
   
   return aTable;
 }
@@ -1844,15 +1844,15 @@ void SMESHGUI_FilterTable::SetEditable (const bool isEditable)
     Table* aTable = anIter.value();
     for (int i = 0, n = aTable->rowCount(); i < n; i++)
       for (int j = 0, m = aTable->columnCount(); j < m; j++)
-       {
-         QTableWidgetItem* anItem = aTable->item(i, j);
-         if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
-           Qt::ItemFlags f = anItem->flags();
-           if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
-           else f = f | Qt::ItemIsUserCheckable;
-           anItem->setFlags( f );
-         }
-       }
+        {
+          QTableWidgetItem* anItem = aTable->item(i, j);
+          if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
+            Qt::ItemFlags f = anItem->flags();
+            if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
+            else f = f | Qt::ItemIsUserCheckable;
+            anItem->setFlags( f );
+          }
+        }
     //end of IPAL19974
 
     if (isEditable)
@@ -2037,8 +2037,8 @@ void SMESHGUI_FilterTable::SetID( const int      theRow,
 // Purpose : Get text and internal value from cell of ID value
 //=======================================================================
 bool SMESHGUI_FilterTable::GetID( const int      theRow,
-                                 QString&       theText,
-                                 const int      theEntityType )
+                                  QString&       theText,
+                                  const int      theEntityType )
 {
   Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
   QTableWidgetItem* anItem = aTable->item( theRow, 5 );
@@ -2335,8 +2335,8 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes)
     mySetInViewer->setChecked(true);
 
   mySourceGrp->button(myApplyToState.contains(theTypes.first()) ? 
-                     myApplyToState[ theTypes.first() ] :
-                     Selection)->setChecked(true);
+                      myApplyToState[ theTypes.first() ] :
+                      Selection)->setChecked(true);
 }
 
 //=======================================================================
@@ -2410,10 +2410,10 @@ void SMESHGUI_FilterDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -2568,7 +2568,7 @@ bool SMESHGUI_FilterDlg::isValid() const
         SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
       if (aList.size() == 0) {
         SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                    tr("BAD_SHAPE_NAME").arg(aName));
+                                     tr("BAD_SHAPE_NAME").arg(aName));
         return false;
       }
 
@@ -2584,26 +2584,26 @@ bool SMESHGUI_FilterDlg::isValid() const
                aFace.IsNull() ||
                aFace.ShapeType() != TopAbs_FACE) {
             SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                        tr("SHAPE_IS_NOT_A_FACE").arg(aName));
+                                         tr("SHAPE_IS_NOT_A_FACE").arg(aName));
             return false;
           }
 
           Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace));
           if (aSurf.IsNull()) {
             SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                        tr("SHAPE_IS_NOT_A_FACE").arg(aName));
+                                         tr("SHAPE_IS_NOT_A_FACE").arg(aName));
             return false;
           }
 
           if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
             SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                        tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
+                                         tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
             return false;
           }
 
           if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
             SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                        tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
+                                         tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
             return false;
           }
         }
@@ -2632,7 +2632,13 @@ void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg,
 //=======================================================================
 void SMESHGUI_FilterDlg::SetMesh (SMESH::SMESH_Mesh_var theMesh)
 {
-  myMesh = theMesh;
+  if ( !theMesh->_is_nil() ) {
+    myMesh = theMesh;
+    if ( !myFilter[ myTable->GetType() ]->_is_nil() && !myFilter[ myTable->GetType() ]->GetPredicate()->_is_nil() ) {
+      SMESH::Predicate_ptr aPred = myFilter[ myTable->GetType() ]->GetPredicate();
+      aPred->SetMesh(myMesh);
+    }
+  }
   const bool isEnable = !(myMesh->_is_nil());
   myButtons[BTN_OK]->setEnabled(isEnable);
   myButtons[BTN_Apply]->setEnabled(isEnable);
index 4380d54d82122e9ea9692b591f75a693933bb5c0..e38b5b6cdb6e9f5757488a17eea9ececad87fe62 100755 (executable)
@@ -123,12 +123,12 @@ public:
                                           const int = -1 );
 
   void                      SetID( const int,
-                                  const QString&,
-                                  const int = -1 ); 
+                                   const QString&,
+                                   const int = -1 ); 
   
   bool                      GetID( const int,
-                                  QString&,
-                                  const int = -1 );
+                                   QString&,
+                                   const int = -1 );
 
   void                      Update();
 
index 47c9e912cbe88bbf68f6cbd98438b73ae2d7c450..9eb27ab6b97ed69e97b6c352677aeeb9027c4975 100644 (file)
@@ -226,7 +226,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent)
   connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
 
   connect(myListBox, SIGNAL(itemSelectionChanged()),
-         this, SLOT(onFilterChanged()));
+          this, SLOT(onFilterChanged()));
 
   connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
   connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
@@ -423,7 +423,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
 
   if (myLibrary->_is_nil()) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
-                                tr("LIBRARY_IS_NOT_LOADED"));
+                                 tr("LIBRARY_IS_NOT_LOADED"));
     return false;
   }
 
@@ -437,11 +437,11 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
   } else if (myMode == EDIT || myMode == ADD_TO) {
     SMESH::Filter_var aFilter = createFilter();
     if (!myListBox->selectedItems().empty() && 
-       !myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
-                           myName->text().toLatin1().constData(),
-                           aFilter.in())) {
+        !myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
+                            myName->text().toLatin1().constData(),
+                            aFilter.in())) {
       SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
-                                  tr("ERROR_OF_EDITING"));
+                                   tr("ERROR_OF_EDITING"));
       aResult = false;
     }
     else
@@ -457,7 +457,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
     delete aFileName;
   } else if (myMode != COPY_FROM) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
-                                tr("ERROR_OF_SAVING"));
+                                 tr("ERROR_OF_SAVING"));
   } else {
   }
 
@@ -507,10 +507,10 @@ void SMESHGUI_FilterLibraryDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -674,7 +674,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary()
   if (myLibrary->_is_nil()) {
     if (myMode == COPY_FROM) {
       SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
-                                  tr("ERROR_LOAD"));
+                                   tr("ERROR_LOAD"));
       return;
     } else {
       myLibrary = aFilterMgr->CreateLibrary();
@@ -730,7 +730,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const
     if (aCurrName.isEmpty()) {
       if (theMess)
         SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                    tr("EMPTY_FILTER_NAME"));
+                                     tr("EMPTY_FILTER_NAME"));
       return false;
     }
 
@@ -739,7 +739,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const
       if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) {
         if (theMess)
           SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
-                                      tr("ERROR_FILTER_NAME"));
+                                       tr("ERROR_FILTER_NAME"));
         return false;
       }
     }
@@ -787,7 +787,7 @@ bool SMESHGUI_FilterLibraryDlg::isPermissionValid(const bool theIsExistingOnly)
 
   if (!isWritable) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
-                                tr("NO_PERMISSION"));
+                                 tr("NO_PERMISSION"));
     return false;
   }
 
@@ -831,8 +831,8 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged()
 
     SMESH::Filter_var aFilter = createFilter();
     myLibrary->Replace(myCurrFilterName.toLatin1().constData(), 
-                      myName->text().toLatin1().constData(), 
-                      aFilter);
+                       myName->text().toLatin1().constData(), 
+                       aFilter);
   }
 
   // Fill table with filter parameters
@@ -938,8 +938,8 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed()
 
     SMESH::Filter_var aFilter = createFilter();
     myLibrary->Replace(myCurrFilterName.toLatin1().constData(), 
-                      myName->text().toLatin1().constData(), 
-                      aFilter);
+                       myName->text().toLatin1().constData(), 
+                       aFilter);
   }
   myTable->Clear(myTable->GetType());
 
@@ -955,7 +955,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
 {
   if (myLibrary->_is_nil()) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
-                                tr("LIBRARY_IS_NOT_LOADED"));
+                                 tr("LIBRARY_IS_NOT_LOADED"));
     return;
   }
 
@@ -979,7 +979,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
 
   if (!aResult) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
-                                tr("ERROR_OF_ADDING"));
+                                 tr("ERROR_OF_ADDING"));
   }
 
   updateList();
@@ -989,7 +989,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
 
   if (theName != aName)
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
-                                tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
+                                 tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
 }
 
 //=======================================================================
@@ -1089,7 +1089,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
 {
   if (myLibrary->_is_nil()) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
-                                tr("LIBRARY_IS_NOT_LOADED"));
+                                 tr("LIBRARY_IS_NOT_LOADED"));
     return;
   }
 
@@ -1097,7 +1097,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
 
   if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) {
     SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
-                                tr("ERROR_OF_DELETING"));
+                                 tr("ERROR_OF_DELETING"));
   } else {
     myCurrFilterName = "";
     myCurrFilter = -1;
@@ -1188,8 +1188,8 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation()
     {
       SMESH::Filter_var aFilter = createFilter(myTable->GetType());
       myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
-                        myName->text().toLatin1().constData(),
-                        aFilter);
+                         myName->text().toLatin1().constData(),
+                         aFilter);
     }
   }
 }
index 33907aec03508e625ab08fd38c670a12efbffe8f..d3544b4d24cb56ad1c76013b89bc6ffeace2c925 100644 (file)
@@ -64,7 +64,7 @@ namespace SMESH
         SMESH::SMESH_subMesh_var aSubmesh =
           SObjectToInterface<SMESH::SMESH_subMesh>( theMeshOrSubmesh );
         if ( !aSubmesh->_is_nil() )
-         return aSubmesh->GetSubShape();
+          return aSubmesh->GetSubShape();
       }
     }
     return GEOM::GEOM_Object::_nil();
@@ -89,7 +89,7 @@ namespace SMESH
         SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient);
         aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject());
       } else {
-       SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
+        SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
         aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject());
       }
 
index 80e98c0cfe2474c18f935542bdd590c637c2f03e..32f66474c196d0369bf479ac7a36cfa464759201 100644 (file)
 // purpose  :
 //=================================================================================
 SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
-                                     SMESH::SMESH_Mesh_ptr theMesh )
+                                      SMESH::SMESH_Mesh_ptr theMesh )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
     myIsBusy( false ),
-    myNameChanged( false ),
-    myActor( 0 )
+    myNameChanged( false )
 {
   initDialog( true );
   if ( !theMesh->_is_nil() )
@@ -129,7 +128,7 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
 // purpose  :
 //=================================================================================
 SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
-                                     SMESH::SMESH_GroupBase_ptr theGroup,
+                                      SMESH::SMESH_GroupBase_ptr theGroup,
                                       const bool theIsConvert )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
@@ -330,7 +329,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
   QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
   myColorBtn = new QtxColorButton(aColorBox);
   myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, 
-                            myColorBtn->sizePolicy().verticalPolicy() );
+                             myColorBtn->sizePolicy().verticalPolicy() );
 
   aColorBoxLayout->addWidget(aColorLab);
   aColorBoxLayout->addWidget(myColorBtn);
@@ -413,6 +412,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(onClose()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),  this, SLOT(onObjectSelectionChanged()));
+  connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()),      this, SLOT(onVisibilityChanged()));
 
   rb1->setChecked(true); // VSR !!!
   onGrpTypeChanged(0); // VSR!!!
@@ -552,11 +552,12 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
   // actor of theGroup, if it is visible, else try
   // any visible actor of group or submesh of myMesh
   // commented, because an attempt to set selection on not displayed cells leads to error
-  //SetAppropriateActor();
-  myActor = SMESH::FindActorByObject(myMesh);
-  if ( !myActor )
-    myActor = SMESH::FindActorByObject(theGroup);
-  SMESH::SetPickable(myActor);
+  SetAppropriateActor();
+
+  /*  SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
+  if ( !anActor )
+    anActor = SMESH::FindActorByObject(theGroup);
+  SMESH::SetPickable(anActor);*/
 
   int grpType = (!myGroup->_is_nil() ? 0 : (theIsConvert ? 0 : 1));
   myGrpTypeGroup->button(grpType)->setChecked(true);
@@ -685,44 +686,50 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
   if (mySelectionMode != theMode) {
     // [PAL10408] mySelectionMgr->clearSelected();
     mySelectionMgr->clearFilters();
-    if (myActor)
-      myActor->SetPointRepresentation(false);
+    if (myActorsList.count() > 0) {
+      QListIterator<SMESH_Actor*> it( myActorsList );
+      while ( it.hasNext() )
+        it.next()->SetPointRepresentation(false);
+    }
     else
       SMESH::SetPointRepresentation(false);
     if (theMode < 4) {
       switch (theMode) {
       case 0:
-        if (myActor)
-         myActor->SetPointRepresentation(true);
-       else
-         SMESH::SetPointRepresentation(true);
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(NodeSelection);
-       break;
+        if (myActorsList.count() > 0) {
+          QListIterator<SMESH_Actor*> it( myActorsList );
+          while ( it.hasNext() )
+            it.next()->SetPointRepresentation(true);
+        }
+        else
+          SMESH::SetPointRepresentation(true);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(NodeSelection);
+        break;
       case 1:
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(EdgeSelection);
-       break;
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(EdgeSelection);
+        break;
       case 2:
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(FaceSelection);
-       break;
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(FaceSelection);
+        break;
       default:
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(VolumeSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(VolumeSelection);
       }
     } else {
       if (theMode == 4)
-       mySelectionMgr->installFilter(mySubMeshFilter);
+        mySelectionMgr->installFilter(mySubMeshFilter);
       else if (theMode == 5)
-       mySelectionMgr->installFilter(myGroupFilter);
+        mySelectionMgr->installFilter(myGroupFilter);
       else if (theMode == 6)
-       mySelectionMgr->installFilter(myMeshFilter);
+        mySelectionMgr->installFilter(myMeshFilter);
       else if (theMode == 7)
-       mySelectionMgr->installFilter(myGeomFilter);
+        mySelectionMgr->installFilter(myGeomFilter);
 
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(ActorSelection);
+        aViewWindow->SetSelectionMode(ActorSelection);
     }
     mySelectionMode = theMode;
   }
@@ -752,7 +759,7 @@ bool SMESHGUI_GroupDlg::onApply()
         if (myMesh->_is_nil())
           return false;
         myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
-       // nullify pointer, because object become dead
+        // nullify pointer, because object become dead
         myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
       }
     }
@@ -773,7 +780,7 @@ bool SMESHGUI_GroupDlg::onApply()
       int i, k = myElements->count();
       anIdList->length(k);
       for (i = 0; i < k; i++) {
-       anIdList[i] = myElements->item(i)->text().toInt();
+        anIdList[i] = myElements->item(i)->text().toInt();
       }
 
       myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
@@ -800,46 +807,46 @@ bool SMESHGUI_GroupDlg::onApply()
 
       _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
       if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
-       anActor->setName(myName->text().toLatin1().data());
-       switch ( myTypeId ) {
-       case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
-       case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
-       case 2:
-       case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
-       }
+        anActor->setName(myName->text().toLatin1().data());
+        switch ( myTypeId ) {
+        case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
+        case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
+        case 2:
+        case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
+        }
       }
 
       QList<int> aAddList;
 
       int i, total = myElements->count();
       for (i = 0; i < total; i++) {
-       int anId = myElements->item(i)->text().toInt();
-       int idx = myIdList.indexOf(anId);
-       if ( idx == -1 )
-         aAddList.append(anId);
-       else
-         myIdList.removeAt(idx);
+        int anId = myElements->item(i)->text().toInt();
+        int idx = myIdList.indexOf(anId);
+        if ( idx == -1 )
+          aAddList.append(anId);
+        else
+          myIdList.removeAt(idx);
       }
       if (!aAddList.empty()) {
-       SMESH::long_array_var anIdList = new SMESH::long_array;
-       int added = aAddList.count();
-       anIdList->length(added);
-       for (i = 0; i < added; i++)
-         anIdList[i] = aAddList[i];
-       myGroup->Add(anIdList.inout());
+        SMESH::long_array_var anIdList = new SMESH::long_array;
+        int added = aAddList.count();
+        anIdList->length(added);
+        for (i = 0; i < added; i++)
+          anIdList[i] = aAddList[i];
+        myGroup->Add(anIdList.inout());
       }
       if (!myIdList.empty()) {
-       SMESH::long_array_var anIdList = new SMESH::long_array;
-       int removed = myIdList.count();
-       anIdList->length(removed);
-       for (i = 0; i < removed; i++)
-         anIdList[i] = myIdList[i];
-       myGroup->Remove(anIdList.inout());
+        SMESH::long_array_var anIdList = new SMESH::long_array;
+        int removed = myIdList.count();
+        anIdList->length(removed);
+        for (i = 0; i < removed; i++)
+          anIdList[i] = myIdList[i];
+        myGroup->Remove(anIdList.inout());
       }
       /* init for next operation */
       myIdList.clear();
       for (i = 0; i < total; i++) {
-       myIdList.append(myElements->item(i)->text().toInt());
+        myIdList.append(myElements->item(i)->text().toInt());
       }
     }
 
@@ -863,12 +870,12 @@ bool SMESHGUI_GroupDlg::onApply()
 
       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
       GEOM::GEOM_IGroupOperations_var aGroupOp =
-       SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+        SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
 
       if (myGeomObjects->length() == 1) {
-       myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
-                                                   myName->text().toLatin1().data(),
-                                                   myGeomObjects[0]);
+        myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
+                                                    myName->text().toLatin1().data(),
+                                                    myGeomObjects[0]);
       }
       else {
         SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
@@ -910,12 +917,12 @@ bool SMESHGUI_GroupDlg::onApply()
           aNewGeomGroupName += myName->text();
           SALOMEDS::SObject_var aNewGroupSO =
             geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
-                               aNewGeomGroupName.toLatin1().data(), aMeshShape);
+                                aNewGeomGroupName.toLatin1().data(), aMeshShape);
         }
 
         myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
-                                                   myName->text().toLatin1().data(),
-                                                   aGroupVar);
+                                                    myName->text().toLatin1().data(),
+                                                    aGroupVar);
       }
 
       SALOMEDS::Color aColor = getGroupColor();
@@ -938,13 +945,13 @@ bool SMESHGUI_GroupDlg::onApply()
 
       _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
       if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
-       anActor->setName(myName->text().toLatin1().data());
-       switch ( myTypeId ) {
-       case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
-       case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
-       case 2:
-       case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
-       }
+        anActor->setName(myName->text().toLatin1().data());
+        switch ( myTypeId ) {
+        case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
+        case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
+        case 2:
+        case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
+        }
       }
     }
 
@@ -972,9 +979,9 @@ void SMESHGUI_GroupDlg::onOK()
 //=================================================================================
 void SMESHGUI_GroupDlg::onListSelectionChanged()
 {
-  //  MESSAGE( "SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
-  if( myIsBusy || !myActor) return;
-    myIsBusy = true;
+  //MESSAGE( "SMESHGUI_GroupDlg::onListSelectionChanged(); myActorsList.count() = " << myActorsList.count());
+  if( myIsBusy || myActorsList.count() == 0 ) return;
+  myIsBusy = true;
 
   if (myCurrentLineEdit == 0) {
     mySelectionMgr->clearSelected();
@@ -982,9 +989,9 @@ void SMESHGUI_GroupDlg::onListSelectionChanged()
     QList<QListWidgetItem*> selItems = myElements->selectedItems();
     QListWidgetItem* anItem;
     foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt());
-    mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
+    mySelector->AddOrRemoveIndex(myActorsList.first()->getIO(), aIndexes, false);
     SALOME_ListIO aList;
-    aList.Append(myActor->getIO());
+    aList.Append(myActorsList.first()->getIO());
     mySelectionMgr->setSelectedObjects(aList,false);
   }
   myIsBusy = false;
@@ -1026,7 +1033,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
       myGeomObjects->length(0);
 
       if (myGeomGroupBtn->isChecked())
-       myGeomGroupBtn->setChecked(false);
+        myGeomGroupBtn->setChecked(false);
       if (!myCreate)
         myName->setText( "" );
 
@@ -1045,16 +1052,20 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
       Handle(SALOME_InteractiveObject) IO = aList.First();
 
       if (myCreate) {
-       restoreShowEntityMode();
-       myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
+        restoreShowEntityMode();
+        myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
         setShowEntityMode();
         updateGeomPopup();
         if (myMesh->_is_nil())
-       {
+        {
           updateButtons();
-         myIsBusy = false;
-         return;
-       }
+          myIsBusy = false;
+          return;
+        }
+
+        if ( myFilterDlg && !myMesh->_is_nil()){
+          myFilterDlg->SetMesh( myMesh );
+        }
         myGroup = SMESH::SMESH_Group::_nil();
 
         // NPAL19389: create a group with a selection in another group
@@ -1075,15 +1086,14 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
       else {
         SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
         if (aGroup->_is_nil())
-       {
-         myIsBusy = false;
+        {
+          myIsBusy = false;
           return;
-       }
+        }
         myIsBusy = false;
-        myCurrentLineEdit = 0;
 
-       myGroup = SMESH::SMESH_Group::_nil();
-       myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
+        myGroup = SMESH::SMESH_Group::_nil();
+        myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
 
         init(aGroup);
         myIsBusy = true;
@@ -1097,13 +1107,13 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
 
       if (myGrpTypeId == 0)
       {
-       if (myTypeId == -1)
-         onTypeChanged(0);
-       else
-       {
-         myElements->clear();
-         setSelectionMode(myTypeId);
-       }
+        if (myTypeId == -1)
+          onTypeChanged(0);
+        else
+        {
+          myElements->clear();
+          setSelectionMode(myTypeId);
+        }
       }
 
       myIsBusy = false;
@@ -1119,10 +1129,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
 
       if (aNbSel == 0 || !aMeshSO)
       {
-       myGeomObjects->length(0);
-       updateButtons();
-       myIsBusy = false;
-       return;
+        myGeomObjects->length(0);
+        updateButtons();
+        myIsBusy = false;
+        return;
       }
 
       myGeomObjects->length(aNbSel);
@@ -1181,10 +1191,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
 
       myGeomObjects->length(i);
       if ( i == 0 )
-       {
-         myIsBusy = false;
-         return;
-       }
+        {
+          myIsBusy = false;
+          return;
+        }
 
       aNbSel = i;
     }
@@ -1218,13 +1228,12 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
   }
   else // !myCurrentLineEdit: local selection of nodes or elements
   {
-    if (aNbSel == 1 && myActor && myActor->hasIO())
+    if (aNbSel == 1 && myActorsList.count() > 0 )
     {
-#ifdef ENABLE_SWITCH_ACTOR_DURING_ELEMENTS_SELECTION
       // NPAL19389: create a group with a selection in another group
       // Switch myActor to the newly selected one, if the last
       // is visible and belongs to group or submesh of myMesh
-      Handle(SALOME_InteractiveObject) curIO = myActor->getIO();
+      /*      Handle(SALOME_InteractiveObject) curIO = myActor->getIO();
       Handle(SALOME_InteractiveObject) selIO = aList.First();
       if (curIO->hasEntry() && selIO->hasEntry()) {
         const char* selEntry = selIO->getEntry();
@@ -1251,50 +1260,74 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
             }
           }
         }
-      }
+      }*/
       // NPAL19389 END
-#endif // ENABLE_SWITCH_ACTOR_DURING_ELEMENTS_SELECTION
 
       QString aListStr = "";
       int aNbItems = 0;
       if (myTypeId == 0) {
-       aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
+        QListIterator<SMESH_Actor*> it( myActorsList );
+        while ( it.hasNext() ) {
+          QString tmpStr;
+          aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr);
+          aListStr += tmpStr;
+        }
       } else {
-       aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
+        QListIterator<SMESH_Actor*> it( myActorsList );
+        while ( it.hasNext() ) {
+          QString tmpStr;
+          aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr);
+          aListStr += tmpStr;
+        }
       }
       if (aNbItems > 0) {
-       QListWidgetItem* anItem;
-       QList<QListWidgetItem*> listItemsToSel;
-       QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
-       for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
-         QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
-         foreach(anItem, found)
-           if (!anItem->isSelected())
-             listItemsToSel.push_back(anItem);
-       }
-       bool blocked = myElements->signalsBlocked();
-       myElements->blockSignals(true);
-       foreach(anItem, listItemsToSel) anItem->setSelected(true);
-       myElements->blockSignals(blocked);
-       onListSelectionChanged();
-       listItemsToSel.clear();
+        QListWidgetItem* anItem;
+        QList<QListWidgetItem*> listItemsToSel;
+        QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
+        for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
+          QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
+          foreach(anItem, found)
+            if (!anItem->isSelected())
+              listItemsToSel.push_back(anItem);
+        }
+        bool blocked = myElements->signalsBlocked();
+        myElements->blockSignals(true);
+        foreach(anItem, listItemsToSel) anItem->setSelected(true);
+        myElements->blockSignals(blocked);
+        onListSelectionChanged();
+        listItemsToSel.clear();
       }
     }
   }
-
-  if (!myActor) {
-    if (!myGroup->_is_nil())
-      myActor = SMESH::FindActorByObject(myGroup);
-    else if(!myGroupOnGeom->_is_nil())
-      myActor = SMESH::FindActorByObject(myGroupOnGeom);
-    else
-      myActor = SMESH::FindActorByObject(myMesh);
+  
+  if (myActorsList.count() == 0) {
+    if (!myGroup->_is_nil()) {
+      SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup);
+      if ( anActor )
+        myActorsList.append( anActor  );
+    }
+    else if(!myGroupOnGeom->_is_nil()) {
+      SMESH_Actor* anActor = SMESH::FindActorByObject(myGroupOnGeom);
+      if ( anActor )
+        myActorsList.append( anActor );
+    }
+    else {
+      SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh );
+      if ( anActor )
+        myActorsList.append( anActor );
+    }
   }
 
   // somehow, if we display the mesh, while selecting from another actor,
   // the mesh becomes pickable, and there is no way to select any element
-  if (myActor)
-    SMESH::SetPickable(myActor);
+  if (myActorsList.count() > 0) {
+    QListIterator<SMESH_Actor*> it( myActorsList );
+    while ( it.hasNext() ) {
+      SMESH_Actor* anActor = it.next();
+      if ( IsActorVisible(anActor) )
+        anActor->SetPickable(true);
+    }
+  }
 
   myIsBusy = false;
 }
@@ -1387,11 +1420,14 @@ void SMESHGUI_GroupDlg::setCurrentSelection()
   QPushButton* send = (QPushButton*)sender();
   myCurrentLineEdit = 0;
   if (send == myMeshGroupBtn) {
-    myCurrentLineEdit = myMeshGroupLine;
+    disconnect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
+    mySelectionMgr->clearSelected();
     if (myCreate)
       setSelectionMode(6);
     else
       setSelectionMode(5);
+    connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
+    myCurrentLineEdit = myMeshGroupLine;
     onObjectSelectionChanged();
   }
   else if (send == mySubMeshBtn) {
@@ -1413,8 +1449,8 @@ void SMESHGUI_GroupDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
 
@@ -1469,7 +1505,7 @@ void SMESHGUI_GroupDlg::onAdd()
 
   int aNbSel = aList.Extent();
 
-  if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
+  if (aNbSel == 0 || myActorsList.count() == 0 || myMesh->_is_nil()) return;
 
   myIsBusy = true;
 
@@ -1503,26 +1539,36 @@ void SMESHGUI_GroupDlg::onAdd()
     QString aListStr = "";
     int aNbItems = 0;
     if (myTypeId == 0) {
-      aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
+      QListIterator<SMESH_Actor*> it( myActorsList );
+      while ( it.hasNext() ) {
+        QString tmpStr;
+        aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr);
+        aListStr += tmpStr;
+      }
     }
     else {
-      aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
+      QListIterator<SMESH_Actor*> it( myActorsList );
+      while ( it.hasNext() ) {
+        QString tmpStr;
+        aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr);
+        aListStr += tmpStr;
+      }
     }
     if (aNbItems > 0) {
       QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
       for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
-       QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
-       if (found.count() == 0) {
-         anItem = new QListWidgetItem(*it);
-         myElements->addItem(anItem);
-         if (!anItem->isSelected())
-           listItemsToSel.push_back(anItem);
-       }
-       else {
-         foreach(anItem, found)
-           if (!anItem->isSelected())
-             listItemsToSel.push_back(anItem);
-       }
+        QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
+        if (found.count() == 0) {
+          anItem = new QListWidgetItem(*it);
+          myElements->addItem(anItem);
+          if (!anItem->isSelected())
+            listItemsToSel.push_back(anItem);
+        }
+        else {
+          foreach(anItem, found)
+            if (!anItem->isSelected())
+              listItemsToSel.push_back(anItem);
+        }
       }
       bool blocked = myElements->signalsBlocked();
       myElements->blockSignals(true);
@@ -1542,8 +1588,8 @@ void SMESHGUI_GroupDlg::onAdd()
       SMESH::SMESH_subMesh_var aSubMesh =
         SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
       if (!aSubMesh->_is_nil()) {
-       // check if mesh is the same
-       if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
+        // check if mesh is the same
+        if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
           try {
             SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
             int k = anElements->length();
@@ -1553,21 +1599,21 @@ void SMESHGUI_GroupDlg::onAdd()
               if (found.count() == 0) {
                 anItem = new QListWidgetItem(aText);
                 myElements->addItem(anItem);
-               if (!anItem->isSelected())
-                 listItemsToSel.push_back(anItem);
+                if (!anItem->isSelected())
+                  listItemsToSel.push_back(anItem);
+              }
+              else {
+                foreach(anItem, found)
+                  if (!anItem->isSelected())
+                    listItemsToSel.push_back(anItem);
               }
-             else {
-               foreach(anItem, found)
-                 if (!anItem->isSelected())
-                   listItemsToSel.push_back(anItem);
-             }
             }
-           bool blocked = myElements->signalsBlocked();
-           myElements->blockSignals(true);
-           foreach(anItem, listItemsToSel) anItem->setSelected(true);
-           myElements->blockSignals(blocked);
-           onListSelectionChanged();
-           listItemsToSel.clear();
+            bool blocked = myElements->signalsBlocked();
+            myElements->blockSignals(true);
+            foreach(anItem, listItemsToSel) anItem->setSelected(true);
+            myElements->blockSignals(blocked);
+            onListSelectionChanged();
+            listItemsToSel.clear();
           }
           catch (const SALOME::SALOME_Exception& ex) {
             SalomeApp_Tools::QtCatchCorbaException(ex);
@@ -1589,32 +1635,32 @@ void SMESHGUI_GroupDlg::onAdd()
       SMESH::SMESH_GroupBase_var aGroup =
         SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIt.Value());
       if (!aGroup->_is_nil()) {
-       // check if mesh is the same
-       if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
-         SMESH::long_array_var anElements = aGroup->GetListOfID();
-         int k = anElements->length();
-         for (int i = 0; i < k; i++) {
-           QString aText = QString::number(anElements[i]);
-           QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
-           if (found.count() == 0) {
-             anItem = new QListWidgetItem(aText);
-             myElements->addItem(anItem);
-             if (!anItem->isSelected())
-               listItemsToSel.push_back(anItem);
-           }
-           else {
-             foreach(anItem, found)
-               if (!anItem->isSelected())
-                 listItemsToSel.push_back(anItem);
-           }
-         }
-         bool blocked = myElements->signalsBlocked();
-         myElements->blockSignals(true);
-         foreach(anItem, listItemsToSel) anItem->setSelected(true);
-         myElements->blockSignals(blocked);
-         onListSelectionChanged();
-         listItemsToSel.clear();
-       }
+        // check if mesh is the same
+        if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
+          SMESH::long_array_var anElements = aGroup->GetListOfID();
+          int k = anElements->length();
+          for (int i = 0; i < k; i++) {
+            QString aText = QString::number(anElements[i]);
+            QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+            if (found.count() == 0) {
+              anItem = new QListWidgetItem(aText);
+              myElements->addItem(anItem);
+              if (!anItem->isSelected())
+                listItemsToSel.push_back(anItem);
+            }
+            else {
+              foreach(anItem, found)
+                if (!anItem->isSelected())
+                  listItemsToSel.push_back(anItem);
+            }
+          }
+          bool blocked = myElements->signalsBlocked();
+          myElements->blockSignals(true);
+          foreach(anItem, listItemsToSel) anItem->setSelected(true);
+          myElements->blockSignals(blocked);
+          onListSelectionChanged();
+          listItemsToSel.clear();
+        }
       }
     }
     mySelectGroup->setChecked(false);
@@ -1652,19 +1698,19 @@ void SMESHGUI_GroupDlg::onAdd()
 
       int k = anElements->length();
       for (int i = 0; i < k; i++) {
-       QString aText = QString::number(anElements[i]);
-       QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
-       if (found.count() == 0) {
-         anItem = new QListWidgetItem(aText);
-         myElements->addItem(anItem);
-         if (!anItem->isSelected())
-           listItemsToSel.push_back(anItem);
-       }
-       else {
-         foreach(anItem, found)
-           if (!anItem->isSelected())
-             listItemsToSel.push_back(anItem);
-       }
+        QString aText = QString::number(anElements[i]);
+        QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+        if (found.count() == 0) {
+          anItem = new QListWidgetItem(aText);
+          myElements->addItem(anItem);
+          if (!anItem->isSelected())
+            listItemsToSel.push_back(anItem);
+        }
+        else {
+          foreach(anItem, found)
+            if (!anItem->isSelected())
+              listItemsToSel.push_back(anItem);
+        }
       }
       bool blocked = myElements->signalsBlocked();
       myElements->blockSignals(true);
@@ -1717,42 +1763,42 @@ void SMESHGUI_GroupDlg::onRemove()
 
       SALOME_ListIteratorOfListIO anIt (aList);
       for ( ; anIt.More(); anIt.Next()) {
-       SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
-       if (!aSubMesh->_is_nil()) {
-         // check if mesh is the same
-         if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
-           if (aType == SMESH::NODE) {
-             try {
-               SMESH::long_array_var anElements = aSubMesh->GetNodesId();
-               int k = anElements->length();
-               for (int i = 0; i < k; i++) {
-                 QList<QListWidgetItem*> found = 
-                   myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
-                 QListWidgetItem* anItem;
-                 foreach(anItem, found) delete anItem;
-               }
-             }
-             catch (const SALOME::SALOME_Exception& ex) {
-               SalomeApp_Tools::QtCatchCorbaException(ex);
-             }
-           }
-           else {
-             try {
-               SMESH::long_array_var anElements = aSubMesh->GetElementsId();
-               int k = anElements->length();
-               for (int i = 0; i < k; i++) {
-                 QList<QListWidgetItem*> found = 
-                   myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
-                 QListWidgetItem* anItem;
-                 foreach(anItem, found) delete anItem;
-               }
-             }
-             catch (const SALOME::SALOME_Exception& ex) {
-               SalomeApp_Tools::QtCatchCorbaException(ex);
-             }
-           }
-         }
-       }
+        SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
+        if (!aSubMesh->_is_nil()) {
+          // check if mesh is the same
+          if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
+            if (aType == SMESH::NODE) {
+              try {
+                SMESH::long_array_var anElements = aSubMesh->GetNodesId();
+                int k = anElements->length();
+                for (int i = 0; i < k; i++) {
+                  QList<QListWidgetItem*> found = 
+                    myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+                  QListWidgetItem* anItem;
+                  foreach(anItem, found) delete anItem;
+                }
+              }
+              catch (const SALOME::SALOME_Exception& ex) {
+                SalomeApp_Tools::QtCatchCorbaException(ex);
+              }
+            }
+            else {
+              try {
+                SMESH::long_array_var anElements = aSubMesh->GetElementsId();
+                int k = anElements->length();
+                for (int i = 0; i < k; i++) {
+                  QList<QListWidgetItem*> found = 
+                    myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+                  QListWidgetItem* anItem;
+                  foreach(anItem, found) delete anItem;
+                }
+              }
+              catch (const SALOME::SALOME_Exception& ex) {
+                SalomeApp_Tools::QtCatchCorbaException(ex);
+              }
+            }
+          }
+        }
       }
     }
     else if (myCurrentLineEdit == myGroupLine) {
@@ -1763,20 +1809,20 @@ void SMESHGUI_GroupDlg::onRemove()
 
       SALOME_ListIteratorOfListIO anIt (aList);
       for ( ; anIt.More(); anIt.Next()) {
-       SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
-       if (aRes && !aGroup->_is_nil()) {
-         // check if mesh is the same
-         if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
-           SMESH::long_array_var anElements = aGroup->GetListOfID();
-           int k = anElements->length();
-           for (int i = 0; i < k; i++) {
-             QList<QListWidgetItem*> found = 
-               myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
-             QListWidgetItem* anItem;
-             foreach(anItem, found) delete anItem;
-           }
-         }
-       }
+        SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
+        if (aRes && !aGroup->_is_nil()) {
+          // check if mesh is the same
+          if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
+            SMESH::long_array_var anElements = aGroup->GetListOfID();
+            int k = anElements->length();
+            for (int i = 0; i < k; i++) {
+              QList<QListWidgetItem*> found = 
+                myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+              QListWidgetItem* anItem;
+              foreach(anItem, found) delete anItem;
+            }
+          }
+        }
       }
     }
   }
@@ -1804,7 +1850,7 @@ void SMESHGUI_GroupDlg::onSort()
       int id = myElements->item(i)->text().toInt();
       anArray[i] = id;
       if (myElements->item(i)->isSelected())
-       aSelected.append(id);
+        aSelected.append(id);
     }
     // sort & update list
     std::sort(anArray.begin(), anArray.end());
@@ -1816,7 +1862,7 @@ void SMESHGUI_GroupDlg::onSort()
       anItem = new QListWidgetItem(QString::number(anArray[i]));
       myElements->addItem(anItem);
       if (aSelected.contains(anArray[i]))
-       listItemsToSel.push_back(anItem);
+        listItemsToSel.push_back(anItem);
     }
     bool blocked = myElements->signalsBlocked();
     myElements->blockSignals(true);
@@ -1836,6 +1882,15 @@ void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
   onClose();
 }
 
+//=================================================================================
+// function : onVisibilityChanged()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupDlg::onVisibilityChanged()
+{
+  SetAppropriateActor();
+}
+
 //=================================================================================
 // function : SMESHGUI_GroupDlg::onClose
 // purpose  : SLOT called when "Close" button pressed. Close dialog
@@ -1875,10 +1930,10 @@ void SMESHGUI_GroupDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
-                            tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
-                            arg(app->resourceMgr()->stringValue( "ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+                             arg(app->resourceMgr()->stringValue( "ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -1979,7 +2034,7 @@ void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn)
       myCurrentLineEdit = myGeomGroupLine;
       QAction* a = myGeomPopup->exec( QCursor::pos() );
       if (!a || myActions[a] == DIRECT_GEOM_INDEX)
-       setSelectionMode(7);
+        setSelectionMode(7);
     }
   else if (!isBtnOn)
     {
@@ -1999,17 +2054,17 @@ void SMESHGUI_GroupDlg::onGeomPopup( QAction* a )
     {
       mySelectionMode = -1;
       if ( !myShapeByMeshOp ) {
-       myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
-       connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
-               SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
-       connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
-               SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
+        myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
+        connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
+                SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
+        connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
+                SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
       }
       // set mesh object to SMESHGUI_ShapeByMeshOp and start it
       if ( !myMesh->_is_nil() ) {
-       myIsBusy = true;
+        myIsBusy = true;
         hide(); // stop processing selection
-       myIsBusy = false;
+        myIsBusy = false;
         myShapeByMeshOp->setModule( mySMESHGUI );
         myShapeByMeshOp->setStudy( 0 ); // it's really necessary
         myShapeByMeshOp->SetMesh( myMesh );
@@ -2036,12 +2091,12 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op)
       QString ID = aGeomVar->GetStudyEntry();
       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
       if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
-       SALOME_ListIO anIOList;
-       Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
-         ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
-       anIOList.Append( anIO );
-       mySelectionMgr->setSelectedObjects( anIOList, false );
-       onObjectSelectionChanged();
+        SALOME_ListIO anIOList;
+        Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
+          ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
+        anIOList.Append( anIO );
+        mySelectionMgr->setSelectedObjects( anIOList, false );
+        onObjectSelectionChanged();
       }
     }
   }
@@ -2069,8 +2124,8 @@ void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op)
 void SMESHGUI_GroupDlg::setGroupColor( const SALOMEDS::Color& theColor )
 {
   QColor aQColor( (int)( theColor.R * 255.0 ),
-                 (int)( theColor.G * 255.0 ),
-                 (int)( theColor.B * 255.0 ) );
+                  (int)( theColor.G * 255.0 ),
+                  (int)( theColor.B * 255.0 ) );
   setGroupQColor( aQColor );
 }
 
@@ -2141,8 +2196,8 @@ void SMESHGUI_GroupDlg::setDefaultGroupColor()
 
     SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
     aQColor.setRgb( (int)( aColor.R * 255.0 ),
-                   (int)( aColor.G * 255.0 ),
-                   (int)( aColor.B * 255.0 ) );
+                    (int)( aColor.G * 255.0 ),
+                    (int)( aColor.B * 255.0 ) );
 
   }
 
@@ -2158,81 +2213,78 @@ void SMESHGUI_GroupDlg::setDefaultGroupColor()
 bool SMESHGUI_GroupDlg::SetAppropriateActor()
 {
   bool isActor = false;
+  myActorsList.clear();
 
   if (myMesh->_is_nil()) return false;
 
   SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView();
 
-  // try mesh actor
-  myActor = SMESH::FindActorByObject(myMesh);
-  if (myActor && myActor->hasIO())
-  {
-    isActor = true;
-    if (aViewWindow && !aViewWindow->isVisible(myActor->getIO()))
-        isActor = false;
-  }
-
-  // try current group actor
-  if (!isActor) {
-    if (!myGroup->_is_nil()) {
-      myActor = SMESH::FindActorByObject(myGroup);
-      if (myActor && myActor->hasIO())
-      {
-        isActor = true;
-        if (aViewWindow && !aViewWindow->isVisible(myActor->getIO()))
-            isActor = false;
+  if (myGeomGroupBtn->isChecked()) {   // try current group on geometry actor
+    if (!isActor) {
+      if (!myGroupOnGeom->_is_nil()) {
+        SMESH_Actor* anActor = SMESH::FindActorByObject(myGroupOnGeom);
+        if (anActor && anActor->hasIO())
+          {
+            isActor = true;
+            if (aViewWindow && !aViewWindow->isVisible(anActor->getIO()))
+              isActor = false;
+            else
+              myActorsList.append(anActor);
+          }
       }
     }
-  }
-
-  // try current group on geometry actor
-  if (!isActor) {
-    if (!myGroupOnGeom->_is_nil()) {
-      myActor = SMESH::FindActorByObject(myGroupOnGeom);
-      if (myActor && myActor->hasIO())
+  } else {
+    // try mesh actor
+    SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
+    if (anActor && anActor->hasIO())
       {
         isActor = true;
-        if (aViewWindow && !aViewWindow->isVisible(myActor->getIO()))
+        if (aViewWindow && !aViewWindow->isVisible(anActor->getIO()))
           isActor = false;
+        else
+          myActorsList.append(anActor);
       }
-    }
-  }
-
-  // try any visible actor of group or submesh of current mesh
-  if (!isActor && aViewWindow) {
-    // mesh entry
-    _PTR(SObject) aSObject = SMESH::FindSObject(myMesh);
-    if (aSObject) {
-      CORBA::String_var meshEntry = aSObject->GetID().c_str();
-      int len = strlen(meshEntry);
-
-      // iterate on all actors in current view window, search for
-      // any visible actor, that belongs to group or submesh of current mesh
-      VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
-      vtkActorCollection *aCollection = aCopy.GetActors();
-      int nbItems = aCollection->GetNumberOfItems();
-      for (int i=0; i<nbItems && !isActor; i++)
-      {
-        SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(aCollection->GetItemAsObject(i));
-        if (anActor && anActor->hasIO()) {
-          Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
-          if (aViewWindow->isVisible(anIO)) {
-            if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0) {
-              myActor = anActor;
-              isActor = true;
+    
+    // try any visible actor of group or submesh of current mesh
+    if (aViewWindow) {
+      // mesh entry
+      _PTR(SObject) aSObject = SMESH::FindSObject(myMesh);
+      if (aSObject) {
+        CORBA::String_var meshEntry = aSObject->GetID().c_str();
+        int len = strlen(meshEntry);
+        
+        // iterate on all actors in current view window, search for
+        // any visible actor, that belongs to group or submesh of current mesh
+        VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
+        vtkActorCollection *aCollection = aCopy.GetActors();
+        int nbItems = aCollection->GetNumberOfItems();
+        for (int i=0; i<nbItems && !isActor; i++)
+          {
+            SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(aCollection->GetItemAsObject(i));
+            if (anActor && anActor->hasIO()) {
+              Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
+              if (aViewWindow->isVisible(anIO)) {
+                if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0)
+                  myActorsList.append(anActor);
+              }
             }
           }
-        }
       }
     }
   }
-
-  if (isActor)
-    SMESH::SetPickable(myActor);
-
-  return isActor;
+  
+  if (myActorsList.count() > 0) {
+    QListIterator<SMESH_Actor*> it( myActorsList );
+    while ( it.hasNext() ) {
+      SMESH_Actor* anActor = it.next();
+      if ( IsActorVisible(anActor) )
+        anActor->SetPickable(true);
+    }
+  }
+  
+  return ( isActor || (myActorsList.count() > 0) );
 }
-
+  
 //=======================================================================
 //function : setShowEntityMode
 //purpose  : make shown only entity corresponding to my type
@@ -2266,3 +2318,15 @@ void SMESHGUI_GroupDlg::restoreShowEntityMode()
   }
   myStoredShownEntity = 0;
 }
+
+//=======================================================================
+//function : IsActorVisible
+//purpose  : return visibility of the actor
+//=======================================================================
+bool SMESHGUI_GroupDlg::IsActorVisible( SMESH_Actor* theActor )
+{
+  SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView();
+  if (theActor && aViewWindow)
+    return aViewWindow->isVisible(theActor->getIO());
+  return false;
+}
index 39a41788704eefa296c2f6210429a489b017305f..2a01d48af31035cc2b0307426d395a9209458265 100644 (file)
@@ -68,9 +68,9 @@ class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
 
 public:
   SMESHGUI_GroupDlg( SMESHGUI*,
-                    SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
+                     SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
   SMESHGUI_GroupDlg( SMESHGUI*,
-                    SMESH::SMESH_GroupBase_ptr,
+                     SMESH::SMESH_GroupBase_ptr,
                      const bool theIsConvert = false );
   ~SMESHGUI_GroupDlg();
   
@@ -90,6 +90,7 @@ private slots:
   bool                          onApply();
   void                          onHelp();
   void                          onDeactivate();
+  void                          onVisibilityChanged();
   
   void                          onListSelectionChanged();
   void                          onObjectSelectionChanged();
@@ -126,6 +127,8 @@ private:
   bool                          SetAppropriateActor();
   void                          setShowEntityMode();
   void                          restoreShowEntityMode();
+
+  bool                          IsActorVisible( SMESH_Actor* );
   
   void                          setGroupColor( const SALOMEDS::Color& );
   SALOMEDS::Color               getGroupColor() const;
@@ -137,7 +140,6 @@ private:
   
   SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
   LightApp_SelectionMgr*        mySelectionMgr;          /* User shape selection */
-  SMESH_Actor*                  myActor;                 /* Current mesh actor */
   int                           myGrpTypeId;             /* Current group type id : standalone or group on geometry */
   int                           myTypeId;                /* Current type id = radio button id */
   int                           myStoredShownEntity;     /* Store ShowEntity mode of myMesh */
@@ -180,6 +182,7 @@ private:
   SMESHGUI_ShapeByMeshOp*       myShapeByMeshOp;
   
   SMESH::SMESH_Mesh_var         myMesh;
+  QList<SMESH_Actor*>           myActorsList;
   SMESH::SMESH_Group_var        myGroup;
   SMESH::SMESH_GroupOnGeom_var  myGroupOnGeom;
   QList<int>                    myIdList;
index 44cdfdf94b337e51c4b1ac53d06e50379d15b709..13f5f4a9373c2664df31c17878a9d6aeb1ea824b 100644 (file)
@@ -131,7 +131,7 @@ QWidget* SMESHGUI_GroupOpDlg::createMainFrame( QWidget* theParent )
   QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
   myColorBtn = new QtxColorButton(aColorBox);
   myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, 
-                            myColorBtn->sizePolicy().verticalPolicy() );
+                             myColorBtn->sizePolicy().verticalPolicy() );
 
   aColorBoxLayout->addWidget(aColorLab);
   aColorBoxLayout->addWidget(myColorBtn);
@@ -242,7 +242,7 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
   if ( theListGrp.isEmpty() )
   {
     SUIT_MessageBox::information( this, tr("SMESH_INSUFFICIENT_DATA"),
-                                 tr("INCORRECT_ARGUMENTS") );
+                                  tr("INCORRECT_ARGUMENTS") );
     return false;
   }
 
@@ -289,14 +289,14 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
   if ( aMeshId == -1 )
   {
     SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
-                                tr("DIFF_MESHES"));
+                                 tr("DIFF_MESHES"));
     return false;
   }
 
   if ( aGrpType == -1 ) 
   {
     SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
-                                tr("DIFF_TYPES"));
+                                 tr("DIFF_TYPES"));
     return false;
   }
 
@@ -343,10 +343,10 @@ void SMESHGUI_GroupOpDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -610,7 +610,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
   else 
   {
     SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
-                             tr("SMESH_OPERATION_FAILED"));
+                              tr("SMESH_OPERATION_FAILED"));
     return false;
   }
 }
@@ -712,7 +712,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
   else 
   {
     SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
-                             tr("SMESH_OPERATION_FAILED"));
+                              tr("SMESH_OPERATION_FAILED"));
     return false;
   }
 }
@@ -878,7 +878,7 @@ bool SMESHGUI_CutGroupsDlg::onApply()
   else 
   {
     SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
-                             tr("SMESH_OPERATION_FAILED"));
+                              tr("SMESH_OPERATION_FAILED"));
     return false;
   }
 }
@@ -1029,7 +1029,7 @@ bool SMESHGUI_DimGroupDlg::onApply()
   else 
   {
     SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
-                             tr("SMESH_OPERATION_FAILED"));
+                              tr("SMESH_OPERATION_FAILED"));
     return false;
   }
 }
index e645257e2ebc0d8ac07a9958ab827b8e1d398d15..6b4079b198d0fb19d663324b9f9f1394023e0dbf 100644 (file)
 namespace SMESH
 {
   SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh,
-                                  SMESH::ElementType theType,
-                                  const QString& theGroupName )
+                                   SMESH::ElementType theType,
+                                   const QString& theGroupName )
   {
     SMESH::SMESH_Group_var aGroup;
     try {
       if ( !theMesh->_is_nil() )
-       aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
+        aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
     }
     catch( const SALOME::SALOME_Exception& S_ex ) {
       SalomeApp_Tools::QtCatchCorbaException( S_ex );
index e0673a783a5c68ceb7ee06e3d4510b18c1c2caf2..0482e78c935a9910172d265dbc46fc1eaf112bce 100644 (file)
@@ -40,8 +40,8 @@ namespace SMESH
 {
   SMESHGUI_EXPORT
     SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr,
-                                    SMESH::ElementType,
-                                    const QString& );
+                                     SMESH::ElementType,
+                                     const QString& );
 }
 
 #endif // SMESHGUI_GROUPUTILS_H
index e9391ba04d8d484f699768987f8c5b78ac01cd64..b0ced7bb6d5cae5f867e53b072ccaf0820bf061b 100644 (file)
@@ -68,7 +68,7 @@ void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis(SMESH::SMESH_Hyp
 }
 
 void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
-                                               const QString& theHypName,
+                                                const QString& theHypName,
                                                 QWidget* parent, QObject* obj, const QString& slot )
 {
   MESSAGE( "Creation of hypothesis with initial params" );
@@ -77,8 +77,8 @@ void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr init
 }
 
 void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
-                                               const QString& theHypName,
-                                               QWidget* theParent, QObject* obj, const QString& slot )
+                                                const QString& theHypName,
+                                                QWidget* theParent, QObject* obj, const QString& slot )
 {
   MESSAGE( "Creation of hypothesis" );
 
@@ -97,8 +97,8 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
 }
 
 void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
-                                             const QString& theHypName,
-                                             QWidget* theParent, QObject* obj, const QString& slot )
+                                              const QString& theHypName,
+                                              QWidget* theParent, QObject* obj, const QString& slot )
 {
   if( CORBA::is_nil( theHypothesis ) )
     return;
@@ -111,8 +111,8 @@ void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHyp
 }
 
 void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h, 
-                                                       const QString& theHypName,
-                                                       QWidget* theParent,
+                                                        const QString& theHypName,
+                                                        QWidget* theParent,
                                                         QObject* obj, const QString& slot )
 {
   myHypName = theHypName;
@@ -173,7 +173,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
       case QVariant::Int:
         {
           SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
-         sb->setObjectName( (*anIt).myName );
+          sb->setObjectName( (*anIt).myName );
           attuneStdWidget( sb, i );
           sb->setValue( (*anIt).myValue.toInt() );
           connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
@@ -183,7 +183,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
       case QVariant::Double:
         {
           SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
-         sb->setObjectName( (*anIt).myName );
+          sb->setObjectName( (*anIt).myName );
           attuneStdWidget( sb, i );
           sb->setValue( (*anIt).myValue.toDouble() );
           connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
@@ -275,20 +275,23 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
     if( listSOmesh.size() > 0 )
       for( int i = 0; i < listSOmesh.size(); i++ )
       {
-       _PTR(SObject) submSO = listSOmesh[i];
-       SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
-       SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
-       if( !aSubMesh->_is_nil() )
-         aMesh = aSubMesh->GetFather();
-       _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
-       SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
+        _PTR(SObject) submSO = listSOmesh[i];
+        SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
+        SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
+        if( !aSubMesh->_is_nil() )
+          aMesh = aSubMesh->GetFather();
+        _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
+        SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
       }
   }
   SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
   myHypo = SMESH::SMESH_Hypothesis::_nil();
   myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil();
-  myDlg->close(); myDlg = 0;
-  //delete myDlg; myDlg = 0;
+
+  disconnect( myDlg, SIGNAL( finished( int ) ), this, SLOT( onDialogFinished( int ) ) );
+  myDlg->close();
+  //delete myDlg;
+  myDlg = 0;
   emit finished( result );
 }
 
@@ -507,7 +510,7 @@ QString SMESHGUI_GenericHypothesisCreator::helpPage() const
     aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
   else if ( aHypType == "Arithmetic1D")
     aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
-  else if ( aHypType == "FixedPointsc1D")
+  else if ( aHypType == "FixedPoints1D")
     aHelpFileName = "a1d_meshing_hypo_page.html#fixed_points_1d_anchor";
   else if ( aHypType == "MaxElementArea")
     aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor";
@@ -529,11 +532,16 @@ QString SMESHGUI_GenericHypothesisCreator::helpPage() const
     aHelpFileName = "projection_algos_page.html";
   else if ( aHypType == "NumberOfLayers")
     aHelpFileName = "radial_prism_algo_page.html";
+  else if ( aHypType == "NumberOfLayers2D")
+    aHelpFileName = "radial_quadrangle_1D2D_algo_page.html";
   else if ( aHypType == "LayerDistribution")
     aHelpFileName = "radial_prism_algo_page.html";
+  else if ( aHypType == "LayerDistribution2D")
+    aHelpFileName = "radial_quadrangle_1D2D_algo_page.html";
   else if ( aHypType == "SegmentLengthAroundVertex")
     aHelpFileName = "segments_around_vertex_algo_page.html";
-    
+  else if ( aHypType == "QuadrangleParams")
+    aHelpFileName = "a2d_meshing_hypo_page.html#hypo_quad_params_anchor";
   return aHelpFileName;
 }
 
@@ -623,10 +631,10 @@ void SMESHGUI_HypothesisDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -641,18 +649,18 @@ void SMESHGUI_HypothesisDlg::setType( const QString& t )
 }
 
 HypothesisData::HypothesisData( const QString& theTypeName,
-                               const QString& thePluginName,
-                               const QString& theServerLibName,
-                               const QString& theClientLibName,
-                               const QString& theLabel,
-                               const QString& theIconId,
-                               const QList<int>& theDim,
-                               const bool theIsAux,
-                               const QStringList& theNeededHypos,
-                               const QStringList& theOptionalHypos,
-                               const QStringList& theInputTypes,
-                               const QStringList& theOutputTypes,
-                               const bool theIsNeedGeometry,
+                                const QString& thePluginName,
+                                const QString& theServerLibName,
+                                const QString& theClientLibName,
+                                const QString& theLabel,
+                                const QString& theIconId,
+                                const QList<int>& theDim,
+                                const bool theIsAux,
+                                const QStringList& theNeededHypos,
+                                const QStringList& theOptionalHypos,
+                                const QStringList& theInputTypes,
+                                const QStringList& theOutputTypes,
+                                const bool theIsNeedGeometry,
                                 const bool supportSub)
   : TypeName( theTypeName ),
     PluginName( thePluginName ),
@@ -678,8 +686,8 @@ HypothesesSet::HypothesesSet( const QString& theSetName )
 }
 
 HypothesesSet::HypothesesSet( const QString&     theSetName,
-                             const QStringList& theHypoList,
-                             const QStringList& theAlgoList )
+                              const QStringList& theHypoList,
+                              const QStringList& theAlgoList )
   : myHypoSetName( theSetName ), 
     myHypoList( theHypoList ), 
     myAlgoList( theAlgoList ),
index cccf69fd6df83b6e4da518933c7c77e885c6643d..0891def1bc6a8f898d6b891f5970da7edf01419e 100644 (file)
@@ -52,7 +52,7 @@ public:
   virtual ~SMESHGUI_GenericHypothesisCreator();
 
   void                         create( SMESH::SMESH_Hypothesis_ptr,
-                                      const QString&, QWidget*, QObject*, const QString& );
+                                       const QString&, QWidget*, QObject*, const QString& );
   void                         create( bool, const QString&, QWidget*, QObject*, const QString& );
   void                         edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
   void                         setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
@@ -68,6 +68,9 @@ public:
   QString                      getShapeEntry() const { return myShapeEntry; }
   void                         setShapeEntry( const QString& theEntry );
 
+  QString                      getMainShapeEntry() const { return myMainShapeEntry; }
+  void                         setMainShapeEntry( const QString& theEntry ) { myMainShapeEntry = theEntry; }
+
 signals:
   void                         finished( int );
 
@@ -102,7 +105,7 @@ protected:
   static  QString              stdParamValues( const ListOfStdParams& );
   virtual void                 attuneStdWidget( QWidget*, const int ) const;
   virtual QWidget*             getCustomWidget( const StdParam&, 
-                                               QWidget*, const int ) const;
+                                                QWidget*, const int ) const;
   virtual bool                 getParamFromCustomWidget( StdParam&, QWidget* ) const;
   virtual void                 valueChanged( QWidget* );
   virtual QString              caption() const;
@@ -126,6 +129,7 @@ private:
   bool                         myIsCreate;
   QtxDialog*                   myDlg;
   QString                      myShapeEntry;
+  QString                      myMainShapeEntry;
 };
 
 class SMESHGUI_HypothesisDlg : public QtxDialog
@@ -162,7 +166,7 @@ public:
                   const QList<int>&, const bool,
                   const QStringList&, const QStringList&,
                   const QStringList&, const QStringList&,
-                 const bool=true, const bool supportSub=false );
+                  const bool=true, const bool supportSub=false );
 
   QString TypeName;        //!< hypothesis type name
   QString PluginName;      //!< plugin name
index 6bfb02b6f523c2df2ad4f30fb3a33aba3d31cb62..65a59957905f515f1a70534d10ae0bec265cec4d 100644 (file)
@@ -89,39 +89,39 @@ namespace SMESH
   QList<HypothesesSet*> myListOfHypothesesSets;
 
   void processHypothesisStatus(const int theHypStatus,
-                              SMESH::SMESH_Hypothesis_ptr theHyp,
-                              const bool theIsAddition)
+                               SMESH::SMESH_Hypothesis_ptr theHyp,
+                               const bool theIsAddition)
   {
     if (theHypStatus > SMESH::HYP_OK) {
       // get Hyp name
       QString aHypName ("NULL Hypothesis");
       if (!CORBA::is_nil(theHyp)) {
-       _PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
-       if (Shyp)
-         // name in study
-         aHypName = Shyp->GetName().c_str();
-       else
-         // label in xml file
-         aHypName = GetHypothesisData(theHyp->GetName())->Label;
+        _PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
+        if (Shyp)
+          // name in study
+          aHypName = Shyp->GetName().c_str();
+        else
+          // label in xml file
+          aHypName = GetHypothesisData(theHyp->GetName())->Label;
       }
 
       // message
       bool isFatal = (theHypStatus >= SMESH::HYP_UNKNOWN_FATAL);
       QString aMsg;
       if (theIsAddition)
-       aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
+        aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
       else
-       aMsg = (isFatal ? "SMESH_CANT_RM_HYP"  : "SMESH_RM_HYP_WRN");
+        aMsg = (isFatal ? "SMESH_CANT_RM_HYP"  : "SMESH_RM_HYP_WRN");
 
       aMsg = QObject::tr(aMsg.toLatin1().data()).arg(aHypName) +
-       QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
+        QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
 
       if ( theHypStatus == SMESH::HYP_HIDDEN_ALGO ) // PAL18501
         aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] );
 
       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                              QObject::tr("SMESH_WRN_WARNING"),
-                              aMsg);
+                               QObject::tr("SMESH_WRN_WARNING"),
+                               aMsg);
     }
   }
 
@@ -138,73 +138,73 @@ namespace SMESH
       QString HypsXml;
       char* cenv = getenv("SMESH_MeshersList");
       if (cenv)
-       HypsXml.sprintf("%s", cenv);
+        HypsXml.sprintf("%s", cenv);
 
       QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
       if (HypsXmlList.count() == 0) {
-       SUIT_MessageBox::critical(SMESHGUI::desktop(),
-                                 QObject::tr("SMESH_WRN_WARNING"),
-                                 QObject::tr("MESHERS_FILE_NO_VARIABLE"));
-       return;
+        SUIT_MessageBox::critical(SMESHGUI::desktop(),
+                                  QObject::tr("SMESH_WRN_WARNING"),
+                                  QObject::tr("MESHERS_FILE_NO_VARIABLE"));
+        return;
       }
 
       // loop on files in HypsXml
       QString aNoAccessFiles;
       for (int i = 0; i < HypsXmlList.count(); i++) {
-       QString HypsXml = HypsXmlList[ i ];
+        QString HypsXml = HypsXmlList[ i ];
 
-       // Find full path to the resource XML file
-       QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
+        // Find full path to the resource XML file
+        QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
         if ( xmlFile.isEmpty() ) // try PLUGIN resources
           xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml");
         
-       QFile file (xmlFile);
-       if (file.exists() && file.open(QIODevice::ReadOnly)) {
-         file.close();
-
-         SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
-         ASSERT(aXmlHandler);
-
-         QXmlInputSource source (&file);
-         QXmlSimpleReader reader;
-         reader.setContentHandler(aXmlHandler);
-         reader.setErrorHandler(aXmlHandler);
-         bool ok = reader.parse(source);
-         file.close();
-         if (ok) {
-           myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
+        QFile file (xmlFile);
+        if (file.exists() && file.open(QIODevice::ReadOnly)) {
+          file.close();
+
+          SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
+          ASSERT(aXmlHandler);
+
+          QXmlInputSource source (&file);
+          QXmlSimpleReader reader;
+          reader.setContentHandler(aXmlHandler);
+          reader.setErrorHandler(aXmlHandler);
+          bool ok = reader.parse(source);
+          file.close();
+          if (ok) {
+            myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
             myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap );
-           QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
-           for ( it = aXmlHandler->myListOfHypothesesSets.begin(); 
-                 it != aXmlHandler->myListOfHypothesesSets.end();
-                 ++it ) {
-             myListOfHypothesesSets.insert( pos, *it );
-           }
-         }
-         else {
-           SUIT_MessageBox::critical(SMESHGUI::desktop(),
-                                     QObject::tr("INF_PARSE_ERROR"),
-                                     QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
-         }
+            QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
+            for ( it = aXmlHandler->myListOfHypothesesSets.begin(); 
+                  it != aXmlHandler->myListOfHypothesesSets.end();
+                  ++it ) {
+              myListOfHypothesesSets.insert( pos, *it );
+            }
+          }
+          else {
+            SUIT_MessageBox::critical(SMESHGUI::desktop(),
+                                      QObject::tr("INF_PARSE_ERROR"),
+                                      QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
+          }
     delete aXmlHandler;
-       }
-       else {
-         if (aNoAccessFiles.isEmpty())
-           aNoAccessFiles = xmlFile;
-         else
-           aNoAccessFiles += ", " + xmlFile;
-       }
+        }
+        else {
+          if (aNoAccessFiles.isEmpty())
+            aNoAccessFiles = xmlFile;
+          else
+            aNoAccessFiles += ", " + xmlFile;
+        }
       } // end loop
 
 
       if (!aNoAccessFiles.isEmpty()) {
-       QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
-       aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
-       wc.suspend();
-       SUIT_MessageBox::warning(SMESHGUI::desktop(),
-                                QObject::tr("SMESH_WRN_WARNING"),
-                                aMess);
-       wc.resume();
+        QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
+        aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
+        wc.suspend();
+        SUIT_MessageBox::warning(SMESHGUI::desktop(),
+                                 QObject::tr("SMESH_WRN_WARNING"),
+                                 aMess);
+        wc.resume();
       }
     }
   }
@@ -226,13 +226,13 @@ namespace SMESH
     for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
       HypothesisData* aData = anIter.value();
       if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
-       if (checkGeometry) {
-         if (aData->IsNeedGeometry == isNeedGeometry)
-           aHypList.append(anIter.key());
-       }
-       else {
-         aHypList.append(anIter.key());
-       }
+        if (checkGeometry) {
+          if (aData->IsNeedGeometry == isNeedGeometry)
+            aHypList.append(anIter.key());
+        }
+        else {
+          aHypList.append(anIter.key());
+        }
       }
     }
     return aHypList;
@@ -248,11 +248,11 @@ namespace SMESH
 
     QList<HypothesesSet*>::iterator hypoSet;
     for ( hypoSet  = myListOfHypothesesSets.begin(); 
-         hypoSet != myListOfHypothesesSets.end();
-         ++hypoSet ) {
+          hypoSet != myListOfHypothesesSets.end();
+          ++hypoSet ) {
       HypothesesSet* aSet = *hypoSet;
       if ( aSet && aSet->count( true ) ) {
-       aSetNameList.append( aSet->name() );
+        aSetNameList.append( aSet->name() );
       }
     }
     
@@ -263,11 +263,11 @@ namespace SMESH
   {
     QList<HypothesesSet*>::iterator hypoSet;
     for ( hypoSet  = myListOfHypothesesSets.begin(); 
-         hypoSet != myListOfHypothesesSets.end();
-         ++hypoSet ) {
+          hypoSet != myListOfHypothesesSets.end();
+          ++hypoSet ) {
       HypothesesSet* aSet = *hypoSet;
       if ( aSet && aSet->name() == theSetName )
-       return aSet;
+        return aSet;
     }
     return 0;
   }
@@ -347,48 +347,48 @@ namespace SMESH
 
       // 3. Load Client Plugin Library
       try {
-       // load plugin library
-       if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
-       LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
-       if (!libHandle) {
-         // report any error, if occured
-         if ( MYDEBUG ) {
+        // load plugin library
+        if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
+        LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
+        if (!libHandle) {
+          // report any error, if occured
+          if ( MYDEBUG ) {
 #ifdef WIN32
-           const char* anError = "Can't load client meshers plugin library";
+            const char* anError = "Can't load client meshers plugin library";
 #else
-           const char* anError = dlerror();      
+            const char* anError = dlerror();      
 #endif
-           MESSAGE(anError);
-         }
-       }
-       else {
-         // get method, returning hypothesis creator
-         if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
-         typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
-           ( const QString& );
-         GetHypothesisCreator procHandle =
-           (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
-         if (!procHandle) {
-           if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
-           UnLoadLib(libHandle);
-         }
-         else {
-           // get hypothesis creator
-           if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
-           aCreator = procHandle( aHypType );
-           if (!aCreator) {
-             if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
-           }
-           else {
-             // map hypothesis creator to a hypothesis name
+            MESSAGE(anError);
+          }
+        }
+        else {
+          // get method, returning hypothesis creator
+          if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
+          typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
+            ( const QString& );
+          GetHypothesisCreator procHandle =
+            (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
+          if (!procHandle) {
+            if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
+            UnLoadLib(libHandle);
+          }
+          else {
+            // get hypothesis creator
+            if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
+            aCreator = procHandle( aHypType );
+            if (!aCreator) {
+              if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
+            }
+            else {
+              // map hypothesis creator to a hypothesis name
               // BUG 0020378
-             //myHypCreatorMap[aHypType] = aCreator;
-           }
-         }
-       }
+              //myHypCreatorMap[aHypType] = aCreator;
+            }
+          }
+        }
       }
       catch (const SALOME::SALOME_Exception& S_ex) {
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
       }
     }
 
@@ -397,25 +397,25 @@ namespace SMESH
 
 
   SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString& aHypType,
-                                              const QString& aHypName,
-                                              const bool isAlgo)
+                                               const QString& aHypName,
+                                               const bool isAlgo)
   {
     if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() << 
-                       " with name " << aHypName.toLatin1().data());
+                        " with name " << aHypName.toLatin1().data());
     HypothesisData* aHypData = GetHypothesisData(aHypType);
     QString aServLib = aHypData->ServerLibName;
     try {
       SMESH::SMESH_Hypothesis_var aHypothesis;
       aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
-                                                             aServLib.toLatin1().data());
+                                                              aServLib.toLatin1().data());
       if (!aHypothesis->_is_nil()) {
-       _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
-       if (aHypSObject) {
-         if (!aHypName.isEmpty())
-           SMESH::SetName(aHypSObject, aHypName);
-         SMESHGUI::GetSMESHGUI()->updateObjBrowser();
-         return aHypothesis._retn();
-       }
+        _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
+        if (aHypSObject) {
+          if (!aHypName.isEmpty())
+            SMESH::SetName(aHypSObject, aHypName);
+          SMESHGUI::GetSMESHGUI()->updateObjBrowser();
+          return aHypothesis._retn();
+        }
       }
     } catch (const SALOME::SALOME_Exception & S_ex) {
       SalomeApp_Tools::QtCatchCorbaException(S_ex);
@@ -435,23 +435,23 @@ namespace SMESH
       _PTR(SObject) SM = SMESH::FindSObject(aMesh);
       GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SM);
       try {
-       res = aMesh->AddHypothesis(aShapeObject, aHyp);
-       if (res < SMESH::HYP_UNKNOWN_FATAL) {
-         _PTR(SObject) aSH = SMESH::FindSObject(aHyp);
-         if (SM && aSH) {
-           SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
-         }
-       }
-       if (res > SMESH::HYP_OK) {
-         wc.suspend();
-         processHypothesisStatus(res, aHyp, true);
-         wc.resume();
-       }
+        res = aMesh->AddHypothesis(aShapeObject, aHyp);
+        if (res < SMESH::HYP_UNKNOWN_FATAL) {
+          _PTR(SObject) aSH = SMESH::FindSObject(aHyp);
+          if (SM && aSH) {
+            SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
+          }
+        }
+        if (res > SMESH::HYP_OK) {
+          wc.suspend();
+          processHypothesisStatus(res, aHyp, true);
+          wc.resume();
+        }
       }
       catch(const SALOME::SALOME_Exception& S_ex) {
-       wc.suspend();
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
-       res = SMESH::HYP_UNKNOWN_FATAL;
+        wc.suspend();
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        res = SMESH::HYP_UNKNOWN_FATAL;
       }
     }
     return res < SMESH::HYP_UNKNOWN_FATAL;
@@ -466,33 +466,33 @@ namespace SMESH
 
     if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) {
       try {
-       SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
-       _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
-       GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
-       if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
-         res = aMesh->AddHypothesis(aShapeObject, aHyp);
-         if (res < SMESH::HYP_UNKNOWN_FATAL)  {
+        SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
+        _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
+        GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
+        if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
+          res = aMesh->AddHypothesis(aShapeObject, aHyp);
+          if (res < SMESH::HYP_UNKNOWN_FATAL)  {
             _PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
             if (meshSO)
               SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
-         }
-         if (res > SMESH::HYP_OK) {
-           wc.suspend();
-           processHypothesisStatus(res, aHyp, true);
-           wc.resume();
-         }
-       }
-       else {
-         SCRUTE(aHyp->_is_nil());
-         SCRUTE(aMesh->_is_nil());
-         SCRUTE(!SsubM);
-         SCRUTE(aShapeObject->_is_nil());
-       }
+          }
+          if (res > SMESH::HYP_OK) {
+            wc.suspend();
+            processHypothesisStatus(res, aHyp, true);
+            wc.resume();
+          }
+        }
+        else {
+          SCRUTE(aHyp->_is_nil());
+          SCRUTE(aMesh->_is_nil());
+          SCRUTE(!SsubM);
+          SCRUTE(aShapeObject->_is_nil());
+        }
       }
       catch(const SALOME::SALOME_Exception& S_ex) {
-       wc.suspend();
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
-       res = SMESH::HYP_UNKNOWN_FATAL;
+        wc.suspend();
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        res = SMESH::HYP_UNKNOWN_FATAL;
       }
     }
     else {
@@ -511,28 +511,28 @@ namespace SMESH
       _PTR(Study) aStudy = GetActiveStudyDocument();
       _PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
       if( aHypObj )
-       {
-         _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
-         _PTR(SObject) aRealHypo;
-         if( aHypObj->ReferencedObject( aRealHypo ) )
-           {
-             SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
-             RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
-           }
-         else
-           {
-             SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
-             SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
-             for( int i = 0; i < meshList.size(); i++ )
-               RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
-           }
-       }
+        {
+          _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
+          _PTR(SObject) aRealHypo;
+          if( aHypObj->ReferencedObject( aRealHypo ) )
+            {
+              SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
+              RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
+            }
+          else
+            {
+              SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
+              SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
+              for( int i = 0; i < meshList.size(); i++ )
+                RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
+            }
+        }
     }
     catch(const SALOME::SALOME_Exception& S_ex)
       {
-       wc.suspend();
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
-       res = SMESH::HYP_UNKNOWN_FATAL;
+        wc.suspend();
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        res = SMESH::HYP_UNKNOWN_FATAL;
       }
     return res < SMESH::HYP_UNKNOWN_FATAL;
   }
@@ -566,7 +566,7 @@ namespace SMESH
           }
           else if(!aMesh->HasShapeToMesh()){
             res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
-           if (res < SMESH::HYP_UNKNOWN_FATAL) {
+            if (res < SMESH::HYP_UNKNOWN_FATAL) {
               _PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
               if (meshSO)
                 SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);              
@@ -579,9 +579,9 @@ namespace SMESH
           }
         }
       } catch(const SALOME::SALOME_Exception& S_ex) {
-       wc.suspend();
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
-       res = SMESH::HYP_UNKNOWN_FATAL;
+        wc.suspend();
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        res = SMESH::HYP_UNKNOWN_FATAL;
       }
     }
     return res < SMESH::HYP_UNKNOWN_FATAL;
@@ -596,25 +596,25 @@ namespace SMESH
     if (!AlgoOrHyp->_is_nil()) {
       _PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
       if (SO_Hypothesis) {
-       SObjectList listSO =
-         SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
-
-       if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
-       for (unsigned int i = 0; i < listSO.size(); i++) {
-         _PTR(SObject) SO = listSO[i];
-         if (SO) {
-           _PTR(SObject) aFather = SO->GetFather();
-           if (aFather) {
-             _PTR(SObject) SOfatherFather = aFather->GetFather();
-             if (SOfatherFather) {
-               if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
-               index++;
-               listSOmesh.resize(index);
-               listSOmesh[index - 1] = SOfatherFather;
-             }
-           }
-         }
-       }
+        SObjectList listSO =
+          SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
+
+        if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
+        for (unsigned int i = 0; i < listSO.size(); i++) {
+          _PTR(SObject) SO = listSO[i];
+          if (SO) {
+            _PTR(SObject) aFather = SO->GetFather();
+            if (aFather) {
+              _PTR(SObject) SOfatherFather = aFather->GetFather();
+              if (SOfatherFather) {
+                if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
+                index++;
+                listSOmesh.resize(index);
+                listSOmesh[index - 1] = SOfatherFather;
+              }
+            }
+          }
+        }
       }
     }
     if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed");
index 8ed6cd16f2c299272333cbcecc995765bb7662b0..56a80e43408aa09b21a14338e9557f8646fb1e61 100644 (file)
@@ -65,7 +65,7 @@ namespace SMESH
   QStringList GetAvailableHypotheses( const bool, 
                                       const int = -1, 
                                       const bool = false,
-                                     const bool = true);
+                                      const bool = true);
   SMESHGUI_EXPORT
   QStringList GetHypothesesSets();
 
@@ -77,12 +77,12 @@ namespace SMESH
 
   SMESHGUI_EXPORT
   bool IsAvailableHypothesis( const HypothesisData*,
-                             const QString&,
-                             bool& );
+                              const QString&,
+                              bool& );
 
   SMESHGUI_EXPORT
   bool IsCompatibleAlgorithm( const HypothesisData*,
-                             const HypothesisData* );
+                              const HypothesisData* );
 
   SMESHGUI_EXPORT
   SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
@@ -103,7 +103,7 @@ namespace SMESH
 
   SMESHGUI_EXPORT
   bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
-                                         SMESH::SMESH_Hypothesis_ptr );
+                                          SMESH::SMESH_Hypothesis_ptr );
 
   typedef std::vector<_PTR(SObject)> SObjectList;
   SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
index 66dcd6322dab4ba14efa6f233622b59257705749..0f1cb30efaa2d91d24028112a38ec599ed9e899f 100644 (file)
@@ -47,15 +47,15 @@ public:
       // truncate extra ids
       int ind = 0, nbId = 0;
       while ( ind < input.length() ) {
-       if ( input.at( ind ) != ' ' ) {
-         if ( ++nbId > myMaxNbId ) {
-           input.truncate( ind );
-           break;
-         }
-         ind = input.indexOf( ' ', ind );
-         if ( ind < 0 ) break;
-       }
-       ind++;
+        if ( input.at( ind ) != ' ' ) {
+          if ( ++nbId > myMaxNbId ) {
+            input.truncate( ind );
+            break;
+          }
+          ind = input.indexOf( ' ', ind );
+          if ( ind < 0 ) break;
+        }
+        ind++;
       }
     }
     if ( pos > input.length() )
diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx
new file mode 100644 (file)
index 0000000..5c6f73c
--- /dev/null
@@ -0,0 +1,251 @@
+//  Copyright (C) 2007-2009  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.
+//
+//  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   : SMESHGUI_Make2DFrom3DOp.cxx
+// Author : Open CASCADE S.A.S.
+// SMESH includes
+//
+#include "SMESHGUI_Make2DFrom3DOp.h"
+
+#include "SMESHGUI.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_MeshInfosBox.h"
+
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+
+#include <SALOME_ListIO.hxx>
+
+// SALOME KERNEL includes
+#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDSClient_SObject.hxx>
+
+// Qt includes
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Gen)
+#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+
+#include <QFrame>
+#include <QLabel>
+#include <QPixmap>
+#include <QGroupBox>
+#include <QPushButton>
+#include <QVBoxLayout>
+
+// MESH includes
+#include "SMDSAbs_ElementType.hxx"
+#include "SMDSAbs_ElementType.hxx"
+
+
+#define SPACING 6
+#define MARGIN  11
+
+// =========================================================================================
+/*!
+ * \brief Dialog to show creted mesh statistic
+ */
+//=======================================================================
+
+SMESHGUI_Make2DFrom3DDlg::SMESHGUI_Make2DFrom3DDlg( QWidget* parent )
+ : SMESHGUI_Dialog( parent, false, true, Close/* | Help*/ )
+{
+  setWindowTitle( tr("CAPTION") );
+  QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
+  aDlgLay->setMargin( 0 );
+  aDlgLay->setSpacing( SPACING );
+  QFrame* aMainFrame = createMainFrame(mainFrame());
+  aDlgLay->addWidget(aMainFrame);
+  aDlgLay->setStretchFactor(aMainFrame, 1);
+}
+
+// =========================================================================================
+/*!
+ * \brief Dialog destructor
+ */
+//=======================================================================
+
+SMESHGUI_Make2DFrom3DDlg::~SMESHGUI_Make2DFrom3DDlg()
+{
+}
+
+//=======================================================================
+// function : createMainFrame()
+// purpose  : Create frame containing dialog's fields
+//=======================================================================
+
+QFrame* SMESHGUI_Make2DFrom3DDlg::createMainFrame (QWidget* theParent)
+{
+  QFrame* aFrame = new QFrame(theParent);
+
+  SUIT_ResourceMgr* rm = resourceMgr();
+  QPixmap iconCompute (rm->loadPixmap("SMESH", tr("ICON_2D_FROM_3D")));
+
+  // Mesh name
+  QGroupBox* nameBox = new QGroupBox(tr("SMESH_MESHINFO_NAME"), aFrame );
+  QHBoxLayout* nameBoxLayout = new QHBoxLayout(nameBox);
+  nameBoxLayout->setMargin(MARGIN); nameBoxLayout->setSpacing(SPACING);
+  myMeshName = new QLabel(nameBox);
+  nameBoxLayout->addWidget(myMeshName);
+
+  // Mesh Info
+
+  myFullInfo = new SMESHGUI_MeshInfosBox(true,  aFrame);
+
+  // add all widgets to aFrame
+  QVBoxLayout* aLay = new QVBoxLayout(aFrame);
+  aLay->setMargin( 0 );
+  aLay->setSpacing( 0 );
+  aLay->addWidget( nameBox );
+  aLay->addWidget( myFullInfo );
+
+  ((QPushButton*) button( OK ))->setDefault( true );
+  return aFrame;
+}
+
+//================================================================================
+/*!
+ * \brief set name of the mesh
+*/
+//================================================================================
+
+void SMESHGUI_Make2DFrom3DDlg::SetMeshName(const QString& theName)
+{
+  myMeshName->setText( theName );
+}
+
+//================================================================================
+/*!
+ * \brief set mesh info
+*/
+//================================================================================
+
+void SMESHGUI_Make2DFrom3DDlg::SetMeshInfo(const SMESH::long_array& theInfo)
+{
+  myFullInfo->SetMeshInfo( theInfo );
+}
+
+//================================================================================
+/*!
+ * \brief Constructor
+*/
+//================================================================================
+
+SMESHGUI_Make2DFrom3DOp::SMESHGUI_Make2DFrom3DOp()
+ : SMESHGUI_Operation()
+{
+  myDlg = new SMESHGUI_Make2DFrom3DDlg(desktop());
+}
+
+//================================================================================
+/*!
+ * \brief Desctructor
+*/
+//================================================================================
+
+SMESHGUI_Make2DFrom3DOp::~SMESHGUI_Make2DFrom3DOp()
+{
+}
+
+//================================================================================
+/*!
+ * \brief perform it's intention action: compute 2D mesh on 3D
+ */
+//================================================================================
+
+void SMESHGUI_Make2DFrom3DOp::startOperation()
+{
+  myMesh = SMESH::SMESH_Mesh::_nil();
+  
+  // check selection
+  LightApp_SelectionMgr *Sel = selectionMgr();
+  SALOME_ListIO selected; Sel->selectedObjects( selected );
+
+  int nbSel = selected.Extent();
+  if (nbSel != 1) {
+    SUIT_MessageBox::warning(desktop(),
+                             tr("SMESH_WRN_WARNING"),
+                             tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+    onCancel();
+    return;
+  }
+
+  Handle(SALOME_InteractiveObject) anIO = selected.First();
+  myMesh = SMESH::GetMeshByIO(anIO);
+  if (myMesh->_is_nil()) {
+    SUIT_MessageBox::warning(desktop(),
+                             tr("SMESH_WRN_WARNING"),
+                             tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+    onCancel();
+    return;
+  }
+
+  SMESHGUI_Operation::startOperation();
+
+
+  // backup mesh info before 2D mesh computation
+  SMESH::long_array_var anOldInfo = myMesh->GetMeshInfo();
+  
+
+  if (!compute2DMesh()) {
+    SUIT_MessageBox::warning(desktop(),
+                             tr("SMESH_WRN_WARNING"),
+                             tr("SMESH_WRN_COMPUTE_FAILED"));
+    onCancel();
+    return;
+  }
+  // get new mesh statistic
+  SMESH::long_array_var aNewInfo = myMesh->GetMeshInfo();
+  // get difference in mesh statistic from old to new
+  for ( int i = SMDSEntity_Node; i < SMDSEntity_Last; i++ )
+    aNewInfo[i] -= anOldInfo[i];
+
+  // update presentation
+  SMESH::Update(anIO, SMESH::eDisplay);
+
+  // show computated result
+  _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
+  if ( aMeshSObj )
+    myDlg->SetMeshName( aMeshSObj->GetName().c_str() );
+  myDlg->SetMeshInfo( aNewInfo );
+  myDlg->show(); /*exec();*/
+  commit();
+}
+
+//================================================================================
+/*!
+ * \brief compute 2D mesh on initial 3D
+ */
+//================================================================================
+
+bool SMESHGUI_Make2DFrom3DOp::compute2DMesh()
+{
+  SUIT_OverrideCursor wc;
+  SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+  return aMeshEditor->Make2DMeshFrom3D();
+}
diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.h b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.h
new file mode 100644 (file)
index 0000000..adc0aa5
--- /dev/null
@@ -0,0 +1,87 @@
+//  Copyright (C) 2007-2009  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.
+//
+//  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
+//
+// SMESH SMESHGUI : GUI for SMESH component
+// File   : SMESHGUI_Make2DFrom3D.h
+// Author : Open CASCADE S.A.S.
+//
+#ifndef SMESHGUI_Make2DFrom3DOp_H
+#define SMESHGUI_Make2DFrom3DOp_H
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
+#include "SMESHGUI_Dialog.h"
+#include "SMESHGUI_Operation.h"
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+
+class QFrame;
+class SMESHGUI_MeshInfosBox;
+
+/*!
+ * \brief Dialog to show result mesh statistic
+ */
+
+class SMESHGUI_Make2DFrom3DDlg :  public SMESHGUI_Dialog
+{
+  Q_OBJECT
+
+ public:
+  SMESHGUI_Make2DFrom3DDlg( QWidget* );
+  virtual ~SMESHGUI_Make2DFrom3DDlg();
+
+  void                   SetMeshName(const QString& theName);
+  void                   SetMeshInfo(const SMESH::long_array& theInfo);
+
+ private:
+  QFrame*                createMainFrame( QWidget* );
+
+ private:
+  QLabel*                myMeshName;
+  SMESHGUI_MeshInfosBox* myFullInfo;
+};
+
+
+/*!
+ * \brief Operation to compute 2D mesh on 3D
+ */
+
+class SMESHGUI_Make2DFrom3DOp : public SMESHGUI_Operation
+{
+ public:
+  SMESHGUI_Make2DFrom3DOp();
+  virtual ~SMESHGUI_Make2DFrom3DOp();
+
+ protected:
+  virtual void                       startOperation();
+
+ private:
+  bool                               compute2DMesh();
+
+ private:
+  SMESH::SMESH_Mesh_var              myMesh;
+  QPointer<SMESHGUI_Make2DFrom3DDlg> myDlg;
+};
+
+#endif // SMESHGUI_Make2DFrom3DOp_H
index ac654fdd6bb4e5cf5d1bc76f65ab8bd91a25a9c3..ae769c301a1f3751f07da2e509974af69008eaa7 100644 (file)
@@ -208,7 +208,7 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent)
   connect(myAutoSearchChkBox, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
 
   myMoveRBtn->setChecked(true);
-  myIdBtn->setDown(true);
+  myIdBtn->setChecked(true);
   myAutoSearchChkBox->setChecked(true);
 
   return aFrame;
@@ -228,11 +228,11 @@ void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled (bool on)
     if ( aSender == myCoordBtn ) // button to set coord by node selection
     {
       if ( myIdBtn->isEnabled() )
-        myIdBtn->setDown( !on );
+        myIdBtn->setChecked( !on );
     }
     else if ( aSender == myIdBtn ) // button to select a node to move
     {
-      myCoordBtn->setDown( !on );
+      myCoordBtn->setChecked( !on );
     }
     else if ( aSender == myMoveRBtn ) // move node method
     {
@@ -241,7 +241,7 @@ void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled (bool on)
     else if ( aSender == myCreateRBtn ) // create node method
     {
       myNodeToMoveGrp->setEnabled( false );
-      myCoordBtn->setDown( true ); 
+      myCoordBtn->setChecked( true ); 
     }
   }      
   if ( aSender == myAutoSearchChkBox ) // automatic node search
@@ -249,9 +249,9 @@ void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled (bool on)
     if ( on ) {
       myId->setText("");
       myId->setReadOnly ( true );
-      myIdBtn->setDown( false );
+      myIdBtn->setChecked( false );
       myIdBtn->setEnabled( false );
-      myCoordBtn->setDown( true );
+      myCoordBtn->setChecked( true );
     }
     else {
       myId->setReadOnly ( false );
@@ -367,7 +367,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
 
   if ( !myMeshActor ) {
     SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
-                             tr("INVALID_MESH") );
+                              tr("INVALID_MESH") );
     dlg()->show();
     return false;
   }
@@ -376,7 +376,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
   if ( !isValid( msg ) ) { // node id is invalid
     if( !msg.isEmpty() )
       SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
-                               tr("INVALID_ID") );
+                                tr("INVALID_ID") );
     dlg()->show();
     return false;
   }
@@ -386,7 +386,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
     SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
     if (aMesh->_is_nil()) {
       SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
-                                  tr("SMESHG_NO_MESH") );
+                                   tr("SMESHG_NO_MESH") );
       return true;
     }
     SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
@@ -394,7 +394,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
       return true;
 
     int aResult = 0;
-    if ( myDlg->myCreateRBtn->isDown() )
+    if ( myDlg->myCreateRBtn->isChecked() )
     {
       aResult = aMeshEditor->AddNode(myDlg->myX->GetValue(),
                                      myDlg->myY->GetValue(),
@@ -414,7 +414,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
       aParameters << myDlg->myX->text();
       aParameters << myDlg->myY->text();
       aParameters << myDlg->myZ->text();
-      aMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+      aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
 
       myDlg->myId->setText("");
 
@@ -444,7 +444,7 @@ bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
 {
   bool ok = true;
   if ( myMeshActor &&
-       myDlg->myMoveRBtn->isDown() &&
+       myDlg->myMoveRBtn->isChecked() &&
        !myDlg->myAutoSearchChkBox->isChecked() )
   {
     ok = false;
@@ -482,7 +482,7 @@ void SMESHGUI_MakeNodeAtPointOp::onSelectionDone()
     SMESH_Actor* aMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
 
     if (!aMeshActor) { // coord by geom
-      if ( myDlg->myCoordBtn->isDown() ) {
+      if ( myDlg->myCoordBtn->isChecked() ) {
         GEOM::GEOM_Object_var geom = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
         if ( !geom->_is_nil() ) {
           TopoDS_Vertex aShape;
@@ -510,14 +510,14 @@ void SMESHGUI_MakeNodeAtPointOp::onSelectionDone()
       if (SMDS_Mesh* aMesh = aMeshActor->GetObject()->GetMesh()) {
         if (const SMDS_MeshNode* aNode = aMesh->FindNode(aString.toInt())) {
           myNoPreview = true;
-          if ( myDlg->myCoordBtn->isDown() ) { // set coord
+          if ( myDlg->myCoordBtn->isChecked() ) { // set coord
             myDlg->myX->SetValue(aNode->X());
             myDlg->myY->SetValue(aNode->Y());
             myDlg->myZ->SetValue(aNode->Z());
             myNoPreview = false;
             redisplayPreview();
           }
-          else if ( myDlg->myIdBtn->isDown() &&
+          else if ( myDlg->myIdBtn->isChecked() &&
                     myDlg->myIdBtn->isEnabled() ) { // set node to move
             myDlg->myId->setText(aString);
             myNoPreview = false;
@@ -545,7 +545,7 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
   SMESH::MeshPreviewStruct_var aMeshPreviewStruct;
 
   bool moveShown = false;
-  if ( myDlg->myMoveRBtn->isDown() && // Move method
+  if ( myDlg->myMoveRBtn->isChecked() && // Move method
        myMeshActor)
   {
     const bool autoSearch = myDlg->myAutoSearchChkBox->isChecked();
index 3a9f90256b6bf1bd2e7fe8bcec7d93dc287aefbb..a3446f2997310181f4820abfd354d6b942d8e628 100644 (file)
@@ -381,7 +381,7 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh
   myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
   myHypoSetButton->setEnabled( false );
   myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding, 
-                                 myHypoSetButton->sizePolicy().verticalPolicy() );
+                                  myHypoSetButton->sizePolicy().verticalPolicy() );
   
   // Fill layout
   QGridLayout* aLay = new QGridLayout( mainFrame() );
@@ -542,14 +542,14 @@ void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable )
         myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
         myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
         connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
-       connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+        connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
       }
     }
     else {
       disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
       if ( myGeomPopup ) {
-       delete myGeomPopup;
-       myGeomPopup = 0;
+        delete myGeomPopup;
+        myGeomPopup = 0;
       }
     }
   }
index ffa85053db24e8dad789e38b0fcf9a5004817221..7554a7959400562b7d2ffcb4d552c640008231ab 100644 (file)
@@ -60,7 +60,14 @@ enum TCol {
 // =========================================================================================
 
 SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent)
-  : QGroupBox( tr("SMESH_MESHINFO_TITLE"), theParent ), myFull( full )
+: QGroupBox( tr("SMESH_MESHINFO_TITLE"), theParent ), myFull( full ),
+  myNbNode(0), my0DElem(0), myNbEdge(0), myNbLinEdge(0), myNbQuadEdge(0),
+  myNbTrai(0), myNbLinTrai(0), myNbQuadTrai(0), myNbQuad(0), myNbLinQuad(0),
+  myNbQuadQuad(0), myNbFace(0), myNbLinFace(0), myNbQuadFace(0), myNbPolyg(0),
+  myNbHexa(0), myNbLinHexa(0), myNbQuadHexa(0), myNbTetra(0), myNbLinTetra(0),
+  myNbQuadTetra(0), myNbPyra(0), myNbLinPyra(0), myNbQuadPyra(0), myNbPrism(0),
+  myNbLinPrism(0), myNbQuadPrism(0), myNbVolum(0), myNbLinVolum(0), myNbQuadVolum(0),
+  myNbPolyh(0)
 {
   QGridLayout* l = new QGridLayout(this);
   l->setMargin( MARGIN );
@@ -277,6 +284,17 @@ SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent
     myNbNode      = new QLabel( this );
     l->addWidget( myNbNode,      row, 1 );
 
+    // 0D elements
+    row = l->rowCount();         // retrieve current row count
+    // --
+    lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_0DELEMS")), this );
+    l->addWidget( lab,           row, 0 );
+    // --
+    my0DElem = new QLabel( this );
+    l->addWidget( my0DElem,      row, 1 );
+
+    addSeparator(this);          // add separator
+
     // edges
     row = l->rowCount();         // retrieve current row count
     // --
@@ -340,52 +358,52 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
 
   // edges
   myNbEdge     ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
-                                           theInfo[SMDSEntity_Quad_Edge] ));
+                                            theInfo[SMDSEntity_Quad_Edge] ));
   myNbLinEdge  ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
   myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
 
   // faces
   myNbFace     ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
-                                           theInfo[SMDSEntity_Quad_Triangle] +
-                                           theInfo[SMDSEntity_Quadrangle] +
-                                           theInfo[SMDSEntity_Quad_Quadrangle] +
-                                           theInfo[SMDSEntity_Polygon] ));
+                                            theInfo[SMDSEntity_Quad_Triangle] +
+                                            theInfo[SMDSEntity_Quadrangle] +
+                                            theInfo[SMDSEntity_Quad_Quadrangle] +
+                                            theInfo[SMDSEntity_Polygon] ));
   myNbLinFace  ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
-                                           theInfo[SMDSEntity_Quadrangle] +
-                                           theInfo[SMDSEntity_Polygon] ));
+                                            theInfo[SMDSEntity_Quadrangle] +
+                                            theInfo[SMDSEntity_Polygon] ));
   myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
-                                           theInfo[SMDSEntity_Quad_Quadrangle] ));
+                                            theInfo[SMDSEntity_Quad_Quadrangle] ));
 
   // volumes
   myNbVolum    ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
-                                           theInfo[SMDSEntity_Quad_Tetra] +
-                                           theInfo[SMDSEntity_Pyramid] +
-                                           theInfo[SMDSEntity_Quad_Pyramid] +
-                                           theInfo[SMDSEntity_Hexa] +
-                                           theInfo[SMDSEntity_Quad_Hexa] +
-                                           theInfo[SMDSEntity_Penta] +
-                                           theInfo[SMDSEntity_Quad_Penta] +
-                                           theInfo[SMDSEntity_Polyhedra] ));
+                                            theInfo[SMDSEntity_Quad_Tetra] +
+                                            theInfo[SMDSEntity_Pyramid] +
+                                            theInfo[SMDSEntity_Quad_Pyramid] +
+                                            theInfo[SMDSEntity_Hexa] +
+                                            theInfo[SMDSEntity_Quad_Hexa] +
+                                            theInfo[SMDSEntity_Penta] +
+                                            theInfo[SMDSEntity_Quad_Penta] +
+                                            theInfo[SMDSEntity_Polyhedra] ));
   myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
-                                           theInfo[SMDSEntity_Pyramid] +
-                                           theInfo[SMDSEntity_Hexa] +
-                                           theInfo[SMDSEntity_Penta] +
-                                           theInfo[SMDSEntity_Polyhedra] ));
+                                            theInfo[SMDSEntity_Pyramid] +
+                                            theInfo[SMDSEntity_Hexa] +
+                                            theInfo[SMDSEntity_Penta] +
+                                            theInfo[SMDSEntity_Polyhedra] ));
   myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
-                                           theInfo[SMDSEntity_Quad_Pyramid] +
-                                           theInfo[SMDSEntity_Quad_Hexa] +
-                                           theInfo[SMDSEntity_Quad_Penta] ));
+                                            theInfo[SMDSEntity_Quad_Pyramid] +
+                                            theInfo[SMDSEntity_Quad_Hexa] +
+                                            theInfo[SMDSEntity_Quad_Penta] ));
 
   if ( myFull )
   {
     // triangles
     myNbTrai     ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
-                                             theInfo[SMDSEntity_Quad_Triangle] ));
+                                              theInfo[SMDSEntity_Quad_Triangle] ));
     myNbLinTrai  ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
     myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
     // quadrangles
     myNbQuad     ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
-                                             theInfo[SMDSEntity_Quad_Quadrangle] ));
+                                              theInfo[SMDSEntity_Quad_Quadrangle] ));
     myNbLinQuad  ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
     myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] ));
     // poligones
@@ -393,22 +411,22 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
 
     // tetras
     myNbTetra    ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
-                                             theInfo[SMDSEntity_Quad_Tetra] ));
+                                              theInfo[SMDSEntity_Quad_Tetra] ));
     myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
     myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
     // hexas
     myNbHexa     ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
-                                             theInfo[SMDSEntity_Quad_Hexa] ));
+                                              theInfo[SMDSEntity_Quad_Hexa] ));
     myNbLinHexa  ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
     myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] ));
     // pyras
     myNbPyra     ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] +
-                                           theInfo[SMDSEntity_Quad_Pyramid] ));
+                                            theInfo[SMDSEntity_Quad_Pyramid] ));
     myNbLinPyra  ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] ));
     myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
     // prisms
     myNbPrism    ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
-                                             theInfo[SMDSEntity_Quad_Penta] ));
+                                              theInfo[SMDSEntity_Quad_Penta] ));
     myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
     myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
     // polyedres
index 0bc4b633afc930cd480764e3c555b85a1f43c89a..fd6d42e5211b0de99039d1615683d28bfa93280e 100644 (file)
@@ -198,17 +198,17 @@ void SMESHGUI_MeshInfosDlg::DumpMeshInfos()
       //CORBA::Object_var anObject = aSO->GetObject();
       CORBA::Object_var anObject = SMESH::SObjectToObject(aSO);
       if (!CORBA::is_nil(anObject)) {
-       SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
-       if (!anIDSource->_is_nil()) {
-         myWGStack->setCurrentWidget(myMeshWidget);
-         setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
-         myMeshName->setText(aSO->GetName().c_str());
+        SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
+        if (!anIDSource->_is_nil()) {
+          myWGStack->setCurrentWidget(myMeshWidget);
+          setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
+          myMeshName->setText(aSO->GetName().c_str());
 
-         SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
-         myMeshInfoBox->SetMeshInfo( aMeshInfo );
+          SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
+          myMeshInfoBox->SetMeshInfo( aMeshInfo );
 
-         return;
-       }
+          return;
+        }
       }
     }
   }
@@ -297,10 +297,10 @@ void SMESHGUI_MeshInfosDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
index ce49ff9103f9890891c1fea4237da1f2eb085e62..eaa3098aaf9222075ffac73c2d9909234ee377cb 100644 (file)
@@ -85,7 +85,8 @@ SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh )
   myToCreate( theToCreate ),
   myIsMesh( theIsMesh ),
   myDlg( 0 ),
-  myShapeByMeshOp( 0 )
+  myShapeByMeshOp( 0 ),
+  myHypoSet( 0 )
 {
   if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists
     GeometryGUI::InitGeomGen();
@@ -575,11 +576,11 @@ void SMESHGUI_MeshOp::selectionDone()
             SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
           bool editSubmesh = ( !sm->_is_nil() &&
                                SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ),
-                                                         tr( "EDIT_SUBMESH_QUESTION"),
-                                                         SUIT_MessageBox::Yes | 
-                                                         SUIT_MessageBox::No,
-                                                         SUIT_MessageBox::No )
-                              == SUIT_MessageBox::Yes );
+                                                          tr( "EDIT_SUBMESH_QUESTION"),
+                                                          SUIT_MessageBox::Yes | 
+                                                          SUIT_MessageBox::No,
+                                                          SUIT_MessageBox::No )
+                               == SUIT_MessageBox::Yes );
           if ( editSubmesh )
           {
             selectionMgr()->clearFilters();
@@ -1068,18 +1069,47 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim,
       removeCustomFilters(); // Issue 0020170
 
       // Get Entry of the Geom object
+      QString aGeomEntry = "";
+      QString aMeshEntry = "";
       QString anObjEntry = "";
-      anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-      if ( anObjEntry == "" ) {
-        anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
-       if ( anObjEntry != "" ) {
-         _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
-         GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
-         anObjEntry = ( aGeomVar->_is_nil() ) ? "" : anObjEntry = aGeomVar->GetStudyEntry();
-       }
+      aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
+      aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
+      anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
+      
+      if ( aMeshEntry != "" ) { // Get Geom object from Mesh
+        _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+        GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
+        aMeshEntry = ( aGeomVar->_is_nil() ) ? "" : aMeshEntry = aGeomVar->GetStudyEntry();
+      }
+      
+      if ( aMeshEntry == "" && aGeomEntry == "" ) {
+        _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+        GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
+        if ( !aGeomVar->_is_nil() )
+          aGeomEntry = aGeomVar->GetStudyEntry();
       }
 
-      aCreator->setShapeEntry( anObjEntry );
+      if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // take geometry from submesh
+        _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+        if ( pObj ) {
+          // if current object is sub-mesh
+          SMESH::SMESH_subMesh_var aSubMeshVar =
+            SMESH::SMESH_subMesh::_narrow( _CAST( SObject,pObj )->GetObject() );
+          if ( !aSubMeshVar->_is_nil() ) {
+            SMESH::SMESH_Mesh_var aMeshVar =  aSubMeshVar->GetFather();
+            if ( !aMeshVar->_is_nil() ) {
+              _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar );
+              GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( aMeshSO );
+              if ( !aGeomVar->_is_nil() )
+                aMeshEntry = aGeomVar->GetStudyEntry();
+            }
+          }
+        }
+      }
+      
+      aCreator->setShapeEntry( aGeomEntry );
+      if ( aMeshEntry != "" )
+        aCreator->setMainShapeEntry( aMeshEntry );
       myDlg->setEnabled( false );
       aCreator->create(initParamHyp, aHypName, myDlg, this, SLOT( onHypoCreated( int ) ) );
       dialog = true;
@@ -1162,18 +1192,47 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
     aCreator->setInitParamsHypothesis( initParamHyp );
 
     // Get Entry of the Geom object
+    QString aGeomEntry = "";
+    QString aMeshEntry = "";
     QString anObjEntry = "";
-    anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-    if ( anObjEntry == "" ) {
-      anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
-      if ( anObjEntry != "" ) {
-       _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
-       GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
-       anObjEntry = aGeomVar->GetStudyEntry();
+    aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
+    aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
+    anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
+
+    if ( aMeshEntry != "" ) { // Get Geom object from Mesh
+      _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+      GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
+      aMeshEntry = ( aGeomVar->_is_nil() ) ? "" : aMeshEntry = aGeomVar->GetStudyEntry();
+    }
+
+    if ( aMeshEntry == "" && aGeomEntry == "" ) {
+      _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+      GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
+      if ( !aGeomVar->_is_nil() )
+        aGeomEntry = aGeomVar->GetStudyEntry();
+    }
+
+    if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // take geometry from submesh
+      _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+      if ( pObj ) {
+        // if current object is sub-mesh
+        SMESH::SMESH_subMesh_var aSubMeshVar =
+          SMESH::SMESH_subMesh::_narrow( _CAST( SObject,pObj )->GetObject() );
+        if ( !aSubMeshVar->_is_nil() ) {
+          SMESH::SMESH_Mesh_var aMeshVar =  aSubMeshVar->GetFather();
+          if ( !aMeshVar->_is_nil() ) {
+            _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar );
+            GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( aMeshSO );
+            if ( !aGeomVar->_is_nil() )
+              aMeshEntry = aGeomVar->GetStudyEntry();
+          }
+        }
       }
     }
 
-    aCreator->setShapeEntry( anObjEntry );
+    aCreator->setShapeEntry( aGeomEntry );
+    if ( aMeshEntry != "" )
+      aCreator->setMainShapeEntry( aMeshEntry );
     removeCustomFilters(); // Issue 0020170
     myDlg->setEnabled( false );
     aCreator->edit( aHyp.in(), aHypItem.second, dlg(), this, SLOT( onHypoEdited( int ) ) );
@@ -1331,7 +1390,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
         CORBA::String_var curHypType = curHyp->GetName();
         if ( !algoDeselectedByUser &&
              myObjHyps[ dim ][ type ].count() > 0 &&
-             curHypType == myObjHyps[ dim ][ type ].first().first->GetName())
+             !strcmp( curHypType, myObjHyps[ dim ][ type ].first().first->GetName()) )
         {
           HypothesisData* hypData = SMESH::GetHypothesisData( curHyp->GetName() );
           for (int i = 0; i < myAvailableHypData[ dim ][ Algo ].count(); ++i) {
@@ -1607,7 +1666,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess )
           aNewGeomGroupName += aName;
           SALOMEDS::SObject_var aNewGroupSO =
             geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar, 
-                               aNewGeomGroupName.toLatin1().data(), mainGeom);
+                                aNewGeomGroupName.toLatin1().data(), mainGeom);
         }
       }
     }
@@ -1760,7 +1819,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
   {
     SMESH::SMESH_Hypothesis_var aHypVar = (*anIter).first;
     CORBA::String_var aName = aHypVar->GetName();
-    if ( !aHypVar->_is_nil() && aHypName == aName )
+    if ( !aHypVar->_is_nil() && !strcmp(aHypName.toLatin1().data(), aName) )
     {
       anAlgoVar = aHypVar;
       break;
@@ -1801,7 +1860,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
     {
       SMESH::SMESH_Hypothesis_var aHypVar = (*anIter).first;
       CORBA::String_var aName = aHypVar->GetName();
-      if ( !aHypVar->_is_nil() && aHypName == aName )
+      if ( !aHypVar->_is_nil() && !strcmp(aHypName.toLatin1().data(), aName) )
       {
         anAlgoVar = aHypVar;
         break;
index e3e4358ed07d988f4614af8a1ffb80a4f1cb2afb..93804eb0999beda06a03f3112a6eeb1f309cf219 100644 (file)
@@ -102,7 +102,7 @@ private:
                                           const int ); // access to myAvailableHypData
 
   void                           createHypothesis( const int, const int,
-                                                  const QString& );
+                                                   const QString& );
 
   bool                           createMesh( QString& );
   bool                           createSubMesh( QString& );
index 820b2ec91e8b08caa1c2f7704082165ae8f63ace..d80523066d8100e775a643ed78675e88baefd75c 100755 (executable)
@@ -420,10 +420,10 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
       ok = myNode2->isValid( msg, theMess ) && ok;
     if( !ok ) {
       if( theMess ) {
-       QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-       if ( !msg.isEmpty() )
-         str += "\n" + msg;
-       SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+        QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+        if ( !msg.isEmpty() )
+          str += "\n" + msg;
+        SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
       }
       return false;
     }
@@ -440,14 +440,14 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
   {
     if (theMess)
       SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
-                                  tr("SMESHGUI_INVALID_PARAMETERS"));
+                                   tr("SMESHGUI_INVALID_PARAMETERS"));
     return false;
   }
 
   if ( myName->text().isEmpty() ) {
     if (theMess)
       SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
-                                  tr("SMESHGUI_INVALID_PARAMETERS"));
+                                   tr("SMESHGUI_INVALID_PARAMETERS"));
     return false;
   }
 
@@ -473,16 +473,16 @@ bool SMESHGUI_MeshPatternDlg::onApply()
       varIds->length(ids.count());
       int i = 0;
       for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
-       varIds[i++] = *it;
+        varIds[i++] = *it;
       myType == Type_2d
-       ? myPattern->ApplyToMeshFaces  (myMesh, varIds, getNode(false), myReverseChk->isChecked())
-       : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+        ? myPattern->ApplyToMeshFaces  (myMesh, varIds, getNode(false), myReverseChk->isChecked())
+        : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
 
       QStringList aParameters;
       aParameters << myNode1->text();
       if(myType == Type_3d )
-       aParameters << myNode2->text();
-      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+        aParameters << myNode2->text();
+      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
 
     } else { // Applying a pattern to geometrical object
       if (myType == Type_2d)
@@ -497,15 +497,15 @@ bool SMESHGUI_MeshPatternDlg::onApply()
       //mySelectionMgr->clearSelected();
       bool autoUpdate = SMESHGUI::automaticUpdate();
       if (!isRefine() && autoUpdate) {
-       _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
-       SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
-       if (!anActor) {
-         anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
-         if (anActor) {
-           SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
-           SMESH::FitAll();
-         }
-       }
+        _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
+        SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
+        if (!anActor) {
+          anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
+          if (anActor) {
+            SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
+            SMESH::FitAll();
+          }
+        }
       }
       mySelectionMgr->clearSelected();
       SMESH::UpdateView();
@@ -517,7 +517,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
       return true;
     } else {
       SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
-                                  tr("SMESH_OPERATION_FAILED"));
+                                   tr("SMESH_OPERATION_FAILED"));
       return false;
     }
   } catch (const SALOME::SALOME_Exception& S_ex) {
@@ -565,17 +565,17 @@ void SMESHGUI_MeshPatternDlg::onHelp()
   if (app) 
     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
   else {
-               QString platform;
+                QString platform;
 #ifdef WIN32
-               platform = "winapplication";
+                platform = "winapplication";
 #else
-               platform = "application";
+                platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -593,7 +593,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
       SALOME_ListIO aList;
       mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
       if (aList.Extent() != 1)
-       return;
+        return;
 
       // Retrieve mesh from selection
       Handle(SALOME_InteractiveObject) anIO = aList.First();
@@ -624,11 +624,11 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
       SALOME_ListIO aList;
       mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
       if (aList.Extent() != 1)
-       return;
+        return;
 
       QString anIds;
       if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
-       anIds = "";
+        anIds = "";
 
       myBusy = true;
       mySelEdit[ Ids ]->setText(anIds);
@@ -638,7 +638,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
       SALOME_ListIO aList;
       mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
       if (aList.Extent() != 1)
-       return;
+        return;
 
       // Get geom object from selection
       Handle(SALOME_InteractiveObject) anIO = aList.First();
@@ -809,14 +809,14 @@ void SMESHGUI_MeshPatternDlg::onOpen()
   QFile aFile(fName);
   if (!aFile.open(QIODevice::ReadOnly)) {
     SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
-                                tr("ERROR_OF_OPENING"));
+                                 tr("ERROR_OF_OPENING"));
     return;
   }
 
   QByteArray aDataArray = aFile.readAll();
   if (aDataArray.isEmpty()) {
     SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
-                                tr("ERROR_OF_READING"));
+                                 tr("ERROR_OF_READING"));
     return;
   }
 
@@ -1046,11 +1046,11 @@ void SMESHGUI_MeshPatternDlg::updateWgState()
     if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
       SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
       if (keyPoints->length()) {
-       myNode1->setEnabled(true);
-       myNode2->setEnabled(true);
-       myNode1->setRange(1, keyPoints->length());
-       myNode2->setRange(1, keyPoints->length());
-       return;
+        myNode1->setEnabled(true);
+        myNode2->setEnabled(true);
+        myNode1->setRange(1, keyPoints->length());
+        myNode2->setRange(1, keyPoints->length());
+        return;
       }
     }
 
@@ -1075,13 +1075,13 @@ void SMESHGUI_MeshPatternDlg::activateSelection()
 
     if (myType == Type_2d)
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(FaceSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(FaceSelection);
       }
     else
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(CellSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(CellSelection);
       }
   }
   else {
@@ -1146,7 +1146,7 @@ bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName)
   } catch (const SALOME::SALOME_Exception& S_ex) {
     SalomeApp_Tools::QtCatchCorbaException(S_ex);
     SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
-                                tr("ERROR_OF_LOADING") );
+                                 tr("ERROR_OF_LOADING") );
     return false;
   }
 }
@@ -1229,13 +1229,13 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid()
       varIds->length(ids.count());
       int i = 0;
       for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
-       varIds[i++] = *it;
+        varIds[i++] = *it;
       pnts = myType == Type_2d
-       ? myPattern->ApplyToMeshFaces  (myMesh, varIds, getNode(false), myReverseChk->isChecked())
-       : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+        ? myPattern->ApplyToMeshFaces  (myMesh, varIds, getNode(false), myReverseChk->isChecked())
+        : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
     } else {
       pnts = myType == Type_2d
-       ? myPattern->ApplyToFace   (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
+        ? myPattern->ApplyToFace   (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
       : myPattern->ApplyTo3DBlock(myGeomObj[ Object ], myGeomObj[ Vertex1 ], myGeomObj[ Vertex2 ]);
     }
 
@@ -1380,7 +1380,7 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
     for (int i = 0; i < aListId.count(); i++) {
       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
       if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
-       newIndices.Add(e->GetID());
+        newIndices.Add(e->GetID());
     }
     mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
index b524c2f83efe936250a665a5dffa51fa756a3d69..df71815c2e28213ac94f9d69205bb3f594bb809b 100644 (file)
@@ -46,13 +46,13 @@ namespace SMESH
     if(!CORBA::is_nil(anObj)){
       SMESH_Mesh_var aMesh = SMESH_Mesh::_narrow(anObj);
       if(!CORBA::is_nil(aMesh))
-       return aMesh;
+        return aMesh;
       SMESH_GroupBase_var aGroup = SMESH_GroupBase::_narrow(anObj);
       if(!CORBA::is_nil(aGroup))
-       return aGroup->GetMesh();
+        return aGroup->GetMesh();
       SMESH_subMesh_var aSubMesh = SMESH_subMesh::_narrow(anObj);
       if(!CORBA::is_nil(aSubMesh))
-       return aSubMesh->GetFather();
+        return aSubMesh->GetFather();
     }
     return SMESH_Mesh::_nil();
   }
@@ -65,17 +65,17 @@ namespace SMESH
       QString name = baseName;
       while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
         int nb = 0;
-       QStringList names = name.split("_", QString::KeepEmptyParts);
-       if ( names.count() > 0 ) {
-         bool ok;
-         int index = names.last().toInt( &ok );
-         if ( ok ) {
-           nb = index;
-           names.removeLast();
-         }
-       }
-       names.append( QString::number( nb+1 ) );
-       name = names.join( "_" );
+        QStringList names = name.split("_", QString::KeepEmptyParts);
+        if ( names.count() > 0 ) {
+          bool ok;
+          int index = names.last().toInt( &ok );
+          if ( ok ) {
+            nb = index;
+            names.removeLast();
+          }
+        }
+        names.append( QString::number( nb+1 ) );
+        name = names.join( "_" );
       }
       return name;
     }
index 199575293198380fc5a22b6bd78b8a599bf17564..6243255afc44a7b7a51c87d35e5b30785cae6869 100644 (file)
@@ -278,7 +278,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
   if (myId->text().isEmpty()) {
     if (theMess)
       SUIT_MessageBox::information(this, tr("SMESH_WARNING"),
-                                  tr("NODE_ID_IS_NOT_DEFINED"));
+                                   tr("NODE_ID_IS_NOT_DEFINED"));
     return false;
   }
 
@@ -291,7 +291,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
     if( theMess ) {
       QString str( tr( "SMESH_INCORRECT_INPUT" ) );
       if ( !msg.isEmpty() )
-       str += "\n" + msg;
+        str += "\n" + msg;
       SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
     }
     return false;
@@ -329,7 +329,7 @@ bool SMESHGUI_MoveNodesDlg::onApply()
   SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
   if (aMesh->_is_nil()) {
     SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
-                                tr("SMESHG_NO_MESH"));
+                                 tr("SMESHG_NO_MESH"));
     return false;
   }
 
@@ -346,7 +346,7 @@ bool SMESHGUI_MoveNodesDlg::onApply()
     aParameters << myX->text();
     aParameters << myY->text();
     aParameters << myZ->text();
-    aMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+    aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
   } catch (...) {
   }
 
@@ -398,17 +398,17 @@ void SMESHGUI_MoveNodesDlg::onHelp()
   if (app) 
     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
   else {
-               QString platform;
+                QString platform;
 #ifdef WIN32
-               platform = "winapplication";
+                platform = "winapplication";
 #else
-               platform = "application";
+                platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -435,13 +435,13 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
       myBusy = false;
 
       if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
-       TColStd_MapOfInteger aListInd;
-       aListInd.Add(anElem->GetID());
-       mySelector->AddOrRemoveIndex(anIO,aListInd, false);
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->highlight(anIO,true,true);
-       
-       onSelectionDone();
+        TColStd_MapOfInteger aListInd;
+        aListInd.Add(anElem->GetID());
+        mySelector->AddOrRemoveIndex(anIO,aListInd, false);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->highlight(anIO,true,true);
+        
+        onSelectionDone();
       }
     }
   }
index 526c3f3e3ea8c5a492396320e96784aeae6deb7d..907f8a65b86b43439488e7d909061f8a03a20c72 100755 (executable)
 //=======================================================================
 SMESHGUI_MultiEditDlg
 ::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
-                       const int theMode,
-                       const bool the3d2d):
+                        const int theMode,
+                        const bool the3d2d):
   QDialog(SMESH::GetDesktop(theModule)),
   mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
@@ -192,7 +192,7 @@ QWidget* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool
 
   myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
   mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0, 
-                           1, mySelGrpLayout->columnCount());
+                            1, mySelGrpLayout->columnCount());
 
   // Split/Join criterion group
   myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp);
@@ -440,30 +440,30 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
       // skl 07.02.2006
       SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
       if( myFilterType == SMESH::TriaFilter || 
-         myFilterType == SMESH::QuadFilter ||
-         myFilterType == SMESH::FaceFilter ) {
-       SMDS_FaceIteratorPtr it = aMesh->facesIterator();
-       while(it->more()) {
-         const SMDS_MeshFace* f = it->next();
-         if(myFilterType == SMESH::FaceFilter) {
-           myIds.Add(f->GetID());
-         }
-         else if( myFilterType==SMESH::TriaFilter &&
-                  ( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
-           myIds.Add(f->GetID());
-         }
-         else if( myFilterType==SMESH::QuadFilter &&
-                  ( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
-           myIds.Add(f->GetID());
-         }
-       }
+          myFilterType == SMESH::QuadFilter ||
+          myFilterType == SMESH::FaceFilter ) {
+        SMDS_FaceIteratorPtr it = aMesh->facesIterator();
+        while(it->more()) {
+          const SMDS_MeshFace* f = it->next();
+          if(myFilterType == SMESH::FaceFilter) {
+            myIds.Add(f->GetID());
+          }
+          else if( myFilterType==SMESH::TriaFilter &&
+                   ( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
+            myIds.Add(f->GetID());
+          }
+          else if( myFilterType==SMESH::QuadFilter &&
+                   ( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
+            myIds.Add(f->GetID());
+          }
+        }
       }
       else if(myFilterType == SMESH::VolumeFilter) {
-       SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
-       while(it->more()) {
-         const SMDS_MeshVolume* f = it->next();
-         myIds.Add(f->GetID());
-       }
+        SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
+        while(it->more()) {
+          const SMDS_MeshVolume* f = it->next();
+          myIds.Add(f->GetID());
+        }
       }
       /* commented by skl 07.02.2006
       TVisualObjPtr aVisualObj = anActor->GetObject();
@@ -472,14 +472,14 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
         for (int i = 0, n = aGrid->GetNumberOfCells(); i < n; i++) {
           vtkCell* aCell = aGrid->GetCell(i);
           if (aCell != 0) {
-           vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
-           vtkQuad*     aQua = vtkQuad::SafeDownCast(aCell);
-           vtkPolygon*  aPG  = vtkPolygon::SafeDownCast(aCell);
+            vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
+            vtkQuad*     aQua = vtkQuad::SafeDownCast(aCell);
+            vtkPolygon*  aPG  = vtkPolygon::SafeDownCast(aCell);
 
-           vtkCell3D*   a3d  = vtkCell3D::SafeDownCast(aCell);
-           vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
+            vtkCell3D*   a3d  = vtkCell3D::SafeDownCast(aCell);
+            vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
 
-           if (aTri && myFilterType == SMESHGUI_TriaFilter ||
+            if (aTri && myFilterType == SMESHGUI_TriaFilter ||
                 aQua && myFilterType == SMESHGUI_QuadFilter ||
                 (aTri || aQua || aPG) && myFilterType == SMESHGUI_FaceFilter ||
                 (a3d || aPH) && myFilterType == SMESHGUI_VolumeFilter) {
@@ -540,10 +540,10 @@ void SMESHGUI_MultiEditDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -594,10 +594,10 @@ void SMESHGUI_MultiEditDlg::onSelectionDone()
     if (aNbItems > 0) {
       QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
       for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
-       QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
-       QListWidgetItem* anItem;
-       foreach(anItem, items)
-         anItem->setSelected(true);
+        QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
+        QListWidgetItem* anItem;
+        foreach(anItem, items)
+          anItem->setSelected(true);
       }
     }
     myMesh = SMESH::GetMeshByIO(anIO);
@@ -1180,7 +1180,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
     if( theMess ) {
       QString str( tr( "SMESH_INCORRECT_INPUT" ) );
       if ( !msg.isEmpty() )
-       str += "\n" + msg;
+        str += "\n" + msg;
       SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
     }
     return false;
@@ -1198,7 +1198,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito
   if( ok ) {
     QStringList aParameters;
     aParameters << myMaxAngleSpin->text();
-    myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+    myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
   }
   return ok;
 }
index 0ada531f925b40dda1e7819a44e93affa3af542c..f1499681442c854118c3833abfdd9caabe86c506 100755 (executable)
@@ -113,7 +113,7 @@ protected:
   void                      setSelectionMode();
   virtual bool              isIdValid( const int ) const;
   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, 
-                                    const SMESH::long_array& ) = 0;
+                                     const SMESH::long_array& ) = 0;
   int                       entityType();
 
 protected:
index 2e00469d6e1fb1d218d2f08a7d551ecdcce975ce..76b75dbb9139c5a924b33baa70166ffe2724a853 100644 (file)
@@ -95,11 +95,11 @@ namespace SMESH
       _PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
       SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
       aMeshEditor->AddNode( x, y, z );
-      theMesh->SetParameters( SMESHGUI::JoinObjectParameters(theParameters) );
+      theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
       _PTR(Study) aStudy = GetActiveStudyDocument();
       CORBA::Long anId = aStudy->StudyId();
       if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
-       aVisualObj->Update( true );
+        aVisualObj->Update( true );
       }
     } 
     catch ( SALOME::SALOME_Exception& exc ) {
@@ -235,7 +235,7 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ):
   mySimulation = new SMESH::TNodeSimulation( SMESH::GetViewWindow( mySMESHGUI ) );
   
   QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", 
-                                                                  tr( "ICON_DLG_NODE" ) ) );
+                                                                   tr( "ICON_DLG_NODE" ) ) );
   
   QVBoxLayout* SMESHGUI_NodesDlgLayout = new QVBoxLayout( this );
   SMESHGUI_NodesDlgLayout->setSpacing( SPACING );
@@ -398,7 +398,7 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
 
   if ( myMesh->_is_nil() ) {
     SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ),
-                             tr( "MESH_IS_NOT_SELECTED" ) );
+                              tr( "MESH_IS_NOT_SELECTED" ) );
     return false;
   }
 
@@ -472,7 +472,7 @@ void SMESHGUI_NodesDlg::ClickOnHelp()
   LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
   if ( app ) 
     app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : 
-                             QString( "" ), myHelpFileName );
+                              QString( "" ), myHelpFileName );
   else {
     QString platform;
 #ifdef WIN32
@@ -481,10 +481,10 @@ void SMESHGUI_NodesDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning( this, tr("WRN_WARNING"),
-                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                             arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
-                                                                   platform ) ).
-                             arg( myHelpFileName ) );
+                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                              arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
+                                                                    platform ) ).
+                              arg( myHelpFileName ) );
   }
 }
 
@@ -508,19 +508,19 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument()
       if ( myMesh->_is_nil() ) return;
       QString aText;
       if ( SMESH::GetNameOfSelectedNodes( mySelector, anIO, aText ) == 1 ) {
-       if ( SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh.in() ) ) {
-         if ( SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh() ) {
-           if ( const SMDS_MeshNode* aNode = aMesh->FindNode( aText.toInt() ) ) {
-             SpinBox_X->SetValue( aNode->X() );
-             SpinBox_Y->SetValue( aNode->Y() );
-             SpinBox_Z->SetValue( aNode->Z() );
+        if ( SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh.in() ) ) {
+          if ( SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh() ) {
+            if ( const SMDS_MeshNode* aNode = aMesh->FindNode( aText.toInt() ) ) {
+              SpinBox_X->SetValue( aNode->X() );
+              SpinBox_Y->SetValue( aNode->Y() );
+              SpinBox_Z->SetValue( aNode->Z() );
             }
-         }
-       }
+          }
+        }
       }
       mySimulation->SetPosition( SpinBox_X->GetValue(),
-                                SpinBox_Y->GetValue(),
-                                SpinBox_Z->GetValue() );
+                                 SpinBox_Y->GetValue(),
+                                 SpinBox_Z->GetValue() );
     }
   }
 }
index 40bb88e6559d6448ad5dc5fb0af3821c601670ff..863d4333af775bba0d34daa2f727751853746344 100755 (executable)
@@ -120,7 +120,7 @@ bool SMESHGUI_Operation::isReadyToStart() const
   else if ( getSMESHGUI() == 0 )
   {
     SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
-                             tr( "NO_MODULE" ) );
+                              tr( "NO_MODULE" ) );
     return false;
   }
   else if ( isStudyLocked() )
@@ -200,10 +200,10 @@ void SMESHGUI_Operation::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
-                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                 platform)).
-                             arg(myHelpFileName) );
+                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                              arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                  platform)).
+                              arg(myHelpFileName) );
   }
 }
 
@@ -231,7 +231,7 @@ bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const
     {
       if ( theMess )
         SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
-                                 tr( "WRN_STUDY_LOCKED" ) );
+                                  tr( "WRN_STUDY_LOCKED" ) );
       return true;
     }
   }
@@ -260,7 +260,7 @@ bool SMESHGUI_Operation::isValid( SUIT_Operation* theOtherOp ) const
 
   return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) &&
          ( !anOps.contains( theOtherOp->metaObject()->className() ) || 
-          anOps.contains( metaObject()->className() ) );
+           anOps.contains( metaObject()->className() ) );
 
   return true;
 }
index c8ab77ac83b23ae758217b56393f62f451a7e57d..608a6e3a0efa3a7b325c7068ee195712fb66dfff 100644 (file)
@@ -95,9 +95,9 @@ void SMESHGUI_PatternWidget::paintEvent( QPaintEvent* )
     QPoint aQPnt = mapCoords( aPoint.x, aPoint.y );
 
     painter.drawPie( aQPnt.x() - Radius, aQPnt.y() - Radius, 
-                    Radius * 2, Radius * 2, 0, 360 * 16 );
+                     Radius * 2, Radius * 2, 0, 360 * 16 );
     painter.drawText( aQPnt.x() + Shift, aQPnt.y() - Shift, 
-                     QString::number( i+1 ) );
+                      QString::number( i+1 ) );
   }
 
   // Draw lines
index e4a6e41d3bc48951a3129730ac1cc8b22af1a144..fb2547811eb54b16536f68993576d306933c85a7 100644 (file)
@@ -53,8 +53,8 @@ public:
   ~SMESHGUI_PatternWidget();
   
   void               SetPoints( const PointVector&,
-                               const QVector<int>&,
-                               const ConnectivityVector& );
+                                const QVector<int>&,
+                                const ConnectivityVector& );
 
 private:
   PointVector        myPoints;
index 3b16aaf0b02668ada6a464e6fc9382a1eae3785c..f8ed909ae6d49faf6ed288514874929219d87fca 100644 (file)
@@ -158,10 +158,10 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
 
   connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
-          this,       SLOT( DeactivateActiveDialog() ) );
+           this,       SLOT( DeactivateActiveDialog() ) );
   /* to close dialog if study change */
   connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
-          this,       SLOT( ClickOnCancel() ) );
+           this,       SLOT( ClickOnCancel() ) );
 }
 
 //=================================================================================
index a6d44e57a2c9ccb6c1b3e83add38bc754a5d7e99..175677f536e81e467a2852b50c968e9367987664 100644 (file)
@@ -300,7 +300,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
 
   QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color",
-                                     QColor(255, 255, 255));
+                                      QColor(255, 255, 255));
   myTitleColorBtn->setColor(titleColor);
   myTitleFontCombo->setCurrentIndex(0);
   if (mgr->hasValue("SMESH", "scalar_bar_title_font")) {
@@ -316,9 +316,9 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
     myTitleItalicCheck->setChecked( f.italic() );
     myTitleShadowCheck->setChecked( f.overline() );
   }
-                                     
+                                      
   QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color", 
-                                     QColor(255, 255, 255));
+                                      QColor(255, 255, 255));
   myLabelsColorBtn->setColor(labelColor);
   myLabelsFontCombo->setCurrentIndex(0);
   if (mgr->hasValue("SMESH", "scalar_bar_label_font")) {
@@ -352,16 +352,16 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
   QString name = isHoriz ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1";
 
   myIniX = mgr->doubleValue("SMESH", name.arg( "x" ), 
-                           myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
+                            myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
 
   myIniY = mgr->doubleValue("SMESH", name.arg( "y" ),
-                           myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
+                            myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
 
   myIniW = mgr->doubleValue("SMESH", name.arg( "width" ),
-                           myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
+                            myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
 
   myIniH = mgr->doubleValue("SMESH", name.arg( "height" ),
-                           myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
+                            myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
 
   setOriginAndSize(myIniX, myIniY, myIniW, myIniH);
 
@@ -504,10 +504,10 @@ void SMESHGUI_Preferences_ScalarBarDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -528,56 +528,56 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
     if( anIO->hasEntry() ) {
       SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
       if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
-       myActor = anActor;
-       vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
-
-       if ( myScalarBarActor->GetLookupTable() ) {
-         vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
-         myMinEdit->setText( QString::number( range[0],'g',12 ) );
-         myMaxEdit->setText( QString::number( range[1],'g',12 ) );
-       }
-
-       vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
-       vtkFloatingPointType aTColor[3];
-       aTitleTextPrp->GetColor( aTColor );
-       myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
-       myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
-       myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
-       myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
-       myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
-
-       vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
-       vtkFloatingPointType aLColor[3];
-       aLabelsTextPrp->GetColor( aLColor );
-       myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
-       myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
-       myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
-       myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
-       myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
-
-       myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
-       myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
-
-       if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
-         myVertRadioBtn->setChecked( true );
-       else
-         myHorizRadioBtn->setChecked( true );
-       myIniOrientation = myVertRadioBtn->isChecked();
-
-       myIniX = myScalarBarActor->GetPosition()[0];
-       myIniY = myScalarBarActor->GetPosition()[1];
-       myIniW = myScalarBarActor->GetWidth();
-       myIniH = myScalarBarActor->GetHeight();
-       setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
-
-       myRangeGrp->setEnabled( true );
-       myFontGrp->setEnabled( true );
-       myLabColorGrp->setEnabled( true );
-       myOrientationGrp->setEnabled( true );
-       myOriginDimGrp->setEnabled( true );
-       myOkBtn->setEnabled( true );
-       myApplyBtn->setEnabled( true );
-       return;
+        myActor = anActor;
+        vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
+
+        if ( myScalarBarActor->GetLookupTable() ) {
+          vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
+          myMinEdit->setText( QString::number( range[0],'g',12 ) );
+          myMaxEdit->setText( QString::number( range[1],'g',12 ) );
+        }
+
+        vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
+        vtkFloatingPointType aTColor[3];
+        aTitleTextPrp->GetColor( aTColor );
+        myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
+        myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
+        myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
+        myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
+        myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
+
+        vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
+        vtkFloatingPointType aLColor[3];
+        aLabelsTextPrp->GetColor( aLColor );
+        myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
+        myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
+        myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
+        myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
+        myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
+
+        myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
+        myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
+
+        if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
+          myVertRadioBtn->setChecked( true );
+        else
+          myHorizRadioBtn->setChecked( true );
+        myIniOrientation = myVertRadioBtn->isChecked();
+
+        myIniX = myScalarBarActor->GetPosition()[0];
+        myIniY = myScalarBarActor->GetPosition()[1];
+        myIniW = myScalarBarActor->GetWidth();
+        myIniH = myScalarBarActor->GetHeight();
+        setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
+
+        myRangeGrp->setEnabled( true );
+        myFontGrp->setEnabled( true );
+        myLabColorGrp->setEnabled( true );
+        myOrientationGrp->setEnabled( true );
+        myOriginDimGrp->setEnabled( true );
+        myOkBtn->setEnabled( true );
+        myApplyBtn->setEnabled( true );
+        return;
       }
     }
   }
@@ -625,9 +625,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onXYChanged()
  */
 //=================================================================================================
 void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x,
-                                                         const double y,
-                                                         const double w,
-                                                         const double h )
+                                                          const double y,
+                                                          const double w,
+                                                          const double h )
 {
   blockSignals( true );
   myXSpin->setValue( x );
@@ -656,9 +656,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged()
     setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
   else
     setOriginAndSize( aOrientation ? DEF_VER_X : DEF_HOR_X,
-                     aOrientation ? DEF_VER_Y : DEF_HOR_Y,
-                     aOrientation ? DEF_VER_W : DEF_HOR_W,
-                     aOrientation ? DEF_VER_H : DEF_HOR_H );
+                      aOrientation ? DEF_VER_Y : DEF_HOR_Y,
+                      aOrientation ? DEF_VER_W : DEF_HOR_W,
+                      aOrientation ? DEF_VER_H : DEF_HOR_H );
 }
 
 //=================================================================================================
index 60963126798977b9d2bdc92fef65e891d65bb40c..cc41262020870dceaf32ddcbea92377521d6fe36 100644 (file)
@@ -63,9 +63,9 @@ public:
 
   void                     closeEvent( QCloseEvent* );
   void                     setOriginAndSize( const double,
-                                            const double,
-                                            const double,
-                                            const double );
+                                             const double,
+                                             const double,
+                                             const double );
   void                     initScalarBarFromResources();
 
 protected slots:
index 7986c2d63c0e9c9782400f3f309b08116b189bb9..9af8862ef8c4981276ecfb3a5963704e223fabf2 100644 (file)
@@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
-         SLOT(onTextChange(const QString&)));
+          SLOT(onTextChange(const QString&)));
 
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(CellSelection);
@@ -291,10 +291,10 @@ void SMESHGUI_RemoveElementsDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -321,15 +321,15 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
       
       QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
       for (int i = 0; i < aListId.count(); i++) {
-       if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
-         newIndices.Add(anElem->GetID());
-         myNbOkElements++;
-       }
+        if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
+          newIndices.Add(anElem->GetID());
+          myNbOkElements++;
+        }
       }
       
       mySelector->AddOrRemoveIndex(anIO,newIndices,false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight(anIO,true,true);
+        aViewWindow->highlight(anIO,true,true);
     }
   }
   
@@ -410,8 +410,8 @@ void SMESHGUI_RemoveElementsDlg::SetEditCurrentArgument()
   case 0: /* default constructor */
     {
       if(send == SelectButtonC1A1) {
-       LineEditC1A1->setFocus();
-       myEditCurrentArgument = LineEditC1A1;
+        LineEditC1A1->setFocus();
+        myEditCurrentArgument = LineEditC1A1;
       }
       SelectionIntoArgument();
       break;
@@ -509,8 +509,8 @@ void SMESHGUI_RemoveElementsDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index c511dbae41d20d6d61ec95a75780a0078ba2e4a1..e6687ff2946da6b141ed2397f0570859c243e900 100644 (file)
@@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
-         SLOT(onTextChange(const QString&)));
+          SLOT(onTextChange(const QString&)));
   
   SMESH::SetPointRepresentation(true);
   
@@ -297,10 +297,10 @@ void SMESHGUI_RemoveNodesDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -327,15 +327,15 @@ void SMESHGUI_RemoveNodesDlg::onTextChange(const QString& theNewText)
       
       QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
       for (int i = 0; i < aListId.count(); i++) {
-       if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
-         newIndices.Add(aNode->GetID());
-         myNbOkNodes++;
-       }
+        if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
+          newIndices.Add(aNode->GetID());
+          myNbOkNodes++;
+        }
       }
 
       mySelector->AddOrRemoveIndex(anIO,newIndices,false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight(anIO,true,true);
+        aViewWindow->highlight(anIO,true,true);
     }
   }
 
@@ -416,8 +416,8 @@ void SMESHGUI_RemoveNodesDlg::SetEditCurrentArgument()
   case 0: /* default constructor */
     {
       if(send == SelectButtonC1A1) {
-       LineEditC1A1->setFocus();
-       myEditCurrentArgument = LineEditC1A1;
+        LineEditC1A1->setFocus();
+        myEditCurrentArgument = LineEditC1A1;
       }
       SelectionIntoArgument();
       break;
@@ -516,8 +516,8 @@ void SMESHGUI_RemoveNodesDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index 26a2614ac5d8db345584b2455a3c4ddee7c92750..5e575a67000587d335fa670d2d58f6e95575197a 100644 (file)
@@ -78,14 +78,14 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int
   setModal(false);
   setAttribute(Qt::WA_DeleteOnClose, true);
   setWindowTitle(unit == 0 ? 
-                tr("SMESH_RENUMBERING_NODES_TITLE") : 
-                tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
+                 tr("SMESH_RENUMBERING_NODES_TITLE") : 
+                 tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
   setSizeGripEnabled(true);
 
   SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ? 
-                                   tr("ICON_DLG_RENUMBERING_NODES") : 
-                                   tr("ICON_DLG_RENUMBERING_ELEMENTS")));
+                                    tr("ICON_DLG_RENUMBERING_NODES") : 
+                                    tr("ICON_DLG_RENUMBERING_ELEMENTS")));
   QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT")));
 
   QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this);
@@ -94,9 +94,9 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int
 
   /***************************************************************/
   GroupConstructors = new QGroupBox(unit == 0 ? 
-                                   tr("SMESH_NODES") :
-                                   tr("SMESH_ELEMENTS"), 
-                                   this);
+                                    tr("SMESH_NODES") :
+                                    tr("SMESH_ELEMENTS"), 
+                                    this);
   myHelpFileName = unit == 0 ? 
     "renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" :
     "renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
@@ -219,22 +219,22 @@ void SMESHGUI_RenumberingDlg::ClickOnApply()
       bool isUnitsLabeled = false;
       
       if (myUnit == 0 && anActor) {
-       isUnitsLabeled = anActor->GetPointsLabeled();
-       if (isUnitsLabeled)  anActor->SetPointsLabeled(false);
+        isUnitsLabeled = anActor->GetPointsLabeled();
+        if (isUnitsLabeled)  anActor->SetPointsLabeled(false);
       }
       else if (myUnit == 1 && anActor) {
-       isUnitsLabeled = anActor->GetCellsLabeled();
-       if (isUnitsLabeled)  anActor->SetCellsLabeled(false);
+        isUnitsLabeled = anActor->GetCellsLabeled();
+        if (isUnitsLabeled)  anActor->SetCellsLabeled(false);
       }
       
       SUIT_OverrideCursor aWaitCursor;
       if (myUnit == 0) {
-       aMeshEditor->RenumberNodes();
-       if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
+        aMeshEditor->RenumberNodes();
+        if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
       }
       else if (myUnit == 1) {
-       aMeshEditor->RenumberElements();
-       if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
+        aMeshEditor->RenumberElements();
+        if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
       }
     }
     catch(...) {
@@ -285,10 +285,10 @@ void SMESHGUI_RenumberingDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -316,7 +316,7 @@ void SMESHGUI_RenumberingDlg::SelectionIntoArgument()
       Handle(SALOME_InteractiveObject) IO = aList.First();
       myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
       if (myMesh->_is_nil())
-       aString = "";
+        aString = "";
     }
   }
 
@@ -338,12 +338,12 @@ void SMESHGUI_RenumberingDlg::SetEditCurrentArgument()
     {
     case 0: /* default constructor */
       {
-       if(send == SelectButton) {
-         LineEditMesh->setFocus();
-         myEditCurrentArgument = LineEditMesh;
-       }
-       SelectionIntoArgument();
-       break;
+        if(send == SelectButton) {
+          LineEditMesh->setFocus();
+          myEditCurrentArgument = LineEditMesh;
+        }
+        SelectionIntoArgument();
+        break;
       }
     }
 }
index e9e7fef05a8442748dc152179f3791b08db409a3..484989dfd1e4e8c321906ebe5d04139281b39340 100644 (file)
@@ -452,7 +452,7 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
       myIDs.clear();
       myNbOkElements = 0;
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(aSelMode);
+        aViewWindow->SetSelectionMode(aSelMode);
     }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
@@ -519,32 +519,32 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
       
       if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
         if( CheckBoxMesh->isChecked() ) {
-         if( GetConstructorId() == 0 )
-           SMESH::ListOfGroups_var groups = 
-             aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
-                                                          anAngle, aNbSteps, aTolerance);
-         else
-           SMESH::ListOfGroups_var groups = 
-             aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
-                                                          anAngle, aNbSteps, aTolerance);
-       }
-       else
-         SMESH::ListOfGroups_var groups = 
-           aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
-                                                anAngle, aNbSteps, aTolerance);
+          if( GetConstructorId() == 0 )
+            SMESH::ListOfGroups_var groups = 
+              aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
+                                                           anAngle, aNbSteps, aTolerance);
+          else
+            SMESH::ListOfGroups_var groups = 
+              aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
+                                                           anAngle, aNbSteps, aTolerance);
+        }
+        else
+          SMESH::ListOfGroups_var groups = 
+            aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
+                                                 anAngle, aNbSteps, aTolerance);
       }
       else {
         if( CheckBoxMesh->isChecked() ) {
-         if( GetConstructorId() == 0 )
-           aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
-         else
-           aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
-       }
-       else
-         aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
+          if( GetConstructorId() == 0 )
+            aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
+          else
+            aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
+        }
+        else
+          aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
       }
 
-      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
     } catch (...) {
     }
 
@@ -602,10 +602,10 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -653,15 +653,15 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
       QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
       
       for (int i = 0; i < aListId.count(); i++) {
-       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-       if (e)
-         newIndices.Add(e->GetID());
-       myNbOkElements++;
+        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+        if (e)
+          newIndices.Add(e->GetID());
+        myNbOkElements++;
       }
 
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( myActor->getIO(), true, true );
+        aViewWindow->highlight( myActor->getIO(), true, true );
       
       myElementsId = theNewText;
     }
@@ -744,7 +744,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
       myElementsId = aString;
       if (aNbUnits < 1)
-       return;
+        return;
     }
     myNbOkElements = true;
   } else {
@@ -834,20 +834,20 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(ActorSelection);
+        aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       int aConstructorId = GetConstructorId();
       if (aConstructorId == 0)
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(EdgeSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(EdgeSelection);
+        }
       else if (aConstructorId == 1)
-       {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(FaceSelection);
-       }
+        {
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(FaceSelection);
+        }
     }
   } else if (send == SelectPointButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_X;
@@ -956,13 +956,13 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(EdgeSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(EdgeSelection);
       }
     else if (aConstructorId == 1)
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(FaceSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(FaceSelection);
       }
 
     LineEditElements->setReadOnly(false);
@@ -993,8 +993,8 @@ int SMESHGUI_RevolutionDlg::GetConstructorId()
 bool SMESHGUI_RevolutionDlg::IsAxisOk()
 {
   return (SpinBox_DX->GetValue() != 0 ||
-         SpinBox_DY->GetValue() != 0 ||
-         SpinBox_DZ->GetValue() != 0);
+          SpinBox_DY->GetValue() != 0 ||
+          SpinBox_DZ->GetValue() != 0);
 }
 
 //=================================================================================
@@ -1055,7 +1055,7 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
       
       anElementsId->length(aListElementsId.count());
       for (int i = 0; i < aListElementsId.count(); i++)
-       anElementsId[i] = aListElementsId[i].toInt();
+        anElementsId[i] = aListElementsId[i].toInt();
       
       SMESH::AxisStruct anAxis;
       
@@ -1071,27 +1071,27 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
       double aTolerance = SpinBox_Tolerance->GetValue();
       
       if (GroupAngle->checkedId() == 1)
-       anAngle = anAngle/aNbSteps;
+        anAngle = anAngle/aNbSteps;
       
       try {
-       SUIT_OverrideCursor aWaitCursor;
-       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+        SUIT_OverrideCursor aWaitCursor;
+        SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
         if( CheckBoxMesh->isChecked() ) {
-         if( GetConstructorId() == 0 )
-           aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
-                                              anAngle, aNbSteps, aTolerance);
-         else
-           aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
-                                              anAngle, aNbSteps, aTolerance);
-       }
-       else
-         aMeshEditor->RotationSweep(anElementsId.inout(), 
-                                    anAxis, 
-                                    anAngle, 
-                                    aNbSteps, 
-                                    aTolerance);
-       SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
-       mySimulation->SetData(aMeshPreviewStruct._retn());
+          if( GetConstructorId() == 0 )
+            aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
+                                               anAngle, aNbSteps, aTolerance);
+          else
+            aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
+                                               anAngle, aNbSteps, aTolerance);
+        }
+        else
+          aMeshEditor->RotationSweep(anElementsId.inout(), 
+                                     anAxis, 
+                                     anAngle, 
+                                     aNbSteps, 
+                                     aTolerance);
+        SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
+        mySimulation->SetData(aMeshPreviewStruct._retn());
       } catch (...) {}
     }
     else
@@ -1155,8 +1155,8 @@ void SMESHGUI_RevolutionDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index 4f122537b7d6a641f2946e991baf0883f5d9ee7e..d9352dbc87e1403b4c868bcf5b827023aa70526d 100644 (file)
@@ -414,8 +414,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
           aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
         else
             aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
-       if( !myMesh->_is_nil())
-         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !myMesh->_is_nil())
+          myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
       case COPY_ELEMS_BUTTON:
         if ( makeGroups ) {
@@ -431,8 +431,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
           else 
             aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
         }
-       if( !myMesh->_is_nil())
-         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !myMesh->_is_nil())
+          myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
       case MAKE_MESH_BUTTON:
         SMESH::SMESH_Mesh_var mesh;
@@ -442,8 +442,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
         else 
           mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
                                              LineEditNewMesh->text().toLatin1().data());
-       if( !mesh->_is_nil())
-         mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !mesh->_is_nil())
+          mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
       }
     } catch (...) {
     }
@@ -506,10 +506,10 @@ void SMESHGUI_RotationDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -543,15 +543,15 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText)
       
       QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
       for (int i = 0; i < aListId.count(); i++) {
-       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-       if (e)
-         newIndices.Add(e->GetID());
-       myNbOkElements++;
+        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+        if (e)
+          newIndices.Add(e->GetID());
+        myNbOkElements++;
       }
 
       mySelector->AddOrRemoveIndex( anIO, newIndices, false );
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( anIO, true, true );
+        aViewWindow->highlight( anIO, true, true );
       
       myElementsId = theNewText;
     }
@@ -743,23 +743,23 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
         myEditCurrentArgument = (QWidget*)LineEditElements;
         SMESH::SetPointRepresentation(false);
         if (CheckBoxMesh->isChecked()) {
-         if ( aViewWindow )
-           aViewWindow->SetSelectionMode(ActorSelection);
+          if ( aViewWindow )
+            aViewWindow->SetSelectionMode(ActorSelection);
           mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
         } else {
-         if ( aViewWindow )
-           aViewWindow->SetSelectionMode( CellSelection );
-       }
+          if ( aViewWindow )
+            aViewWindow->SetSelectionMode( CellSelection );
+        }
       } else if (send == SelectPointButton) {
         myEditCurrentArgument = (QWidget*)SpinBox_X;
         SMESH::SetPointRepresentation(true);
-       if ( aViewWindow )
-         aViewWindow->SetSelectionMode( NodeSelection );
+        if ( aViewWindow )
+          aViewWindow->SetSelectionMode( NodeSelection );
       } else if (send == SelectVectorButton) {
         myEditCurrentArgument = (QWidget*)SpinBox_DX;
         SMESH::SetPointRepresentation(true);
-       if ( aViewWindow )
-         aViewWindow->SetSelectionMode( NodeSelection );
+        if ( aViewWindow )
+          aViewWindow->SetSelectionMode( NodeSelection );
       }
       break;
     }
@@ -879,8 +879,8 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh)
 bool SMESHGUI_RotationDlg::IsAxisOk()
 {
   return (SpinBox_DX->GetValue() != 0 ||
-         SpinBox_DY->GetValue() != 0 ||
-         SpinBox_DZ->GetValue() != 0);
+          SpinBox_DY->GetValue() != 0 ||
+          SpinBox_DZ->GetValue() != 0);
 }
 
 //=================================================================================
@@ -977,8 +977,8 @@ void SMESHGUI_RotationDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index ba08f55700c5b64fd6edd155bd4bc21d37f8d9c8..8eb024b8d243f1608ef96bf7364b332ad3c84c69 100644 (file)
@@ -360,7 +360,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
       SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
       if ( !mesh->_is_nil() ) {*/
         _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
-       //FindSObject( mesh );
+        //FindSObject( mesh );
         if ( so ) {
           CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
           if(!CORBA::is_nil(obj)){
@@ -428,7 +428,7 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const
     SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
     if ( actor && actor->hasIO() ) {
       if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
-       return QVariant( aViewWindow->isVisible( actor->getIO() ) );
+        return QVariant( aViewWindow->isVisible( actor->getIO() ) );
     }
   }
   return QVariant( false );
index 1cb2fc21363612b403fc894b370c47aac196fe55..30ca05205881e756b12c18ef9002f431ccba67d6 100644 (file)
@@ -423,9 +423,9 @@ void SMESHGUI_SelectionOp::selected( QStringList& names,
       SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
       if( _study )
       {
-       _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
-       if( obj )
-         names.append( obj->GetName().c_str() );
+        _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
+        if( obj )
+          names.append( obj->GetName().c_str() );
       }
     }
   }
index 34e5e11356d1291602300da203ee7c1b158ae553..083df7390bc8383c7f7a704ba451ad22c271cb21 100644 (file)
@@ -103,18 +103,18 @@ protected:
 
   //! Hilight object in VTK viewer
   void                          highlight( const Handle( SALOME_InteractiveObject )&,
-                                          const bool, const bool = true );
+                                           const bool, const bool = true );
                                
   //! Select some nodes or elements in VTK
   void                          addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
-                                                 const TColStd_MapOfInteger&, const bool );
+                                                  const TColStd_MapOfInteger&, const bool isModeShift);
 
   SVTK_ViewWindow*              viewWindow() const;
   SVTK_Selector*                selector() const;
 
   //! Get names, types and ids of selected objects
   virtual void                  selected( QStringList&, 
-                                         SMESHGUI_Dialog::TypesList&, QStringList& ) const;
+                                          SMESHGUI_Dialog::TypesList&, QStringList& ) const;
 
   //! Find type by id
   virtual int                   typeById( const QString&, const EntityType ) const;
index b42b97e50142e8771d2d425ec16c2eb73f637808..2a94befb89c3015f622dd3fc5c5c6c2556d4df60 100644 (file)
@@ -385,9 +385,9 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
       LineEdit5->setEnabled(false);
 
       if (!CheckBoxPolygons->isVisible())
-       CheckBoxPolygons->show();
+        CheckBoxPolygons->show();
       if (!CheckBoxPolyedrs->isVisible())
-       CheckBoxPolyedrs->show();
+        CheckBoxPolyedrs->show();
       
       myOk5 = true;
 
@@ -412,7 +412,7 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
       SMESH::SetPointRepresentation(false);
 
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(CellSelection);
+        aViewWindow->SetSelectionMode(CellSelection);
       break;
     }
   }
@@ -472,8 +472,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
                                               LineEdit4->text().toLong(),
                                               LineEdit5->text().toLong(),
                                               LineEdit6->text().toLong(),
-                                             toCreatePolygons,
-                                             toCreatePolyedrs);
+                                              toCreatePolygons,
+                                              toCreatePolyedrs);
       else if (aConstructorId == 1)
         anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
                                                      LineEdit2->text().toLong(),
@@ -486,8 +486,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
                                                LineEdit3->text().toLong(),
                                                LineEdit4->text().toLong(),
                                                LineEdit6->text().toLong(),
-                                              toCreatePolygons,
-                                              toCreatePolyedrs);
+                                               toCreatePolygons,
+                                               toCreatePolyedrs);
       else if (aConstructorId == 3) {
         QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
         QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
@@ -580,10 +580,10 @@ void SMESHGUI_SewingDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -632,15 +632,15 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
       SMESH::SetPointRepresentation(true);
 
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(NodeSelection);
+        aViewWindow->SetSelectionMode(NodeSelection);
 
       const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
       if (n) {
-       newIndices.Add(n->GetID());
-       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->highlight( myActor->getIO(), true, true );
-       
+        newIndices.Add(n->GetID());
+        mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->highlight( myActor->getIO(), true, true );
+        
         if      (send == LineEdit1)
           myOk1 = true;
         else if (send == LineEdit2)
@@ -658,7 +658,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
       SMESH::SetPointRepresentation(false);
 
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(CellSelection);
+        aViewWindow->SetSelectionMode(CellSelection);
 
       QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
 
@@ -667,8 +667,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
       for (int i = 0; i < aListId.count(); i++) {
         const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
         if (e) 
-         newIndices.Add(e->GetID());
-       
+          newIndices.Add(e->GetID());
+        
           if (!isEvenOneExists)
             isEvenOneExists = true;
       }
@@ -676,7 +676,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
 
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( myActor->getIO(), true, true );
+        aViewWindow->highlight( myActor->getIO(), true, true );
       
       if (isEvenOneExists) {
         if (send == LineEdit1)
index 82352334b7f4953197a3766ba5b70383b928f04e..aeae0ef7382d0655e2a2d746daea30e06bdb311d 100644 (file)
@@ -129,7 +129,7 @@ QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent)
   QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
   myElementId = new QLineEdit( aMainGrp );
   myElementId->setValidator( new SMESHGUI_IdValidator( theParent, 
-                                                      !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
+                                                       !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
 
   // shape name
   QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp );
@@ -250,36 +250,36 @@ void SMESHGUI_ShapeByMeshOp::SetMesh (SMESH::SMESH_Mesh_ptr thePtr)
       int shapeDim = 0; // max dim with several shapes
       //if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
       {
-       _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
-       GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
-       if ( !mainShape->_is_nil() ) 
-         {
-           TopoDS_Shape aShape;
-           if ( GEOMBase::GetShape(mainShape, aShape))
-             {
-               TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
-               for ( int dim = 4; dim > 0; --dim ) {
-                 TopAbs_ShapeEnum type = types[ dim - 1 ];
-                 TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
-                 TopExp_Explorer exp( aShape, type, avoid );
-                 for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
-                   ++nbShapes[ type ];
-                 if ( nbShapes[ type ] > 1 ) {
-                   shapeDim = dim;
-                   break;
-                 }
-               }
-             }
-         }
+        _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
+        GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
+        if ( !mainShape->_is_nil() ) 
+          {
+            TopoDS_Shape aShape;
+            if ( GEOMBase::GetShape(mainShape, aShape))
+              {
+                TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
+                for ( int dim = 4; dim > 0; --dim ) {
+                  TopAbs_ShapeEnum type = types[ dim - 1 ];
+                  TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
+                  TopExp_Explorer exp( aShape, type, avoid );
+                  for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
+                    ++nbShapes[ type ];
+                  if ( nbShapes[ type ] > 1 ) {
+                    shapeDim = dim;
+                    break;
+                  }
+                }
+              }
+          }
       }
       if (shapeDim > 0)
-       {
-         if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
-           shapeDim = 3;
-         hasElement[ EDGE ]   = shapeDim > 0 && myMesh->NbEdges();
-         hasElement[ FACE ]   = shapeDim > 1 && myMesh->NbFaces();
-         hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
-       }
+        {
+          if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
+            shapeDim = 3;
+          hasElement[ EDGE ]   = shapeDim > 0 && myMesh->NbEdges();
+          hasElement[ FACE ]   = shapeDim > 1 && myMesh->NbFaces();
+          hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
+        }
       myHasSolids = nbShapes[ TopAbs_SOLID ];
     }
 
@@ -306,83 +306,83 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
     QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts);
     if (aListId.count() == 1)
       {
-       int elemID = (aListId.first()).toInt();
-       myGeomObj = GEOM::GEOM_Object::_duplicate(
-           SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
-         ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
+        int elemID = (aListId.first()).toInt();
+        myGeomObj = GEOM::GEOM_Object::_duplicate(
+            SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
+          ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
       }
     else
       {
-       GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-       
-       if (geomGen->_is_nil() || !aStudy)
-         return;
-       
-       GEOM::GEOM_IShapesOperations_var aShapesOp =
-         geomGen->GetIShapesOperations(aStudy->StudyId());
-       if (aShapesOp->_is_nil() )
-         return;
-       
-       TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
-       
-       std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
-       GEOM::GEOM_Object_var aGeomObject;
-
-       GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
-       
-       for ( int i = 0; i < aListId.count(); i++ )
-         {
-           aGeomObject =
-             SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
-
-           if (aGeomObject->_is_nil()) continue;
-           
-           double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
-           if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
-             {
-               aGeomObjectsMap[anId] = aGeomObject;
-
-               TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
-               if (i == 0)
-                 aGroupType = aSubShapeType;
-               else if (aSubShapeType != aGroupType)
-                 aGroupType = TopAbs_SHAPE;
-             }
-         }
-       
-       int aNumberOfGO = aGeomObjectsMap.size();
-       if (aNumberOfGO == 1)
-         myGeomObj = (*aGeomObjectsMap.begin()).second;
-       else if (aNumberOfGO > 1)
-         {
-           GEOM::GEOM_IGroupOperations_var aGroupOp =
-             geomGen->GetIGroupOperations(aStudy->StudyId());
-           if(aGroupOp->_is_nil())
-             return;
-           
-           GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
-           aGeomObjects->length( aNumberOfGO );
-
-           int i = 0;
-           std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
-           for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
-             aGeomObjects[i++] = (*anIter).second;
-         
-           //create geometry group
-           myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
-           aGroupOp->UnionList(myGeomObj, aGeomObjects);
-
-           if (!aGroupOp->IsDone())
-             return;
-         }
-       
-       // publish the GEOM object in study
-       QString aNewGeomGroupName ( myDlg->myGeomName->text() );
-         
-       SALOMEDS::SObject_var aNewGroupSO =
-         geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj, 
-                             aNewGeomGroupName.toLatin1().data(), aMeshShape);
+        GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+        
+        if (geomGen->_is_nil() || !aStudy)
+          return;
+        
+        GEOM::GEOM_IShapesOperations_var aShapesOp =
+          geomGen->GetIShapesOperations(aStudy->StudyId());
+        if (aShapesOp->_is_nil() )
+          return;
+        
+        TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
+        
+        std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
+        GEOM::GEOM_Object_var aGeomObject;
+
+        GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
+        
+        for ( int i = 0; i < aListId.count(); i++ )
+          {
+            aGeomObject =
+              SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
+
+            if (aGeomObject->_is_nil()) continue;
+            
+            double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
+            if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
+              {
+                aGeomObjectsMap[anId] = aGeomObject;
+
+                TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
+                if (i == 0)
+                  aGroupType = aSubShapeType;
+                else if (aSubShapeType != aGroupType)
+                  aGroupType = TopAbs_SHAPE;
+              }
+          }
+        
+        int aNumberOfGO = aGeomObjectsMap.size();
+        if (aNumberOfGO == 1)
+          myGeomObj = (*aGeomObjectsMap.begin()).second;
+        else if (aNumberOfGO > 1)
+          {
+            GEOM::GEOM_IGroupOperations_var aGroupOp =
+              geomGen->GetIGroupOperations(aStudy->StudyId());
+            if(aGroupOp->_is_nil())
+              return;
+            
+            GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
+            aGeomObjects->length( aNumberOfGO );
+
+            int i = 0;
+            std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
+            for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
+              aGeomObjects[i++] = (*anIter).second;
+          
+            //create geometry group
+            myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
+            aGroupOp->UnionList(myGeomObj, aGeomObjects);
+
+            if (!aGroupOp->IsDone())
+              return;
+          }
+        
+        // publish the GEOM object in study
+        QString aNewGeomGroupName ( myDlg->myGeomName->text() );
+          
+        SALOMEDS::SObject_var aNewGroupSO =
+          geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj, 
+                              aNewGeomGroupName.toLatin1().data(), aMeshShape);
       }
   }
   catch (const SALOME::SALOME_Exception& S_ex) {
@@ -422,7 +422,7 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone()
                                                    aList.First(), aString);
     if (nbElems > 0) {
       if (!myIsMultipleAllowed && nbElems != 1 )
-       return;
+        return;
       setElementID( aString );
       myDlg->setButtonEnabled( true, QtxDialog::OK );
     }
@@ -485,31 +485,31 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText)
     {
       if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() )
       {
-       SMDSAbs_ElementType type = SMDSAbs_Edge;
-       switch ( myDlg->myElemTypeGroup->checkedId() ) {
-       case EDGE  : type = SMDSAbs_Edge;   break;
-       case FACE  : type = SMDSAbs_Face;   break;
-       case VOLUME: type = SMDSAbs_Volume; break;
-       default: return;
-       }
-       TColStd_MapOfInteger newIndices;
-       QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
-       for ( int i = 0; i < aListId.count(); i++ ) {
-         if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
-           if ( e->GetType() == type )
-             newIndices.Add( e->GetID() );
-       }
-       
-       if ( !newIndices.IsEmpty() )
-       {
-         if (!myIsMultipleAllowed && newIndices.Extent() != 1)
-           return;
-         if ( SVTK_Selector* s = selector() ) {
-           s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
-           viewWindow()->highlight( actor->getIO(), true, true );
-           myDlg->setButtonEnabled( true, QtxDialog::OK );
-         }
-       }
+        SMDSAbs_ElementType type = SMDSAbs_Edge;
+        switch ( myDlg->myElemTypeGroup->checkedId() ) {
+        case EDGE  : type = SMDSAbs_Edge;   break;
+        case FACE  : type = SMDSAbs_Face;   break;
+        case VOLUME: type = SMDSAbs_Volume; break;
+        default: return;
+        }
+        TColStd_MapOfInteger newIndices;
+        QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
+        for ( int i = 0; i < aListId.count(); i++ ) {
+          if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
+            if ( e->GetType() == type )
+              newIndices.Add( e->GetID() );
+        }
+        
+        if ( !newIndices.IsEmpty() )
+        {
+          if (!myIsMultipleAllowed && newIndices.Extent() != 1)
+            return;
+          if ( SVTK_Selector* s = selector() ) {
+            s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
+            viewWindow()->highlight( actor->getIO(), true, true );
+            myDlg->setButtonEnabled( true, QtxDialog::OK );
+          }
+        }
       }
     }
   }
index 6a27b17a337f9e4003e8abe4f74cc0847d8520e5..a99a2ae960200e60900be898299e3690fa380797 100755 (executable)
@@ -278,10 +278,10 @@ void SMESHGUI_SingleEditDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -348,13 +348,13 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
 
       int id1, id2;
       if ( !getNodeIds(myEdge->text(), id1, id2) )
-       return;
+        return;
 
       const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 );
       const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 );
 
       if ( !aNode1 || !aNode2 || aNode1 == aNode2 )
-       return;
+        return;
 
       // find a triangle and an edge index
       const SMDS_MeshElement* tria1;
@@ -362,23 +362,23 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
 
       if ( findTriangles(aNode1,aNode2,tria1,tria2) )
       {
-       newIndices.Add(tria1->GetID());
-
-       const SMDS_MeshNode* a3Nodes[3];
-       SMDS_ElemIteratorPtr it;
-       int edgeInd = 2, i;
-       for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
-         a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
-         if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
-                        a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
-           edgeInd = i - 1;
-           break;
-         }
-       }
-       newIndices.Add(-edgeInd-1);
-       
-       myOkBtn->setEnabled(true);
-       myApplyBtn->setEnabled(true);
+        newIndices.Add(tria1->GetID());
+
+        const SMDS_MeshNode* a3Nodes[3];
+        SMDS_ElemIteratorPtr it;
+        int edgeInd = 2, i;
+        for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
+          a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
+          if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
+                         a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
+            edgeInd = i - 1;
+            break;
+          }
+        }
+        newIndices.Add(-edgeInd-1);
+        
+        myOkBtn->setEnabled(true);
+        myApplyBtn->setEnabled(true);
       }
       mySelector->AddOrRemoveIndex(anIO,newIndices, false);
       SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
@@ -416,17 +416,17 @@ void SMESHGUI_SingleEditDlg::onSelectionDone()
     {
       const SMDS_MeshElement* tria[2];
       if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 &&
-         findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
+          findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
       {
-       QString aText = QString("%1-%2").arg(anId1).arg(anId2);
-       myEdge->setText(aText);
-       
-       myOkBtn->setEnabled(true);
-       myApplyBtn->setEnabled(true);
+        QString aText = QString("%1-%2").arg(anId1).arg(anId2);
+        myEdge->setText(aText);
+        
+        myOkBtn->setEnabled(true);
+        myApplyBtn->setEnabled(true);
       }
       else
       {
-       myEdge->clear();
+        myEdge->clear();
       }
     }
   }
@@ -494,8 +494,8 @@ bool SMESHGUI_SingleEditDlg::onApply()
 
   if (aMesh->_is_nil()) {
     SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI), 
-                                tr("SMESH_ERROR"),
-                                tr("SMESHG_NO_MESH"));
+                                 tr("SMESH_ERROR"),
+                                 tr("SMESHG_NO_MESH"));
     return false;
   }
 
index 9112c56d012fdbfdd23a3fd72a8a37155c171e71..1cab8d3f47eadf428db66ab14cf8efdbdde1370f 100644 (file)
@@ -365,22 +365,22 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
 
       if ( CheckBoxParametric->isChecked() ) {
         if(CheckBoxMesh->isChecked())
-         aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
-                                                       anIterationLimit, aMaxAspectRatio, aMethod);
-       else
-         aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
-                                                 anIterationLimit, aMaxAspectRatio, aMethod);
+          aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
+                                                        anIterationLimit, aMaxAspectRatio, aMethod);
+        else
+          aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
+                                                  anIterationLimit, aMaxAspectRatio, aMethod);
       }
       else {
         if(CheckBoxMesh->isChecked())
-         aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
-                                             anIterationLimit, aMaxAspectRatio, aMethod);
-       else
-         aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
-                                       anIterationLimit, aMaxAspectRatio, aMethod);
+          aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
+                                              anIterationLimit, aMaxAspectRatio, aMethod);
+        else
+          aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
+                                        anIterationLimit, aMaxAspectRatio, aMethod);
       }
 
-      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
 
     } catch (...) {
     }
@@ -448,10 +448,10 @@ void SMESHGUI_SmoothingDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -490,28 +490,28 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
       const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
       TColStd_MapOfInteger newIndices;
       for (int i = 0; i < aListId.count(); i++) {
-       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-       if (e)
-         newIndices.Add(e->GetID());
-       myNbOkElements++;
+        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+        if (e)
+          newIndices.Add(e->GetID());
+        myNbOkElements++;
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( anIO, true, true );
+        aViewWindow->highlight( anIO, true, true );
       myElementsId = theNewText;
 
     } else if (send == LineEditNodes) {
       TColStd_MapOfInteger newIndices;
       
       for (int i = 0; i < aListId.count(); i++) {
-       const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
-       if (n)
-         newIndices.Add(n->GetID());
-       myNbOkNodes++;
+        const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
+        if (n)
+          newIndices.Add(n->GetID());
+        myNbOkNodes++;
       }
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( myActor->getIO(), true, true );
+        aViewWindow->highlight( myActor->getIO(), true, true );
     }
   }
 
@@ -629,21 +629,21 @@ void SMESHGUI_SmoothingDlg::SetEditCurrentArgument()
         myEditCurrentArgument = LineEditElements;
         SMESH::SetPointRepresentation(false);
         if (CheckBoxMesh->isChecked()) {
-         //          mySelectionMgr->setSelectionModes(ActorSelection);
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(ActorSelection);
-         mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+          //          mySelectionMgr->setSelectionModes(ActorSelection);
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(ActorSelection);
+          mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
         } else {
-         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-           aViewWindow->SetSelectionMode(FaceSelection);
-       }
+          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+            aViewWindow->SetSelectionMode(FaceSelection);
+        }
       } else if (send == SelectNodesButton) {
-       LineEditNodes->clear();
+        LineEditNodes->clear();
         myEditCurrentArgument = LineEditNodes;
         SMESH::SetPointRepresentation(true);
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
-         aViewWindow->SetSelectionMode(NodeSelection);
-       }
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
+          aViewWindow->SetSelectionMode(NodeSelection);
+        }
       }
 
       myEditCurrentArgument->setFocus();
@@ -782,8 +782,8 @@ void SMESHGUI_SmoothingDlg::setFilters( const bool theIsElem )
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index 1b30cb08a33e0ede5f9b3e82e26a9a84c0bd187a..c617f5ec7cc182a1e2de911854c1e723a1c07ef5 100644 (file)
@@ -107,9 +107,9 @@ QDoubleValidator* SMESHGUI_SpinBox::validator() const
 // purpose  :
 //=================================================================================
 void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
-                                             double max,
-                                             double step,
-                                             unsigned short precision )
+                                              double max,
+                                              double step,
+                                              unsigned short precision )
 {
   setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
   //                               see QtxDoubleSpinBox::mapValueToText( double v )
index cdca31653eaf8b2cf4f5e24f3b6157ad878e5a98..aa757ee632c5bd0313cbb8538c1bd9b32b890745 100644 (file)
@@ -52,9 +52,9 @@ public:
   ~SMESHGUI_SpinBox();
 
   void       RangeStepAndValidator( double         = -1000000.0,
-                                   double         = +1000000.0,
-                                   double         = 100.0,
-                                   unsigned short = 3 );
+                                    double         = +1000000.0,
+                                    double         = 100.0,
+                                    unsigned short = 3 );
   void              SetValue( double );
   double            GetValue() const;
   QString           GetString() const;
index 4b7540fc06b2282b6dc7b19bc2523d79374fe9c8..d62b3a702438f2cc792f16608115d83f3dc484ca 100644 (file)
@@ -203,20 +203,20 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       int aDimension = 0;
       double aNbDimElements = 0;
       if (aNbVolumes > 0) {
-       aNbDimElements = aNbVolumes;
-       aDimension = 3;
+        aNbDimElements = aNbVolumes;
+        aDimension = 3;
       }
       else if(aNbFaces > 0) {
-       aNbDimElements = aNbFaces;
-       aDimension = 2;
+        aNbDimElements = aNbFaces;
+        aDimension = 2;
       }
       else if(aNbEdges > 0) {
-       aNbDimElements = aNbEdges;
-       aDimension = 1;
+        aNbDimElements = aNbEdges;
+        aDimension = 1;
       }
       else if(aNbNodes > 0) {
-       aNbDimElements = aNbNodes;
-       aDimension = 0;
+        aNbDimElements = aNbNodes;
+        aDimension = 0;
       }
 
       // information about the mesh
@@ -234,15 +234,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
       if (anObj) {
         _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
-       if (it->More()) {
+        if (it->More()) {
           anInfo.append(QString("Groups:<br><br>"));
           hasGroup = true;
         }
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on nodes"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -259,7 +259,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       // info about groups on edges
@@ -271,11 +271,11 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
           anInfo.append(QString("Groups:<br><br>"));
           hasGroup = true;
         }
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on edges"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -292,7 +292,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       // info about groups on faces
@@ -300,15 +300,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
       if (anObj) {
         _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
-       if (!hasGroup && it->More()) {
+        if (!hasGroup && it->More()) {
           anInfo.append(QString("Groups:<br><br>"));
           hasGroup = true;
         }
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on faces"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -325,7 +325,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       // info about groups on volumes
@@ -333,13 +333,13 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
       if (anObj) {
         _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
-       if (!hasGroup && it->More())
+        if (!hasGroup && it->More())
           anInfo.append(QString("Groups:<br>"));
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on volumes"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -356,7 +356,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       myInfo->setText(anInfo);
@@ -448,10 +448,10 @@ void SMESHGUI_StandardMeshInfosDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
index a7c0cbaae36ff4bca4a38d375938ba03db75e333..5da44a6ae52bda7c6aa7df29ebe04302d4e5f454 100644 (file)
@@ -416,8 +416,8 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
     SMESH::SetPointRepresentation(false);
     if (!CheckBoxMesh->isChecked())
       {
-       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-         aViewWindow->SetSelectionMode(CellSelection);
+        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+          aViewWindow->SetSelectionMode(CellSelection);
       }
   }
 
@@ -499,8 +499,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
         else
           aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
         
-       if( !myMesh->_is_nil())
-         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !myMesh->_is_nil())
+          myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
       }
       case COPY_ELEMS_BUTTON: {
@@ -517,8 +517,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
           else
             aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
         }
-       if( !myMesh->_is_nil())
-         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !myMesh->_is_nil())
+          myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
         }
       case MAKE_MESH_BUTTON: {
@@ -529,8 +529,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
         else
           mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
                                              LineEditNewMesh->text().toLatin1().data());
-       if( !mesh->_is_nil())
-         mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !mesh->_is_nil())
+          mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
       }
       }
@@ -595,10 +595,10 @@ void SMESHGUI_SymmetryDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -633,15 +633,15 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText)
 
     if (send == LineEditElements) {
       for (int i = 0; i < aListId.count(); i++) {
-       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-       if (e)
-         newIndices.Add(e->GetID());
-       myNbOkElements++;
+        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+        if (e)
+          newIndices.Add(e->GetID());
+        myNbOkElements++;
       }
 
       mySelector->AddOrRemoveIndex( anIO, newIndices, false );
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->highlight( anIO, true, true );
+        aViewWindow->highlight( anIO, true, true );
       
       myElementsId = theNewText;
     }
@@ -832,11 +832,11 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument()
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(ActorSelection);
+        aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode(CellSelection);
+        aViewWindow->SetSelectionMode(CellSelection);
     }
   } else if (send == SelectPointButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_X;
@@ -1076,8 +1076,8 @@ void SMESHGUI_SymmetryDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index 757c34b8f3489947753c20542a9911a7f0c0db98..97d5ca5822b6108b98d2499b17880c2269a636cb 100644 (file)
@@ -417,7 +417,7 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
     SMESH::SetPointRepresentation(false);
     if (!CheckBoxMesh->isChecked())
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode( CellSelection );
+        aViewWindow->SetSelectionMode( CellSelection );
   }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
@@ -487,8 +487,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
           aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
         else
           aMeshEditor->Translate(anElementsId, aVector, false);
-       if( !myMesh->_is_nil())
-         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !myMesh->_is_nil())
+          myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
       case COPY_ELEMS_BUTTON:
         if ( makeGroups ) {
@@ -504,8 +504,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
           else
             aMeshEditor->Translate(anElementsId, aVector, true);
         }
-       if( !myMesh->_is_nil())
-         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !myMesh->_is_nil())
+          myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
         break;
       case MAKE_MESH_BUTTON:
         SMESH::SMESH_Mesh_var mesh; 
@@ -515,8 +515,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
         else
           mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
                                                 LineEditNewMesh->text().toLatin1().data());
-       if( !mesh->_is_nil())
-         mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        if( !mesh->_is_nil())
+          mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
       }
     } catch (...) {
     }
@@ -580,10 +580,10 @@ void SMESHGUI_TranslationDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }
 
@@ -618,10 +618,10 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
 
     if (send == LineEditElements) {
       for (int i = 0; i < aListId.count(); i++) {
-       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-       if (e)
-         newIndices.Add(e->GetID());
-       myNbOkElements++;
+        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+        if (e)
+          newIndices.Add(e->GetID());
+        myNbOkElements++;
       }
     }
 
@@ -809,12 +809,12 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument()
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode( ActorSelection );
+        aViewWindow->SetSelectionMode( ActorSelection );
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
 
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode( CellSelection );
+        aViewWindow->SetSelectionMode( CellSelection );
     }
   } else if (send == SelectButton1) {
     myEditCurrentArgument = (QWidget*)SpinBox1_1;
@@ -1024,8 +1024,8 @@ void SMESHGUI_TranslationDlg::setFilters()
 {
   if(myMesh->_is_nil()) {
     SUIT_MessageBox::critical(this,
-                             tr("SMESH_ERROR"),
-                             tr("NO_MESH_SELECTED"));
+                              tr("SMESH_ERROR"),
+                              tr("NO_MESH_SELECTED"));
    return;
   }
   if ( !myFilterDlg )
index b979ddffc6bfa7b148d148a02d310c299d39ba39..28f5af456485effd84a86eaf81867d4c335e72b4 100644 (file)
@@ -172,7 +172,7 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp()
   LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
   if ( app )
     app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : 
-                             QString( "" ), myHelpFileName );
+                              QString( "" ), myHelpFileName );
   else {
     QString platform;
 #ifdef WIN32
@@ -181,10 +181,10 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
-                             tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
-                             arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
-                                                                   platform ) ).
-                             arg( myHelpFileName ) );
+                              tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+                              arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
+                                                                    platform ) ).
+                              arg( myHelpFileName ) );
   }
 }
 
@@ -207,7 +207,7 @@ void SMESHGUI_TransparencyDlg::SetTransparency()
       Handle(SALOME_InteractiveObject) IOS = It.Value();
       SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() );
       if ( anActor )
-       anActor->SetOpacity( opacity );
+        anActor->SetOpacity( opacity );
     }
     myViewWindow->Repaint();
   }
@@ -238,31 +238,31 @@ void SMESHGUI_TransparencyDlg::onSelectionChanged()
     if ( aList.Extent() == 1 ) {
       Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
       if ( !FirstIOS.IsNull() ) {
-       SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
-       if ( anActor )
-         opacity = int( anActor->GetOpacity() * 100. + 0.5 );
+        SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
+        if ( anActor )
+          opacity = int( anActor->GetOpacity() * 100. + 0.5 );
       }
     } 
     else if ( aList.Extent() > 1 ) {
       SALOME_ListIteratorOfListIO It( aList );
       int setOp = -1;
       for ( ; It.More(); It.Next() ) {
-       Handle(SALOME_InteractiveObject) IO = It.Value();
-       if ( !IO.IsNull() ) {
-         SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
-         if ( anActor ) {
-           int op = int( anActor->GetOpacity() * 100. + 0.5 );
-           if ( setOp < 0 )
-             setOp = op;
-           else if ( setOp != op ) {
-             setOp = 100;
-             break;
-           }
-         }
-       }
+        Handle(SALOME_InteractiveObject) IO = It.Value();
+        if ( !IO.IsNull() ) {
+          SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
+          if ( anActor ) {
+            int op = int( anActor->GetOpacity() * 100. + 0.5 );
+            if ( setOp < 0 )
+              setOp = op;
+            else if ( setOp != op ) {
+              setOp = 100;
+              break;
+            }
+          }
+        }
       }
       if ( setOp >= 0 )
-       opacity = setOp;
+        opacity = setOp;
     } 
     else {
     }
index 33eb25b96c62066fe11c62e2a03275aaf32b1935..7c6b279c4694850b2820b734fd1dfb176e21c900 100644 (file)
@@ -80,11 +80,11 @@ namespace SMESH
     if(theOwner){
       const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
       if(!anIO.IsNull()){
-       if(anIO->hasEntry()){
-         _PTR(Study) aStudy = GetActiveStudyDocument();
-         _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
-         anObj = SObjectToObject(aSObj,aStudy);
-       }
+        if(anIO->hasEntry()){
+          _PTR(Study) aStudy = GetActiveStudyDocument();
+          _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
+          anObj = SObjectToObject(aSObj,aStudy);
+        }
       }
     }
     return anObj;
@@ -124,9 +124,9 @@ namespace SMESH
       (SUIT_Session::session()->activeApplication());
     if (app && !CORBA::is_nil(theObject)) {
       if(_PTR(Study) aStudy = GetActiveStudyDocument()){
-       CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
-       if (strcmp(anIOR.in(), "") != 0)
-         return aStudy->FindObjectIOR(anIOR.in());
+        CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
+        if (strcmp(anIOR.in(), "") != 0)
+          return aStudy->FindObjectIOR(anIOR.in());
       }
     }
     return _PTR(SObject)();
@@ -187,9 +187,9 @@ namespace SMESH
     if (theSObject) {
       _PTR(GenericAttribute) anAttr;
       if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
-       _PTR(AttributeIOR) anIOR = anAttr;
-       CORBA::String_var aVal = anIOR->Value().c_str();
-       return app->orb()->string_to_object(aVal);
+        _PTR(AttributeIOR) anIOR = anAttr;
+        CORBA::String_var aVal = anIOR->Value().c_str();
+        return app->orb()->string_to_object(aVal);
       }
     }
     return CORBA::Object::_nil();
@@ -205,9 +205,9 @@ namespace SMESH
   {
     if (!theIO.IsNull()) {
       if (theIO->hasEntry()) {
-       _PTR(Study) aStudy = GetActiveStudyDocument();
-       _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
-       return SObjectToObject(anObj,aStudy);
+        _PTR(Study) aStudy = GetActiveStudyDocument();
+        _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
+        return SObjectToObject(anObj,aStudy);
       }
     }
     return CORBA::Object::_nil();
@@ -273,11 +273,11 @@ namespace SMESH
     for (int i = 1; anIter->More(); anIter->Next(), i++) {
       _PTR(SObject) aSObj = anIter->Value();
       if (i >= 4) {
-       _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
-       for ( ; anIter1->More(); anIter1->Next()) {
-         _PTR(SObject) aSObj1 = anIter1->Value();
-         anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
-         aPixmap = anAttr;
+        _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
+        for ( ; anIter1->More(); anIter1->Next()) {
+          _PTR(SObject) aSObj1 = anIter1->Value();
+          anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
+          aPixmap = anAttr;
           if (theIsNotModif) {
             aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
           } else if ( isEmptyMesh ) {
@@ -285,7 +285,7 @@ namespace SMESH
           } else {
             aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_PARTIAL");
           }
-       }
+        }
       }
     }
   }
@@ -300,10 +300,10 @@ namespace SMESH
     }
     else {
       SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
-                              QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                              arg(app->resourceMgr()->stringValue("ExternalBrowser", 
-                                                                  "application")).
-                              arg(theHelpFileName));
+                               QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                               arg(app->resourceMgr()->stringValue("ExternalBrowser", 
+                                                                   "application")).
+                               arg(theHelpFileName));
     }
   }
 
index 77f26e3e139f2de44aa58bb97e7f07914bb8bd41..2604ca57fbcdefe7a11c7074b1c6d533d5d1e7e4 100644 (file)
@@ -88,7 +88,7 @@ SMESHGUI_EXPORT
     {
       CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
       if(!CORBA::is_nil(anObj))
-       return TInterface::_narrow(anObj);
+        return TInterface::_narrow(anObj);
       return TInterface::_nil();
     }
 
@@ -114,7 +114,7 @@ SMESHGUI_EXPORT
 
 SMESHGUI_EXPORT
   CORBA::Object_var SObjectToObject( _PTR(SObject),
-                                    _PTR(Study) );
+                                     _PTR(Study) );
 
 SMESHGUI_EXPORT
   CORBA::Object_var SObjectToObject( _PTR(SObject) );
@@ -124,7 +124,7 @@ SMESHGUI_EXPORT
     {
       CORBA::Object_var anObj = SObjectToObject(theSObject);
       if(!CORBA::is_nil(anObj))
-       return TInterface::_narrow(anObj);
+        return TInterface::_narrow(anObj);
       return TInterface::_nil();
     }
 
@@ -136,7 +136,7 @@ SMESHGUI_EXPORT
     {
       CORBA::Object_var anObj = IObjectToObject(theIO);
       if(!CORBA::is_nil(anObj))
-       return TInterface::_narrow(anObj);
+        return TInterface::_narrow(anObj);
       return TInterface::_nil();
     }
 
@@ -148,7 +148,7 @@ SMESHGUI_EXPORT
     {
       CORBA::Object_var anObj = IORToObject( theIOR );
       if ( !CORBA::is_nil( anObj ) )
-       return TInterface::_narrow( anObj );
+        return TInterface::_narrow( anObj );
       return TInterface::_nil();
     }
 
index 3d2840b9b277cdcead7a76649e7e4918a822d4fc..7b5db14302a6bd7396bc691fef9f24c77bc8295c 100644 (file)
@@ -145,7 +145,7 @@ namespace SMESH
         for ( int iV = 0; iV < views.count(); ++iV ) {
           if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
             vtkRenderer *aRenderer = vtkWnd->getRenderer();
-           VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+            VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
             vtkActorCollection *actors = aCopy.GetActors();
             for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
               // size of actors changes inside the loop
@@ -188,7 +188,7 @@ namespace SMESH
         for ( int iV = 0; iV < views.count(); ++iV ) {
           if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
             vtkRenderer *aRenderer = vtkWnd->getRenderer();
-           VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+            VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
             vtkActorCollection *actors = aCopy.GetActors();
             for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
               // size of actors changes inside the loop
@@ -231,18 +231,18 @@ namespace SMESH
 //       char* buf = new char[100*1024];
 //       delete [] buf;
       SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
-                              QObject::tr("SMESH_VISU_PROBLEM"));
+                               QObject::tr("SMESH_VISU_PROBLEM"));
     } catch (...) {
       // no more memory at all: last resort
       MESSAGE_BEGIN ( "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<
-                     std::endl << "Try to remove all visual data..." );
+                      std::endl << "Try to remove all visual data..." );
       if (theVISU_MemoryReserve) {
         delete theVISU_MemoryReserve;
         theVISU_MemoryReserve = 0;
       }
       RemoveAllObjectsWithActors();
       SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
-                              QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
+                               QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
       MESSAGE_END ( "...done" );
     }
   }
@@ -261,59 +261,59 @@ namespace SMESH
 #endif
       TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
       if(anIter != VISUAL_OBJ_CONT.end()){
-       aVisualObj = anIter->second;
+        aVisualObj = anIter->second;
       }else{
         SalomeApp_Application* app =
           dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
-       _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
-       _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
-       if(aSObj){
-         _PTR(GenericAttribute) anAttr;
-         if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
-           _PTR(AttributeIOR) anIOR = anAttr;
-           CORBA::String_var aVal = anIOR->Value().c_str();
-           CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
-           if(!CORBA::is_nil(anObj)){
-             //Try narrow to SMESH_Mesh interface
-             SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
-             if(!aMesh->_is_nil()){
-               aVisualObj.reset(new SMESH_MeshObj(aMesh));
-               TVisualObjCont::value_type aValue(aKey,aVisualObj);
-               VISUAL_OBJ_CONT.insert(aValue);
-             }
-             //Try narrow to SMESH_Group interface
-             SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
-             if(!aGroup->_is_nil()){
-               _PTR(SObject) aFatherSObj = aSObj->GetFather();
-               if(!aFatherSObj) return aVisualObj;
-               aFatherSObj = aFatherSObj->GetFather();
-               if(!aFatherSObj) return aVisualObj;
-               CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
-               TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
-               if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
-                 aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
-                 TVisualObjCont::value_type aValue(aKey,aVisualObj);
-                 VISUAL_OBJ_CONT.insert(aValue);
-               }
-             }
-             //Try narrow to SMESH_subMesh interface
-             SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
-             if(!aSubMesh->_is_nil()){
-               _PTR(SObject) aFatherSObj = aSObj->GetFather();
-               if(!aFatherSObj) return aVisualObj;
-               aFatherSObj = aFatherSObj->GetFather();
-               if(!aFatherSObj) return aVisualObj;
-               CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
-               TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
-               if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
-                 aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
-                 TVisualObjCont::value_type aValue(aKey,aVisualObj);
-                 VISUAL_OBJ_CONT.insert(aValue);
-               }
-             }
-           }
-         }
-       }
+        _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
+        _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
+        if(aSObj){
+          _PTR(GenericAttribute) anAttr;
+          if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
+            _PTR(AttributeIOR) anIOR = anAttr;
+            CORBA::String_var aVal = anIOR->Value().c_str();
+            CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
+            if(!CORBA::is_nil(anObj)){
+              //Try narrow to SMESH_Mesh interface
+              SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
+              if(!aMesh->_is_nil()){
+                aVisualObj.reset(new SMESH_MeshObj(aMesh));
+                TVisualObjCont::value_type aValue(aKey,aVisualObj);
+                VISUAL_OBJ_CONT.insert(aValue);
+              }
+              //Try narrow to SMESH_Group interface
+              SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
+              if(!aGroup->_is_nil()){
+                _PTR(SObject) aFatherSObj = aSObj->GetFather();
+                if(!aFatherSObj) return aVisualObj;
+                aFatherSObj = aFatherSObj->GetFather();
+                if(!aFatherSObj) return aVisualObj;
+                CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
+                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+                if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
+                  aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
+                  TVisualObjCont::value_type aValue(aKey,aVisualObj);
+                  VISUAL_OBJ_CONT.insert(aValue);
+                }
+              }
+              //Try narrow to SMESH_subMesh interface
+              SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
+              if(!aSubMesh->_is_nil()){
+                _PTR(SObject) aFatherSObj = aSObj->GetFather();
+                if(!aFatherSObj) return aVisualObj;
+                aFatherSObj = aFatherSObj->GetFather();
+                if(!aFatherSObj) return aVisualObj;
+                CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
+                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+                if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
+                  aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
+                  TVisualObjCont::value_type aValue(aKey,aVisualObj);
+                  VISUAL_OBJ_CONT.insert(aValue);
+                }
+              }
+            }
+          }
+        }
       }
     }catch(...){
       INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!");
@@ -354,7 +354,7 @@ namespace SMESH
         if ( usedMB * 10 > freeMB )
           // even dont try to show
           SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
-                                  QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
+                                   QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
         else
           // there is a chance to succeed
           continu = SUIT_MessageBox::warning
@@ -362,7 +362,7 @@ namespace SMESH
              QObject::tr("SMESH_WRN_WARNING"),
              QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"),
              SUIT_MessageBox::Yes | SUIT_MessageBox::No, 
-            SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
+             SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
         if ( !continu ) {
           // remove the corresponding actors from all views
           RemoveVisualObjectWithActors( theEntry );
@@ -391,7 +391,7 @@ namespace SMESH
 
     if (anApp) {
       if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow()))
-       return aView;
+        return aView;
 
       SUIT_ViewManager* aViewManager =
         anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound);
@@ -516,7 +516,7 @@ namespace SMESH
 
 
   SMESH_Actor* FindActorByEntry(SUIT_ViewWindow *theWindow,
-                               const char* theEntry)
+                                const char* theEntry)
   {
     if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
       vtkRenderer *aRenderer = aViewWindow->getRenderer();
@@ -524,14 +524,14 @@ namespace SMESH
       vtkActorCollection *aCollection = aCopy.GetActors();
       aCollection->InitTraversal();
       while(vtkActor *anAct = aCollection->GetNextActor()){
-       if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
-         if(anActor->hasIO()){
-           Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
-           if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
-             return anActor;
-           }
-         }
-       }
+        if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+          if(anActor->hasIO()){
+            Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
+            if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
+              return anActor;
+            }
+          }
+        }
       }
     }
     return NULL;
@@ -553,8 +553,8 @@ namespace SMESH
       CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
       _PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
       if(aSObject){
-       CORBA::String_var anEntry = aSObject->GetID().c_str();
-       return FindActorByEntry(anEntry.in());
+        CORBA::String_var anEntry = aSObject->GetID().c_str();
+        return FindActorByEntry(anEntry.in());
       }
     }
     return NULL;
@@ -562,41 +562,41 @@ namespace SMESH
 
 
   SMESH_Actor* CreateActor(_PTR(Study) theStudy,
-                          const char* theEntry,
-                          int theIsClear)
+                           const char* theEntry,
+                           int theIsClear)
   {
     SMESH_Actor *anActor = NULL;
     CORBA::Long anId = theStudy->StudyId();
     if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
       _PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
       if(aSObj){
-       _PTR(GenericAttribute) anAttr;
-       if(aSObj->FindAttribute(anAttr,"AttributeName")){
-         _PTR(AttributeName) aName = anAttr;
-         std::string aNameVal = aName->Value();
-         anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
-       }
-
-       SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
-       if(!CORBA::is_nil(aGroup))
-       {
-         SALOMEDS::Color aColor = aGroup->GetColor();
-         if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
-         {
-           int r = 0, g = 0, b = 0;
-           SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
-           aColor.R = (float)r / 255.0;
-           aColor.G = (float)g / 255.0;
-           aColor.B = (float)b / 255.0;
-           aGroup->SetColor( aColor );
-         }
-         if( aGroup->GetType() == SMESH::NODE )
-           anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
-         else if( aGroup->GetType() == SMESH::EDGE )
-           anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
-         else
-           anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
-       }
+        _PTR(GenericAttribute) anAttr;
+        if(aSObj->FindAttribute(anAttr,"AttributeName")){
+          _PTR(AttributeName) aName = anAttr;
+          std::string aNameVal = aName->Value();
+          anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
+        }
+
+        SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
+        if(!CORBA::is_nil(aGroup))
+        {
+          SALOMEDS::Color aColor = aGroup->GetColor();
+          if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
+          {
+            int r = 0, g = 0, b = 0;
+            SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
+            aColor.R = (float)r / 255.0;
+            aColor.G = (float)g / 255.0;
+            aColor.B = (float)b / 255.0;
+            aGroup->SetColor( aColor );
+          }
+          if( aGroup->GetType() == SMESH::NODE )
+            anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
+          else if( aGroup->GetType() == SMESH::EDGE )
+            anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+          else
+            anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+        }
       }
     }
     return anActor;
@@ -626,14 +626,14 @@ namespace SMESH
     if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){
       vtkWnd->RemoveActor(theActor);
       if(theActor->hasIO()){
-       Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
-       if(anIO->hasEntry()){
-         std::string anEntry = anIO->getEntry();
-         SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
-         int aStudyId = aStudy->id();
-         TVisualObjCont::key_type aKey(aStudyId,anEntry);
-         VISUAL_OBJ_CONT.erase(aKey);
-       }
+        Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+        if(anIO->hasEntry()){
+          std::string anEntry = anIO->getEntry();
+          SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
+          int aStudyId = aStudy->id();
+          TVisualObjCont::key_type aKey(aStudyId,anEntry);
+          VISUAL_OBJ_CONT.erase(aKey);
+        }
       }
       theActor->Delete();
       vtkWnd->Repaint();
@@ -654,7 +654,7 @@ namespace SMESH
       vtkActorCollection *aCollection = aCopy.GetActors();
       aCollection->InitTraversal();
       while(vtkActor *anAct = aCollection->GetNextActor())
-       if(dynamic_cast<SMESH_Actor*>(anAct))
+        if(dynamic_cast<SMESH_Actor*>(anAct))
           return false;
     }
     return true;
@@ -676,43 +676,44 @@ namespace SMESH
 
       switch (theAction) {
       case eDisplayAll: {
-       while (vtkActor *anAct = aCollection->GetNextActor()) {
-         if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
-           anActor->SetVisibility(true);
-         }
-       }
-       break;
+        while (vtkActor *anAct = aCollection->GetNextActor()) {
+          if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
+            anActor->SetVisibility(true);
+          }
+        }
+        break;
       }
       case eDisplayOnly:
       case eEraseAll: {
-       while (vtkActor *anAct = aCollection->GetNextActor()) {
-         if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
-           anActor->SetVisibility(false);
-         }
-       }
+        while (vtkActor *anAct = aCollection->GetNextActor()) {
+          if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
+            anActor->SetVisibility(false);
+          }
+        }
       }
       default: {
-       if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
-         switch (theAction) {
-           case eDisplay:
-           case eDisplayOnly:
-             anActor->SetVisibility(true);
-             if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
-             break;
-           case eErase:
-             anActor->SetVisibility(false);
-             break;
-         }
-       } else {
-         switch (theAction) {
-         case eDisplay:
-         case eDisplayOnly:
+        if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
+          switch (theAction) {
+            case eDisplay:
+            case eDisplayOnly:
+              anActor->SetVisibility(true);
+              if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
+              break;
+            case eErase:
+              anActor->SetVisibility(false);
+              break;
+          }
+        } else {
+          switch (theAction) {
+          case eDisplay:
+          case eDisplayOnly:
             {
               SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
               _PTR(Study) aDocument = aStudy->studyDS();
               // Pass non-visual objects (hypotheses, etc.), return true in this case
               CORBA::Long anId = aDocument->StudyId();
-              if (TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry))
+              TVisualObjPtr aVisualObj;
+              if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
               {
                 if ((anActor = CreateActor(aDocument,theEntry,true))) {
                   bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
@@ -725,8 +726,8 @@ namespace SMESH
               }
               break;
             }
-         }
-       }
+          }
+        }
       }
       }
     }
@@ -747,24 +748,24 @@ namespace SMESH
       SALOME_ListIO selected; mgr->selectedObjects( selected );
 
       if( selected.Extent() == 0){
-       vtkRenderer* aRenderer = aWnd->getRenderer();
-       VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
-       vtkActorCollection *aCollection = aCopy.GetActors();
-       aCollection->InitTraversal();
-       while(vtkActor *anAct = aCollection->GetNextActor()){
-         if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
-           if(anActor->hasIO())
-             if (!Update(anActor->getIO(),anActor->GetVisibility()))
+        vtkRenderer* aRenderer = aWnd->getRenderer();
+        VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+        vtkActorCollection *aCollection = aCopy.GetActors();
+        aCollection->InitTraversal();
+        while(vtkActor *anAct = aCollection->GetNextActor()){
+          if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+            if(anActor->hasIO())
+              if (!Update(anActor->getIO(),anActor->GetVisibility()))
                 break; // avoid multiple warinings if visu failed
-         }
-       }
+          }
+        }
       }else{
-       SALOME_ListIteratorOfListIO anIter( selected );
-       for( ; anIter.More(); anIter.Next()){
-         Handle(SALOME_InteractiveObject) anIO = anIter.Value();
-         if ( !Update(anIO,true) )
+        SALOME_ListIteratorOfListIO anIter( selected );
+        for( ; anIter.More(); anIter.Next()){
+          Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+          if ( !Update(anIO,true) )
             break; // avoid multiple warinings if visu failed
-       }
+        }
       }
       RepaintCurrentView();
     }
@@ -813,7 +814,7 @@ namespace SMESH
 
     QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
            aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
-          aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
+           aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
 
     int SW = mgr->integerValue( "SMESH", "selection_width", 5 ),
         PW = mgr->integerValue( "SMESH", "highlight_width", 5 );
@@ -829,39 +830,39 @@ namespace SMESH
 
     double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
            SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
-          SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
+           SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
 
     for ( int i=0, n=views.count(); i<n; i++ ){
       // update VTK viewer properties
       if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
-       // mesh element selection
-       aVtkView->SetSelectionProp(aSelColor.red()/255.,
-                                  aSelColor.green()/255.,
-                                  aSelColor.blue()/255.,
-                                  SW );
-       // tolerances
-       aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
-
-       // pre-selection
-       aVtkView->SetPreselectionProp(aPreColor.red()/255.,
-                                     aPreColor.green()/255.,
-                                     aPreColor.blue()/255.,
-                                     PW);
-       // update actors
-       vtkRenderer* aRenderer = aVtkView->getRenderer();
-       VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
-       vtkActorCollection *aCollection = aCopy.GetActors();
-       aCollection->InitTraversal();
-       while(vtkActor *anAct = aCollection->GetNextActor()){
-         if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
-           anActor->SetHighlightColor(aHiColor.red()/255.,
-                                      aHiColor.green()/255.,
-                                      aHiColor.blue()/255.);
-           anActor->SetPreHighlightColor(aPreColor.red()/255.,
-                                         aPreColor.green()/255.,
-                                         aPreColor.blue()/255.);
-         }
-       }
+        // mesh element selection
+        aVtkView->SetSelectionProp(aSelColor.red()/255.,
+                                   aSelColor.green()/255.,
+                                   aSelColor.blue()/255.,
+                                   SW );
+        // tolerances
+        aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
+
+        // pre-selection
+        aVtkView->SetPreselectionProp(aPreColor.red()/255.,
+                                      aPreColor.green()/255.,
+                                      aPreColor.blue()/255.,
+                                      PW);
+        // update actors
+        vtkRenderer* aRenderer = aVtkView->getRenderer();
+        VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+        vtkActorCollection *aCollection = aCopy.GetActors();
+        aCollection->InitTraversal();
+        while(vtkActor *anAct = aCollection->GetNextActor()){
+          if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+            anActor->SetHighlightColor(aHiColor.red()/255.,
+                                       aHiColor.green()/255.,
+                                       aHiColor.blue()/255.);
+            anActor->SetPreHighlightColor(aPreColor.red()/255.,
+                                          aPreColor.green()/255.,
+                                          aPreColor.blue()/255.);
+          }
+        }
       }
     }
   }
@@ -878,7 +879,7 @@ namespace SMESH
   }
 
   void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
-                SVTK_Selector* theSelector)
+                 SVTK_Selector* theSelector)
   {
     if (theSelector)
       theSelector->SetFilter(theFilter);
@@ -906,7 +907,7 @@ namespace SMESH
   }
 
   bool IsValid(SALOME_Actor* theActor, int theCellId,
-              SVTK_Selector* theSelector)
+               SVTK_Selector* theSelector)
   {
     return theSelector->IsValid(theActor,theCellId);
   }
@@ -920,11 +921,11 @@ namespace SMESH
       vtkActorCollection *aCollection = aCopy.GetActors();
       aCollection->InitTraversal();
       while(vtkActor *anAct = aCollection->GetNextActor()){
-       if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
-         if(anActor->GetVisibility()){
-           anActor->SetPointRepresentation(theIsVisible);
-         }
-       }
+        if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+          if(anActor->GetVisibility()){
+            anActor->SetPointRepresentation(theIsVisible);
+          }
+        }
       }
       RepaintCurrentView();
     }
@@ -939,14 +940,14 @@ namespace SMESH
       vtkActorCollection *aCollection = aCopy.GetActors();
       aCollection->InitTraversal();
       while(vtkActor *anAct = aCollection->GetNextActor()){
-       if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
-         if(anActor->GetVisibility()){
-           anActor->SetPickable(anIsAllPickable);
-         }
-       }
+        if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
+          if(anActor->GetVisibility()){
+            anActor->SetPickable(anIsAllPickable);
+          }
+        }
       }
       if(theActor)
-       theActor->SetPickable(!anIsAllPickable);
+        theActor->SetPickable(!anIsAllPickable);
       RepaintCurrentView();
     }
   }
@@ -954,8 +955,8 @@ namespace SMESH
 
   //----------------------------------------------------------------------------
   int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
-                            const Handle(SALOME_InteractiveObject)& theIO,
-                            QString& theName)
+                             const Handle(SALOME_InteractiveObject)& theIO,
+                             QString& theName)
   {
     theName = "";
     TColStd_IndexedMapOfInteger aMapIndex;
@@ -968,8 +969,8 @@ namespace SMESH
   }
 
   int GetNameOfSelectedElements(SVTK_Selector* theSelector,
-                               const Handle(SALOME_InteractiveObject)& theIO,
-                               QString& theName)
+                                const Handle(SALOME_InteractiveObject)& theIO,
+                                QString& theName)
   {
     theName = "";
     TColStd_IndexedMapOfInteger aMapIndex;
@@ -989,9 +990,9 @@ namespace SMESH
 
 
   int GetEdgeNodes(SVTK_Selector* theSelector,
-                  const TVisualObjPtr& theVisualObject,
-                  int& theId1,
-                  int& theId2)
+                   const TVisualObjPtr& theVisualObject,
+                   int& theId1,
+                   int& theId2)
   {
     const SALOME_ListIO& selected = theSelector->StoredIObjects();
 
@@ -1011,9 +1012,9 @@ namespace SMESH
     for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
       int aVal = aMapIndex( i );
       if ( aVal > 0 )
-       anObjId = aVal;
+        anObjId = aVal;
       else
-       anEdgeNum = abs( aVal ) - 1;
+        anEdgeNum = abs( aVal ) - 1;
     }
 
     if ( anObjId == -1 || anEdgeNum == -1 )
@@ -1024,18 +1025,18 @@ namespace SMESH
 
   //----------------------------------------------------------------------------
   int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
-                            const Handle(SALOME_InteractiveObject)& theIO,
-                            QString& theName)
+                             const Handle(SALOME_InteractiveObject)& theIO,
+                             QString& theName)
   {
     theName = "";
     if(theIO->hasEntry()){
       if(FindActorByEntry(theIO->getEntry())){
-       TColStd_IndexedMapOfInteger aMapIndex;
-       theMgr->GetIndexes(theIO,aMapIndex);
-       for(int i = 1; i <= aMapIndex.Extent(); i++){
-         theName += QString(" %1").arg(aMapIndex(i));
-       }
-       return aMapIndex.Extent();
+        TColStd_IndexedMapOfInteger aMapIndex;
+        theMgr->GetIndexes(theIO,aMapIndex);
+        for(int i = 1; i <= aMapIndex.Extent(); i++){
+          theName += QString(" %1").arg(aMapIndex(i));
+        }
+        return aMapIndex.Extent();
       }
     }
     return -1;
@@ -1053,23 +1054,23 @@ namespace SMESH
 
 
   int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
-                               const Handle(SALOME_InteractiveObject)& theIO,
-                               QString& theName)
+                                const Handle(SALOME_InteractiveObject)& theIO,
+                                QString& theName)
   {
     theName = "";
     if(theIO->hasEntry()){
       if(FindActorByEntry(theIO->getEntry())){
-       TColStd_IndexedMapOfInteger aMapIndex;
-       theMgr->GetIndexes(theIO,aMapIndex);
-       typedef std::set<int> TIdContainer;
-       TIdContainer anIdContainer;
-       for( int i = 1; i <= aMapIndex.Extent(); i++)
-         anIdContainer.insert(aMapIndex(i));
-       TIdContainer::const_iterator anIter = anIdContainer.begin();
-       for( ; anIter != anIdContainer.end(); anIter++){
-         theName += QString(" %1").arg(*anIter);
-       }
-       return aMapIndex.Extent();
+        TColStd_IndexedMapOfInteger aMapIndex;
+        theMgr->GetIndexes(theIO,aMapIndex);
+        typedef std::set<int> TIdContainer;
+        TIdContainer anIdContainer;
+        for( int i = 1; i <= aMapIndex.Extent(); i++)
+          anIdContainer.insert(aMapIndex(i));
+        TIdContainer::const_iterator anIter = anIdContainer.begin();
+        for( ; anIter != anIdContainer.end(); anIter++){
+          theName += QString(" %1").arg(*anIter);
+        }
+        return aMapIndex.Extent();
       }
     }
     return -1;
@@ -1089,8 +1090,8 @@ namespace SMESH
   }
 
   int GetSelected(LightApp_SelectionMgr*       theMgr,
-                 TColStd_IndexedMapOfInteger& theMap,
-                 const bool                   theIsElement)
+                  TColStd_IndexedMapOfInteger& theMap,
+                  const bool                   theIsElement)
   {
     theMap.Clear();
     SALOME_ListIO selected; theMgr->selectedObjects( selected );
@@ -1099,7 +1100,7 @@ namespace SMESH
     {
       Handle(SALOME_InteractiveObject) anIO = selected.First();
       if ( anIO->hasEntry() ) {
-       theMgr->GetIndexes( anIO, theMap );
+        theMgr->GetIndexes( anIO, theMap );
       }
     }
     return theMap.Extent();
@@ -1130,9 +1131,9 @@ namespace SMESH
     for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
       int aVal = aMapIndex( i );
       if ( aVal > 0 )
-       anObjId = aVal;
+        anObjId = aVal;
       else
-       anEdgeNum = abs( aVal );
+        anEdgeNum = abs( aVal );
     }
 
     if ( anObjId == -1 || anEdgeNum == -1 )
index 05d2e268bf1472e291b6a3ca7ce426f2f53a5b39..0d49a44375823a8678fe8bca2f6dac566f6b2278 100644 (file)
@@ -69,7 +69,7 @@ SMESHGUI_EXPORT
   //----------------------------------------------------------------------------
 SMESHGUI_EXPORT
   SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
-                                 bool = false );
+                                  bool = false );
 SMESHGUI_EXPORT
   SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
 SMESHGUI_EXPORT
@@ -112,7 +112,7 @@ SMESHGUI_EXPORT
 
 SMESHGUI_EXPORT
   bool UpdateView( SUIT_ViewWindow*, EDisplaing, const char* = "" );
-SMESHGUI_EXPORT                   
+SMESHGUI_EXPORT            
   bool UpdateView( EDisplaing, const char* = "" );
 
 SMESHGUI_EXPORT
@@ -153,31 +153,31 @@ SMESHGUI_EXPORT
   //----------------------------------------------------------------------------
 SMESHGUI_EXPORT  
   int GetNameOfSelectedNodes( SVTK_Selector*,
-                             const Handle(SALOME_InteractiveObject)&,
-                             QString& );
+                              const Handle(SALOME_InteractiveObject)&,
+                              QString& );
 SMESHGUI_EXPORT
   int GetNameOfSelectedElements( SVTK_Selector*,
-                                const Handle(SALOME_InteractiveObject)&,
-                                QString& );
+                                 const Handle(SALOME_InteractiveObject)&,
+                                 QString& );
 SMESHGUI_EXPORT
   int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
 
   //----------------------------------------------------------------------------
 SMESHGUI_EXPORT  
   int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
-                             const Handle(SALOME_InteractiveObject)&,
-                             QString& );
+                              const Handle(SALOME_InteractiveObject)&,
+                              QString& );
 SMESHGUI_EXPORT
   int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
 SMESHGUI_EXPORT
   int GetNameOfSelectedElements( LightApp_SelectionMgr*,
-                                const Handle(SALOME_InteractiveObject)&,
-                                QString& );
+                                 const Handle(SALOME_InteractiveObject)&,
+                                 QString& );
 SMESHGUI_EXPORT
   int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
 SMESHGUI_EXPORT
   int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&, 
-                  const bool = true );
+                   const bool = true );
 
 SMESHGUI_EXPORT
   int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
index 57830cefb54124404979c3b1f9041b76172b5ae3..f2913e836a122c6428307a46f3dcdc4aa1e92dbc 100755 (executable)
@@ -242,14 +242,14 @@ void SMESHGUI_WhatIsDlg::SelectionsClicked (int selectionId)
     {
       SMESH::SetPointRepresentation(true);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode( NodeSelection );
+        aViewWindow->SetSelectionMode( NodeSelection );
       break;
     }    
   case 1:
     {
       SMESH::SetPointRepresentation(false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-       aViewWindow->SetSelectionMode( CellSelection );
+        aViewWindow->SetSelectionMode( CellSelection );
       break;
     }
   }
@@ -299,10 +299,10 @@ void SMESHGUI_WhatIsDlg::ClickOnHelp()
     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
   else {
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                "application")).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 "application")).
+                             arg(myHelpFileName));
   }
 }
 
@@ -329,10 +329,10 @@ void SMESHGUI_WhatIsDlg::onTextChange (const QString& theNewText)
 
     for (int i = 0; i < aListId.count(); i++) {
       const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
-       aMesh->FindNode(aListId[ i ].toInt()):
-       aMesh->FindElement(aListId[ i ].toInt());
+        aMesh->FindNode(aListId[ i ].toInt()):
+        aMesh->FindElement(aListId[ i ].toInt());
       if (e)
-       newIndices.Add(e->GetID());
+        newIndices.Add(e->GetID());
     }
 
     mySelector->AddOrRemoveIndex( anIO, newIndices, false );
@@ -455,22 +455,22 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
       anInfo+=tr("SMESH_FACE")+"<br>";
       anInfo+="<b>" + tr("SMESH_MESHINFO_TYPE")+":</b> ";
       if(!ef->IsPoly())
-       anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
+        anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
       switch(ef->NbNodes()) {
       case 3:
       case 6:
-       {
-         anInfo+=tr("SMESH_TRIANGLE");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_TRIANGLE");
+          break;
+        }
       case 4:
       case 8:
-       {
-         anInfo+=tr("SMESH_QUADRANGLE");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_QUADRANGLE");
+          break;
+        }
       default:
-       break;
+        break;
       }
       anInfo+="<br>";
     } else if(e->GetType() == SMDSAbs_Volume) {
@@ -479,39 +479,39 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
       const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e;
       SMDS_VolumeTool vt(ev);
       if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA)
-       anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
+        anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
       switch(vt.GetVolumeType()) {
       case SMDS_VolumeTool::TETRA:
       case SMDS_VolumeTool::QUAD_TETRA:
-       {
-         anInfo+=tr("SMESH_TETRAS");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_TETRAS");
+          break;
+        }
       case SMDS_VolumeTool::PYRAM:
       case SMDS_VolumeTool::QUAD_PYRAM:
-       {
-         anInfo+=tr("SMESH_PYRAMID");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_PYRAMID");
+          break;
+        }
       case SMDS_VolumeTool::PENTA:
       case SMDS_VolumeTool::QUAD_PENTA:
-       {
-         anInfo+=tr("SMESH_PRISM");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_PRISM");
+          break;
+        }
       case SMDS_VolumeTool::HEXA:
       case SMDS_VolumeTool::QUAD_HEXA:
-       {
-         anInfo+=tr("SMESH_HEXAS");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_HEXAS");
+          break;
+        }
       case SMDS_VolumeTool::POLYHEDA:
-       {
-         anInfo+=tr("SMESH_POLYEDRON");
-         break;
-       }
+        {
+          anInfo+=tr("SMESH_POLYEDRON");
+          break;
+        }
       default:
-       break;
+        break;
       }
       anInfo+="<br>";
     }
@@ -523,17 +523,17 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
       const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
       anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
       if(e->GetType() != SMDSAbs_Node)
-       aNodesInfo+=QString("<b>Node %1:</b><br>Id=%2, X=%3, Y=%4, Z=%5<br>").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z());
+        aNodesInfo+=QString("<b>Node %1:</b><br>Id=%2, X=%3, Y=%4, Z=%5<br>").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z());
       // Calculate Connectivity
       SMDS_ElemIteratorPtr it = node->GetInverseElementIterator();
       if (it) {
-       aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
-       while (it->more()) {
-         const SMDS_MeshElement* elem = it->next();
-         aNodesInfo+=QString(" %1").arg(elem->GetID());
-       }
-       if ( (nbNodes+1) != e->NbNodes())
-         aNodesInfo+=QString("<br><br>");
+        aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
+        while (it->more()) {
+          const SMDS_MeshElement* elem = it->next();
+          aNodesInfo+=QString(" %1").arg(elem->GetID());
+        }
+        if ( (nbNodes+1) != e->NbNodes())
+          aNodesInfo+=QString("<br><br>");
       }
     }
     if(e->GetType() != SMDSAbs_Node)
index 4e1ea4eef25e2a5a12c82485d57d4a0401cd164f..16833ee66da96ed973f53da214d1370e81495473 100644 (file)
@@ -103,7 +103,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
       {
         MESSAGE("Loading Resources " << aResName.toLatin1().data());
         SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
-       QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
+        QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
         resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
         resMgr->loadTranslator( "resources", QString( "%1_images.qm" ).arg( aResName, lang ) );
       }
@@ -186,7 +186,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
       {
         QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos");
         aHypos = aHypos.remove( ' ' );
-       aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
+        aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
       }
     }
   }
index 09db4421922a37e5fc6bd8debaaecb310dc2f35f..3c38797e89082463a6e5d5ef06271fbf8424a78b 100644 (file)
@@ -45,7 +45,7 @@ public:
 
   bool     startDocument();
   bool     startElement( const QString&, const QString&, 
-                        const QString&, const QXmlAttributes& );
+                         const QString&, const QXmlAttributes& );
   bool     endElement( const QString&, const QString&, const QString& );
   bool     characters( const QString& ); 
 
index c2569ba1aa7a1cb4472ff961812bd1471fa05c7a..8b455dfe0e7bebb9f8ad896a519dc0ac1607b098 100644 (file)
             <source>ICON_UNDERLYING_ELEMS</source>
             <translation>mesh_extractGroup.png</translation>
         </message>
+        <message>
+            <source>ICON_2D_FROM_3D</source>
+            <translation>mesh_2d_from_3d.png</translation>
+        </message>
     </context>
 </TS>
index ab6fe272be1b5667831db0d566c04fdd413d75d8..959a476347d69df7f7a7a772c0e9992022152454 100644 (file)
             <source>MEN_CONV_TO_QUAD</source>
             <translation>Convert to/from quadratic</translation>
         </message>
+        <message>
+            <source>MEN_2D_FROM_3D</source>
+            <translation>Create 2D mesh from 3D</translation>
+        </message>
         <message>
             <source>MEN_CREATE_GROUP</source>
             <translation>Create Group</translation>
             <source>MEN_EXPORT_MED</source>
             <translation>Export to MED File</translation>
         </message>
+        <message>
+            <source>MEN_EXPORT_SAUV</source>
+            <translation>Export to SAUV (ASCII) file</translation>
+        </message>
         <message>
             <source>MEN_EXPORT_STL</source>
             <translation>Export to STL File</translation>
             <source>MEN_MED</source>
             <translation>MED file</translation>
         </message>
+        <message>
+            <source>MEN_SAUV</source>
+            <translation>SAUV (ASCII) file</translation>
+        </message>
         <message>
             <source>MEN_MERGE</source>
             <translation>Merge Nodes</translation>
@@ -2043,6 +2055,10 @@ Consider saving your work before application crash</translation>
             <source>STB_CONV_TO_QUAD</source>
             <translation>Convert to/from quadratic</translation>
         </message>
+        <message>
+            <source>STB_2D_FROM_3D</source>
+            <translation>Create 2D mesh from 3D</translation>
+        </message>
         <message>
             <source>STB_CREATE_GROUP</source>
             <translation>Create Group</translation>
@@ -2135,6 +2151,10 @@ Consider saving your work before application crash</translation>
             <source>STB_EXPORT_MED</source>
             <translation>Export to MED file</translation>
         </message>
+        <message>
+            <source>STB_EXPORT_SAUV</source>
+            <translation>Export to SAUV (ASCII) file</translation>
+        </message>
         <message>
             <source>STB_EXPORT_STL</source>
             <translation>Export to STL file</translation>
@@ -2209,6 +2229,10 @@ Consider saving your work before application crash</translation>
             <source>STB_MED</source>
             <translation>Import MED file</translation>
         </message>
+        <message>
+            <source>STB_SAUV</source>
+            <translation>Import SAUV (ASCII) file</translation>
+        </message>
         <message>
             <source>STB_MERGE</source>
             <translation>Merge nodes</translation>
@@ -2537,6 +2561,10 @@ Consider saving your work before application crash</translation>
             <source>TOP_CONV_TO_QUAD</source>
             <translation>Convert to/from quadratic</translation>
         </message>
+        <message>
+            <source>TOP_2D_FROM_3D</source>
+            <translation>Create 2D mesh from 3D</translation>
+        </message>
         <message>
             <source>TOP_CREATE_GROUP</source>
             <translation>Create Group</translation>
@@ -2629,6 +2657,10 @@ Consider saving your work before application crash</translation>
             <source>TOP_EXPORT_MED</source>
             <translation>Export to MED file</translation>
         </message>
+        <message>
+            <source>TOP_EXPORT_SAUV</source>
+            <translation>Export to SAUV (ASCII) file</translation>
+        </message>
         <message>
             <source>TOP_EXPORT_STL</source>
             <translation>Export to STL file</translation>
@@ -2703,6 +2735,10 @@ Consider saving your work before application crash</translation>
             <source>TOP_MED</source>
             <translation>Import MED file</translation>
         </message>
+        <message>
+            <source>TOP_SAUV</source>
+            <translation>Import SAUV (ASCII) file</translation>
+        </message>
         <message>
             <source>TOP_MERGE</source>
             <translation>Merge nodes</translation>
@@ -3375,6 +3411,13 @@ Please specify it and try again</translation>
             <translation>No valid mesh object selected</translation>
         </message>
     </context>
+    <context>
+        <name>SMESHGUI_Make2DFrom3DDlg</name>
+        <message>
+            <source>CAPTION</source>
+            <translation>Create 2D mesh from 3D</translation>
+        </message>
+    </context>
     <context>
         <name>SMESHGUI_CreatePatternDlg</name>
         <message>
index 0777667620f318c7f7304766f408d036cdf4df73..8d3cacc1306773924d4e2b22511c5bc123337d07 100644 (file)
@@ -121,7 +121,7 @@ namespace {
 TCollection_AsciiString
 SMESH_2smeshpy::ConvertScript(const TCollection_AsciiString& theScript,
                               Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
-                             Resource_DataMapOfAsciiStringAsciiString& theObjectNames)
+                              Resource_DataMapOfAsciiStringAsciiString& theObjectNames)
 {
   theGen = new _pyGen( theEntry2AccessorMethod, theObjectNames );
 
@@ -196,7 +196,7 @@ SMESH_2smeshpy::ConvertScript(const TCollection_AsciiString& theScript,
 //================================================================================
 
 _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
-              Resource_DataMapOfAsciiStringAsciiString& theObjectNames)
+               Resource_DataMapOfAsciiStringAsciiString& theObjectNames)
   : _pyObject( new _pyCommand( TPythonDump::SMESHGenName(), 0 )),
     myID2AccessorMethod( theEntry2AccessorMethod ),
     myObjectNames( theObjectNames )
@@ -541,7 +541,7 @@ Handle(_pyHypothesis) _pyGen::FindAlgo( const _pyID& theGeom, const _pyID& theMe
     if ( !hyp->IsNull() &&
          (*hyp)->IsAlgo() &&
          theHypothesis->CanBeCreatedBy( (*hyp)->GetAlgoType() ) &&
-        (*hyp)->GetGeom() == theGeom &&
+         (*hyp)->GetGeom() == theGeom &&
          (*hyp)->GetMesh() == theMesh )
       return *hyp;
   return 0;
@@ -624,8 +624,8 @@ void _pyGen::SetCommandBefore( Handle(_pyCommand) theCmd, Handle(_pyCommand) the
 //================================================================================
 
 void _pyGen::setNeighbourCommand( Handle(_pyCommand)& theCmd,
-                                 Handle(_pyCommand)& theOtherCmd,
-                                 const bool theIsAfter )
+                                  Handle(_pyCommand)& theOtherCmd,
+                                  const bool theIsAfter )
 {
   list< Handle(_pyCommand) >::iterator pos;
   pos = find( myCommands.begin(), myCommands.end(), theCmd );
@@ -680,8 +680,8 @@ _pyID _pyGen::GenerateNewID( const _pyID& theID )
   while ( myObjectNames.IsBound( aNewID ) );
     
   myObjectNames.Bind( aNewID, myObjectNames.IsBound( theID ) 
-                     ? (myObjectNames.Find( theID ) + _pyID( "_" ) + _pyID( index-1 ))
-                     : _pyID( "A" ) + aNewID );
+                      ? (myObjectNames.Find( theID ) + _pyID( "_" ) + _pyID( index-1 ))
+                      : _pyID( "A" ) + aNewID );
   return aNewID;
 }
 
@@ -952,21 +952,21 @@ void _pyMesh::Flush()
     if ( algo->IsWrapped() ) {
       _pyID localAlgoID = theGen->GenerateNewID( algoID );
       TCollection_AsciiString aNewCmdStr = localAlgoID +
-       TCollection_AsciiString( " = " ) + theGen->GetID() +
-       TCollection_AsciiString( ".CreateHypothesis( \"" ) + algo->GetAlgoType() +
-       TCollection_AsciiString( "\" )" );
+        TCollection_AsciiString( " = " ) + theGen->GetID() +
+        TCollection_AsciiString( ".CreateHypothesis( \"" ) + algo->GetAlgoType() +
+        TCollection_AsciiString( "\" )" );
       
       Handle(_pyCommand) newCmd = theGen->AddCommand( aNewCmdStr );
       Handle(_pyAlgorithm) newAlgo = Handle(_pyAlgorithm)::DownCast(theGen->FindHyp( localAlgoID ));
       if ( !newAlgo.IsNull() ) {
-       newAlgo->Assign( algo, this->GetID() );
-       newAlgo->SetCreationCmd( newCmd );
-       algo = newAlgo;
-       // set algorithm creation
-       theGen->SetCommandBefore( newCmd, addCmd );
+        newAlgo->Assign( algo, this->GetID() );
+        newAlgo->SetCreationCmd( newCmd );
+        algo = newAlgo;
+        // set algorithm creation
+        theGen->SetCommandBefore( newCmd, addCmd );
       }
       else
-       newCmd->Clear();
+        newCmd->Clear();
     }
     _pyID geom = addCmd->GetArg( 1 );
     bool isLocalAlgo = ( geom != GetGeom() );
@@ -982,14 +982,14 @@ void _pyMesh::Flush()
         addCmd->SetArg( addCmd->GetNbArgs() + 1,
                         TCollection_AsciiString( "geom=" ) + geom );
         // sm = mesh.GetSubMesh(geom, name) --> sm = ALGO.GetSubMesh()
-       list < Handle(_pySubMesh) >::iterator smIt;
+        list < Handle(_pySubMesh) >::iterator smIt;
         for ( smIt = mySubmeshes.begin(); smIt != mySubmeshes.end(); ++smIt ) {
-         Handle(_pySubMesh) subMesh = *smIt;
+          Handle(_pySubMesh) subMesh = *smIt;
           Handle(_pyCommand) subCmd = subMesh->GetCreationCmd();
           if ( geom == subCmd->GetArg( 1 )) {
             subCmd->SetObject( algo->GetID() );
             subCmd->RemoveArgs();
-           subMesh->SetCreator( algo );
+            subMesh->SetCreator( algo );
           }
         }
       }
@@ -1271,11 +1271,11 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
   }
   else if ( hypType == "QuadranglePreference" ) {
     hyp->SetConvMethodAndType( "QuadranglePreference", "Quadrangle_2D");
-    hyp->SetConvMethodAndType( "QuadranglePreference", "NETGEN_2D_ONLY");
+    hyp->SetConvMethodAndType( "SetQuadAllowed", "NETGEN_2D_ONLY");
   }
   else if ( hypType == "TrianglePreference" ) {
     hyp->SetConvMethodAndType( "TrianglePreference", "Quadrangle_2D");
-  }    
+  }     
   // BLSURF ----------
   else if ( hypType == "BLSURF" ) {
     algo->SetConvMethodAndType( "Triangle", hypType.ToCString());
@@ -1532,7 +1532,7 @@ void _pyHypothesis::ClearAllCommands()
 //================================================================================
 
 void _pyHypothesis::Assign( const Handle(_pyHypothesis)& theOther,
-                           const _pyID&                 theMesh )
+                            const _pyID&                 theMesh )
 {
   myIsWrapped = false;
   myMesh = theMesh;
@@ -1995,15 +1995,15 @@ const TCollection_AsciiString & _pyCommand::GetObject()
       int nb1 = 0; // number of ' character at the left of =
       int nb2 = 0; // number of " character at the left of =
       for ( int i = 1; i < begPos-1; i++ ) {
-       if ( myString.Value( i )=='\'' )
-         nb1 += 1;
-       else if ( myString.Value( i )=='"' )
-         nb2 += 1;
+        if ( myString.Value( i )=='\'' )
+          nb1 += 1;
+        else if ( myString.Value( i )=='"' )
+          nb2 += 1;
       }
       // if number of ' or " is not divisible by 2,
       // then get an object at the start of the command
       if ( nb1 % 2 != 0 || nb2 % 2 != 0 )
-       begPos = 1;
+        begPos = 1;
     }
     myObj = GetWord( myString, begPos, true );
     // check if object is complex,
@@ -2073,16 +2073,16 @@ const TCollection_AsciiString & _pyCommand::GetArg( int index )
     while ( begPos != EMPTY ) {
       begPos += prevLen;
       if( myString.Value( begPos ) == '(' )
-       nbNestings++;
+        nbNestings++;
       // check if we are looking at the closing parenthesis
       while ( begPos <= Length() && isspace( myString.Value( begPos )))
         ++begPos;
       if ( begPos > Length() )
         break;
       if ( myString.Value( begPos ) == ')' ) {
-       nbNestings--;
-       if( nbNestings == 0 )
-         break;
+        nbNestings--;
+        if( nbNestings == 0 )
+          break;
       }
       myArgs.Append( GetWord( myString, begPos, true, true ));
       SetBegPos( ARG1_IND + i, begPos );
index 015d91bde13db378987a88f90cfe71fde65b044a..16926e54d1d53cd71e32f6e166d2e5e6049aaaa9 100644 (file)
@@ -327,7 +327,7 @@ public:
   void Process( const Handle(_pyCommand)& theCommand);
   void Flush();
   virtual void Assign( const Handle(_pyHypothesis)& theOther,
-                      const _pyID&                 theMesh );
+                       const _pyID&                 theMesh );
 
   DEFINE_STANDARD_RTTI (_pyHypothesis)
 };
index 07ab0f69585566d5d63083966d1949ce8c6d6cb3..5b012b59cfc4cf48b5500a28f2a5c52c416e0431 100644 (file)
@@ -66,8 +66,8 @@ namespace SMESH
       TCollection_AsciiString aCollection(Standard_CString(aString.c_str()));
       SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
       if(!aStudy->_is_nil() && !aCollection.IsEmpty()){
-       aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
-       if(MYDEBUG) MESSAGE(aString);
+        aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
+        if(MYDEBUG) MESSAGE(aString);
       }
     }
   }
@@ -192,10 +192,11 @@ namespace SMESH
   operator<<(CORBA::Object_ptr theArg)
   {
     SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
+    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
     SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
     if(!aSObject->_is_nil()) {
-      myStream << aSObject->GetID();
+      CORBA::String_var id = aSObject->GetID();
+      myStream << id;
     } else if ( !CORBA::is_nil(theArg)) {
       if ( aSMESHGen->CanPublishInStudy( theArg )) // not published SMESH object
         myStream << "smeshObj_" << size_t(theArg);
@@ -484,6 +485,7 @@ Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
 
   // Add trace of API methods calls and replace study entries by names
   TCollection_AsciiString aScript =
+   "# -*- coding: iso-8859-1 -*-\n"
     "### This file is generated by SALOME automatically by dump python functionality of SMESH component\n\n";
   aScript += DumpPython_impl(aStudy, aMap, aMapNames,
                              isPublished, isValidScript, aSavedTrace);
@@ -585,8 +587,8 @@ Handle(TColStd_HSequenceOfInteger) FindEntries (TCollection_AsciiString& theStri
  
       isFound = Standard_False;
       while((j < aLen) && ( isdigit(c) || c == ':' )) { //Check if it is an entry
-       c = (int)arr[j++];  
-       if(c == ':') isFound = Standard_True;
+        c = (int)arr[j++];  
+        if(c == ':') isFound = Standard_True;
       }
 
       if (isFound) {
@@ -784,7 +786,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   }
 
   // set initial part of aSript
-  TCollection_AsciiString initPart = "import salome, SMESH\n";
+  TCollection_AsciiString initPart = "import salome, SMESH, SALOMEDS\n";
   initPart += helper + "import " + aSmeshpy + "\n\n";
   if ( importGeom )
   {
@@ -819,7 +821,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       if( !CORBA::is_nil(aGroup) )
       {
         SALOMEDS::Color aColor = aGroup->GetColor();
-        if ( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 )
+        if ( aColor.R >= 0 || aColor.G >= 0 || aColor.B >= 0 )
         {
           CORBA::String_var anEntry = aSObj->GetID();
           anUpdatedScript += SMESH_Comment("\n\t")
index c75d81e8877cc7914074b69ddfb0e9a2746406d6..e9370beda67bfff3ad59bc3584d7d511d9edbb85 100644 (file)
@@ -2436,13 +2436,13 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
       pd << "aCriterion = SMESH.Filter.Criterion(" << aCriterion << "," << aCompare
          << "," << aThreshold << ",'" << aThresholdStr;
       if (aThresholdID && strlen(aThresholdID))
-       //pd << "',salome.ObjectToID(" << aThresholdID
+        //pd << "',salome.ObjectToID(" << aThresholdID
         pd << "','" << aThresholdID
-          << "'," << aUnary << "," << aBinary << "," << aTolerance
-          << "," << aTypeOfElem << "," << aPrecision << ")";
+           << "'," << aUnary << "," << aBinary << "," << aTolerance
+           << "," << aTypeOfElem << "," << aPrecision << ")";
       else
-       pd << "',''," << aUnary << "," << aBinary << "," << aTolerance
-          << "," << aTypeOfElem << "," << aPrecision << ")";
+        pd << "',''," << aUnary << "," << aBinary << "," << aTolerance
+           << "," << aTypeOfElem << "," << aPrecision << ")";
     }
 
     SMESH::Predicate_ptr aPredicate = SMESH::Predicate::_nil();
@@ -2534,7 +2534,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
         {
           SMESH::LyingOnGeom_ptr tmpPred = aFilterMgr->CreateLyingOnGeom();
           tmpPred->SetElementType( aTypeOfElem );
-         tmpPred->SetShape( aThresholdID, aThresholdStr );
+          tmpPred->SetShape( aThresholdID, aThresholdStr );
           tmpPred->SetTolerance( aTolerance );
           aPredicate = tmpPred;
         }
index 090705d05a71eb02790cc49c31b73b606839da90..44cc246bf3a5112ce04ffd42d0a2fb696d5a20fb 100644 (file)
@@ -107,10 +107,10 @@ namespace SMESH
       double                          GetTolerance();
       
       virtual bool                    Contains( const SMESHDS_Mesh*     theMeshDS,
-                                               const TopoDS_Shape&     theShape,
-                                               const SMDS_MeshElement* theElem,
-                                               TopAbs_ShapeEnum        theFindShapeEnum,
-                                               TopAbs_ShapeEnum        theAvoidShapeEnum = TopAbs_SHAPE );
+                                                const TopoDS_Shape&     theShape,
+                                                const SMDS_MeshElement* theElem,
+                                                TopAbs_ShapeEnum        theFindShapeEnum,
+                                                TopAbs_ShapeEnum        theAvoidShapeEnum = TopAbs_SHAPE );
     private:
       virtual void                    init();
 
@@ -133,7 +133,7 @@ namespace SMESH
     Description : An abstact class for all functors 
   */
   class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
-                  public virtual SALOME::GenericObj_i
+                   public virtual SALOME::GenericObj_i
   {
   public:
     void                            SetMesh( SMESH_Mesh_ptr theMesh );
@@ -152,7 +152,7 @@ namespace SMESH
     Description : Base class for numerical functors 
   */
   class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
-                           public virtual Functor_i
+                            public virtual Functor_i
   {
   public:
     CORBA::Double                   GetValue( CORBA::Long theElementId );
@@ -170,7 +170,7 @@ namespace SMESH
     Description : Functor for calculation of minimum angle
   */
   class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
-                       public virtual NumericalFunctor_i
+                        public virtual NumericalFunctor_i
   {
   public:
     MinimumAngle_i();
@@ -183,7 +183,7 @@ namespace SMESH
     Description : Functor for calculating aspect ratio
   */
   class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
-                      public virtual NumericalFunctor_i
+                       public virtual NumericalFunctor_i
   {
   public:
     AspectRatio_i();
@@ -196,7 +196,7 @@ namespace SMESH
     Description : Functor for calculating aspect ratio for 3D
   */
   class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
-                        public virtual NumericalFunctor_i
+                         public virtual NumericalFunctor_i
   {
   public:
     AspectRatio3D_i();
@@ -209,7 +209,7 @@ namespace SMESH
     Description : Functor for calculating warping
   */
   class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
-                  public virtual NumericalFunctor_i
+                   public virtual NumericalFunctor_i
   {
   public:
     Warping_i();
@@ -222,7 +222,7 @@ namespace SMESH
     Description : Functor for calculating taper
   */
   class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
-                public virtual NumericalFunctor_i
+                 public virtual NumericalFunctor_i
   {
   public:
     Taper_i();
@@ -235,7 +235,7 @@ namespace SMESH
     Description : Functor for calculating skew in degrees
   */
   class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
-               public virtual NumericalFunctor_i
+                public virtual NumericalFunctor_i
   {
   public:
     Skew_i();
@@ -248,7 +248,7 @@ namespace SMESH
     Description : Functor for calculating area
   */
   class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
-               public virtual NumericalFunctor_i
+                public virtual NumericalFunctor_i
   {
   public:
     Area_i();
@@ -274,7 +274,7 @@ namespace SMESH
     Description : Functor for calculating length of edge
   */
   class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
-                 public virtual NumericalFunctor_i
+                  public virtual NumericalFunctor_i
   {
   public:
     Length_i();
@@ -286,7 +286,7 @@ namespace SMESH
     Description : Functor for calculating length of edge
   */
   class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
-                   public virtual NumericalFunctor_i
+                    public virtual NumericalFunctor_i
   {
   public:
     Length2D_i();
@@ -303,7 +303,7 @@ namespace SMESH
     Description : Functor for calculating number of faces conneted to the edge
   */
   class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
-                          public virtual NumericalFunctor_i
+                           public virtual NumericalFunctor_i
   {
   public:
     MultiConnection_i();
@@ -315,7 +315,7 @@ namespace SMESH
     Description : Functor for calculating number of faces conneted to the edge
   */
   class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
-                            public virtual NumericalFunctor_i
+                             public virtual NumericalFunctor_i
   {
   public:
     MultiConnection2D_i();
@@ -335,7 +335,7 @@ namespace SMESH
     Description : Base class for all predicates
   */
   class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
-                    public virtual Functor_i
+                     public virtual Functor_i
   {
   public:
     CORBA::Boolean                  IsSatisfy( CORBA::Long theElementId );
@@ -352,7 +352,7 @@ namespace SMESH
     the point of view of MED convention
   */
   class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
-                            public virtual Predicate_i
+                             public virtual Predicate_i
   {
   public:
     BadOrientedVolume_i();
@@ -364,7 +364,7 @@ namespace SMESH
     Description : Predicate for selection on geometrical support
   */
   class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
-                       public virtual Predicate_i
+                        public virtual Predicate_i
   {
   public:
     BelongToGeom_i();
@@ -395,7 +395,7 @@ namespace SMESH
     Description : Verify whether mesh element lie in pointed Geom planar object
   */
   class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
-                          public virtual Predicate_i
+                           public virtual Predicate_i
   {
   public:
     BelongToSurface_i( const Handle(Standard_Type)& );
@@ -426,7 +426,7 @@ namespace SMESH
     Description : Verify whether mesh element lie in pointed Geom planar object
   */
   class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
-                        public virtual BelongToSurface_i
+                         public virtual BelongToSurface_i
   {
   public:
     BelongToPlane_i();
@@ -439,7 +439,7 @@ namespace SMESH
     Description : Verify whether mesh element lie in pointed Geom cylindrical object
   */
   class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
-                           public virtual BelongToSurface_i
+                            public virtual BelongToSurface_i
   {
   public:
     BelongToCylinder_i();
@@ -465,7 +465,7 @@ namespace SMESH
     Description : Predicate for selection on geometrical support(lying or partially lying)
   */
   class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
-                      public virtual Predicate_i
+                       public virtual Predicate_i
   {
   public:
     LyingOnGeom_i();
@@ -496,7 +496,7 @@ namespace SMESH
     Description : Predicate for free borders
   */
   class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
-                      public virtual Predicate_i
+                       public virtual Predicate_i
   {
   public:
     FreeBorders_i();
@@ -509,7 +509,7 @@ namespace SMESH
     Description : Predicate for free edges
   */
   class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
-                    public virtual Predicate_i
+                     public virtual Predicate_i
   {
   public:
     FreeEdges_i();
@@ -526,7 +526,7 @@ namespace SMESH
     Description : Predicate for free faces
   */
   class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
-                      public virtual Predicate_i
+                       public virtual Predicate_i
   {
   public:
     FreeFaces_i();
@@ -539,7 +539,7 @@ namespace SMESH
     Description : Predicate for free nodes
   */
   class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
-                      public virtual Predicate_i
+                       public virtual Predicate_i
   {
   public:
     FreeNodes_i();
@@ -552,7 +552,7 @@ namespace SMESH
     Description : Predicate for Range of Ids
   */
   class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
-                     public virtual Predicate_i
+                      public virtual Predicate_i
   {
   public:
     RangeOfIds_i();
@@ -572,7 +572,7 @@ namespace SMESH
     Description : Verify whether a mesh element is linear
   */
   class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
-                            public virtual Predicate_i
+                             public virtual Predicate_i
   {
   public:
     LinearOrQuadratic_i();
@@ -588,7 +588,7 @@ namespace SMESH
     Description : Functor for check color of group to whic mesh element belongs to
   */
   class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
-                 public virtual Predicate_i
+                  public virtual Predicate_i
   {
   public:
     GroupColor_i();
@@ -607,7 +607,7 @@ namespace SMESH
     Description : Functor for check element geometry type
   */
   class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
-                 public virtual Predicate_i
+                  public virtual Predicate_i
   {
   public:
     ElemGeomType_i();
@@ -626,7 +626,7 @@ namespace SMESH
     Description : Base class for comparators
   */
   class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
-                     public virtual Predicate_i
+                      public virtual Predicate_i
   {
   public:
     virtual                         ~Comparator_i();
@@ -651,7 +651,7 @@ namespace SMESH
     Description : Comparator "<"
   */
   class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
-                   public virtual Comparator_i
+                    public virtual Comparator_i
   {
   public:
     LessThan_i();
@@ -664,7 +664,7 @@ namespace SMESH
     Description : Comparator ">"
   */
   class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
-                   public virtual Comparator_i
+                    public virtual Comparator_i
   {
   public:
     MoreThan_i();
@@ -677,7 +677,7 @@ namespace SMESH
     Description : Comparator "="
   */
   class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
-                  public virtual Comparator_i
+                   public virtual Comparator_i
   {
   public:
     EqualTo_i();
@@ -695,7 +695,7 @@ namespace SMESH
     Description : Logical NOT predicate
   */
   class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
-                     public virtual Predicate_i
+                      public virtual Predicate_i
   {
   public:
     LogicalNOT_i();
@@ -716,7 +716,7 @@ namespace SMESH
     Description : Base class for binary logical predicate
   */
   class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
-                        public virtual Predicate_i
+                         public virtual Predicate_i
   {
   public:
     virtual                         ~LogicalBinary_i();
@@ -742,7 +742,7 @@ namespace SMESH
     Description : Logical AND
   */
   class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
-                     public virtual LogicalBinary_i
+                      public virtual LogicalBinary_i
   {
   public:
     LogicalAND_i();
@@ -755,7 +755,7 @@ namespace SMESH
     Description : Logical OR
   */
   class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
-                    public virtual LogicalBinary_i
+                     public virtual LogicalBinary_i
   {
   public:
     LogicalOR_i();
@@ -767,7 +767,7 @@ namespace SMESH
     FILTER
   */
   class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
-                 public virtual SALOME::GenericObj_i
+                  public virtual SALOME::GenericObj_i
   {
   public:
     Filter_i();
@@ -792,13 +792,13 @@ namespace SMESH
     static
     void
     GetElementsId( Predicate_i*,
-                  const SMDS_Mesh*,
-                  Controls::Filter::TIdSequence& );
+                   const SMDS_Mesh*,
+                   Controls::Filter::TIdSequence& );
     static
     void           
     GetElementsId( Predicate_i*,
-                  SMESH_Mesh_ptr,
-                  Controls::Filter::TIdSequence& );
+                   SMESH_Mesh_ptr,
+                   Controls::Filter::TIdSequence& );
     
     virtual
     long_array*      
@@ -833,7 +833,7 @@ namespace SMESH
     FILTER LIBRARY
   */
   class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
-                        public virtual SALOME::GenericObj_i
+                         public virtual SALOME::GenericObj_i
   {
   public:
     FilterLibrary_i( const char* theFileName );
@@ -846,8 +846,8 @@ namespace SMESH
     CORBA::Boolean          AddEmpty( const char* theFilterName, ElementType theType );
     CORBA::Boolean          Delete  ( const char* theFilterName );
     CORBA::Boolean          Replace ( const char* theFilterName, 
-                                     const char* theNewName, 
-                                     Filter_ptr  theFilter );
+                                      const char* theNewName, 
+                                      Filter_ptr  theFilter );
     
     CORBA::Boolean          Save();
     CORBA::Boolean          SaveAs( const char* aFileName );
@@ -871,7 +871,7 @@ namespace SMESH
   */
   
   class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
-                        public virtual SALOME::GenericObj_i
+                         public virtual SALOME::GenericObj_i
   {
   public:
     FilterManager_i();
index 7e85c91ea67dfae6b57a37f2cd831012b3b4ef0c..9e041d5897b2fdc52962f5db306f5a6749d103d6 100644 (file)
@@ -173,11 +173,11 @@ CORBA::Object_var SMESH_Gen_i::SObjectToObject( SALOMEDS::SObject_ptr theSObject
   if ( !theSObject->_is_nil() ) {
     try {
       if( theSObject->FindAttribute( anAttr, "AttributeIOR" ) ) {
-       SALOMEDS::AttributeIOR_var anIOR  = SALOMEDS::AttributeIOR::_narrow( anAttr );
-       CORBA::String_var aValue = anIOR->Value();
-       if( strcmp( aValue, "" ) != 0 )
-         anObj = GetORB()->string_to_object( aValue );
-       }
+        SALOMEDS::AttributeIOR_var anIOR  = SALOMEDS::AttributeIOR::_narrow( anAttr );
+        CORBA::String_var aValue = anIOR->Value();
+        if( strcmp( aValue, "" ) != 0 )
+          anObj = GetORB()->string_to_object( aValue );
+        }
     }
     catch( ... ) {
       INFOS( "SObjectToObject - Unknown exception was caught!!!" );
@@ -260,9 +260,9 @@ SMESH_Gen_i::SMESH_Gen_i()
 //=============================================================================
 
 SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr            orb,
-                         PortableServer::POA_ptr   poa,
-                         PortableServer::ObjectId* contId, 
-                         const char*               instanceName, 
+                          PortableServer::POA_ptr   poa,
+                          PortableServer::ObjectId* contId, 
+                          const char*               instanceName, 
                           const char*               interfaceName )
      : Engines_Component_i( orb, poa, contId, instanceName, interfaceName )
 {
@@ -582,13 +582,13 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
       SALOMEDS::SComponent_var me = SALOMEDS::SComponent::_narrow
         ( myCurrentStudy->FindComponent( ComponentDataType() ) );
       if ( !me->_is_nil() ) {
-       SALOMEDS::ChildIterator_var anIter = myCurrentStudy->NewChildIterator( me );
-       for ( ; anIter->More(); anIter->Next() ) {
-         SALOMEDS::SObject_var so = anIter->Value();
-         CORBA::Object_var    ior = SObjectToObject( so );
-         if ( SMESH_Mesh_i*  mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
-           mesh->CheckGeomGroupModif();
-       }
+        SALOMEDS::ChildIterator_var anIter = myCurrentStudy->NewChildIterator( me );
+        for ( ; anIter->More(); anIter->Next() ) {
+          SALOMEDS::SObject_var so = anIter->Value();
+          CORBA::Object_var    ior = SObjectToObject( so );
+          if ( SMESH_Mesh_i*  mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
+            mesh->CheckGeomGroupModif();
+        }
       }
     }
   }
@@ -943,9 +943,9 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName,
       SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( mesh ).in() );
       ASSERT( meshServant );
       SMESH::DriverMED_ReadStatus status1 =
-       meshServant->ImportMEDFile( theFileName, (*it).c_str() );
+        meshServant->ImportMEDFile( theFileName, (*it).c_str() );
       if (status1 > theStatus)
-       theStatus = status1;
+        theStatus = status1;
 
       aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh );
     }
@@ -1298,7 +1298,7 @@ SMESH::algo_error_array* SMESH_Gen_i::GetAlgoState( SMESH::SMESH_Mesh_ptr theMes
 //=============================================================================
 
 SMESH::long_array* SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
-                                           const SMESH::object_array& theListOfSubShapeObject )
+                                            const SMESH::object_array& theListOfSubShapeObject )
      throw ( SALOME::SALOME_Exception )
 {
   Unexpect aCatch(SALOME_SalomeException);
@@ -1318,43 +1318,43 @@ SMESH::long_array* SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainSha
       TopExp::MapShapes(myMainShape,myIndexToShape);
 
       for ( int i = 0; i < theListOfSubShapeObject.length(); i++ )
-       {
-         GEOM::GEOM_Object_var aShapeObject
-           = GEOM::GEOM_Object::_narrow(theListOfSubShapeObject[i]);
-         if ( CORBA::is_nil( aShapeObject ) )
-           THROW_SALOME_CORBA_EXCEPTION ("bad shape object reference", \
-                                       SALOME::BAD_PARAM );
-
-         TopoDS_Shape locShape  = GeomObjectToShape(aShapeObject);
-         for (TopExp_Explorer exp(locShape,TopAbs_FACE); exp.More(); exp.Next())
-           {
-             const TopoDS_Face& F = TopoDS::Face(exp.Current());
-             setId.insert(myIndexToShape.FindIndex(F));
-             if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(F));
-           }
-         for (TopExp_Explorer exp(locShape,TopAbs_EDGE); exp.More(); exp.Next())
-           {
-             const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
-             setId.insert(myIndexToShape.FindIndex(E));
-             if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(E));
-           }
-         for (TopExp_Explorer exp(locShape,TopAbs_VERTEX); exp.More(); exp.Next())
-           {
-             const TopoDS_Vertex& V = TopoDS::Vertex(exp.Current());
-             setId.insert(myIndexToShape.FindIndex(V));
-             if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(V));
-           }
-       }
+        {
+          GEOM::GEOM_Object_var aShapeObject
+            = GEOM::GEOM_Object::_narrow(theListOfSubShapeObject[i]);
+          if ( CORBA::is_nil( aShapeObject ) )
+            THROW_SALOME_CORBA_EXCEPTION ("bad shape object reference", \
+                                        SALOME::BAD_PARAM );
+
+          TopoDS_Shape locShape  = GeomObjectToShape(aShapeObject);
+          for (TopExp_Explorer exp(locShape,TopAbs_FACE); exp.More(); exp.Next())
+            {
+              const TopoDS_Face& F = TopoDS::Face(exp.Current());
+              setId.insert(myIndexToShape.FindIndex(F));
+              if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(F));
+            }
+          for (TopExp_Explorer exp(locShape,TopAbs_EDGE); exp.More(); exp.Next())
+            {
+              const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
+              setId.insert(myIndexToShape.FindIndex(E));
+              if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(E));
+            }
+          for (TopExp_Explorer exp(locShape,TopAbs_VERTEX); exp.More(); exp.Next())
+            {
+              const TopoDS_Vertex& V = TopoDS::Vertex(exp.Current());
+              setId.insert(myIndexToShape.FindIndex(V));
+              if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(V));
+            }
+        }
       shapesId->length(setId.size());
       set<int>::iterator iind;
       int i=0;
       for (iind = setId.begin(); iind != setId.end(); iind++)
-       {
-         if(MYDEBUG) SCRUTE((*iind));
-         shapesId[i] = (*iind);
-         if(MYDEBUG) SCRUTE(shapesId[i]);
-         i++;
-       }
+        {
+          if(MYDEBUG) SCRUTE((*iind));
+          shapesId[i] = (*iind);
+          if(MYDEBUG) SCRUTE(shapesId[i]);
+          i++;
+        }
     }
   catch (SALOME_Exception& S_ex)
     {
@@ -1431,9 +1431,9 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
 //=============================================================================
 
 SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh,
-                                                  GEOM::GEOM_Object_ptr theShapeObject,
-                                                  SMESH::Dimension      theDimension,
-                                                  SMESH::long_array&    theShapesId)
+                                                   GEOM::GEOM_Object_ptr theShapeObject,
+                                                   SMESH::Dimension      theDimension,
+                                                   SMESH::long_array&    theShapesId)
      throw ( SALOME::SALOME_Exception )
 {
   Unexpect aCatch(SALOME_SalomeException);
@@ -1460,7 +1460,7 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
       if(theMesh->HasShapeToMesh())
         myLocShape = GeomObjectToShape( theShapeObject );
       else
-       return result._retn();;
+        return result._retn();;
 
       // call implementation compute
       ::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
@@ -1468,132 +1468,132 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
       ::MeshDimension aDim = (MeshDimension)theDimension;
       if ( myGen.Compute( myLocMesh, myLocShape, false, aDim, &shapeIds ) )
       {
-       int nbShapeId = shapeIds.size();
-       theShapesId.length( nbShapeId );
-       // iterates on shapes and collect mesh entities into mesh preview
-       TSetOfInt::const_iterator idIt = shapeIds.begin();
-       TSetOfInt::const_iterator idEnd = shapeIds.end();
-       std::map< int, int > mapOfShIdNb;
-       std::set< SMESH_TLink > setOfEdge;
-       std::list< SMDSAbs_ElementType > listOfElemType;
-       typedef map<const SMDS_MeshElement*, int > TNode2LocalIDMap;
-       typedef TNode2LocalIDMap::iterator         TNodeLocalID;
-       TNode2LocalIDMap mapNode2LocalID;
-       list< TNodeLocalID > connectivity;
-       int i, nbConnNodes = 0;
-       std::set< const SMESH_subMesh* > setOfVSubMesh;
-       // iterates on shapes
-       for ( ; idIt != idEnd; idIt++ )
-       {
-         if ( mapOfShIdNb.find( *idIt ) != mapOfShIdNb.end() )
-           continue;
-         SMESH_subMesh* sm = myLocMesh.GetSubMeshContaining(*idIt);
-         if ( !sm || !sm->IsMeshComputed() )
-           continue;
-         
-         const TopoDS_Shape& aSh = sm->GetSubShape();
-         const int shDim = myGen.GetShapeDim( aSh );
-         if ( shDim < 1 || shDim > theDimension )
-           continue;
-
-         mapOfShIdNb[ *idIt ] = 0;
-         theShapesId[ mapOfShIdNb.size() - 1 ] = *idIt;
-
-         SMESHDS_SubMesh* smDS = sm->GetSubMeshDS();
-         if ( !smDS ) continue;
-
-         if ( theDimension == SMESH::DIM_2D )
-         {
-           SMDS_ElemIteratorPtr faceIt = smDS->GetElements();
-           while ( faceIt->more() )
-           {
-             const SMDS_MeshElement* face = faceIt->next();
-             int aNbNode = face->NbNodes();
-             if ( aNbNode > 4 )
-               aNbNode /= 2; // do not take into account additional middle nodes
-
-             SMDS_MeshNode* node1 = (SMDS_MeshNode*)face->GetNode( 0 );
-             for ( int nIndx = 0; nIndx < aNbNode; nIndx++ )
-             {
-               SMDS_MeshNode* node2 = (SMDS_MeshNode*)face->GetNode( nIndx+1 < aNbNode ? nIndx+1 : 0 );
-               if ( setOfEdge.insert( SMESH_TLink ( node1, node2 ) ).second )
-               {
-                 listOfElemType.push_back( SMDSAbs_Edge );
-                 connectivity.push_back
-                   ( mapNode2LocalID.insert( make_pair( node1, ++nbConnNodes)).first );
-                 connectivity.push_back
-                   ( mapNode2LocalID.insert( make_pair( node2, ++nbConnNodes)).first );
-               }
-               node1 = node2;
-             }
-           }
-         }
-         else if ( theDimension == SMESH::DIM_1D )
-         {
-           SMDS_NodeIteratorPtr nodeIt = smDS->GetNodes();
-           while ( nodeIt->more() )
-           {
-             listOfElemType.push_back( SMDSAbs_Node );
-             connectivity.push_back
-               ( mapNode2LocalID.insert( make_pair( nodeIt->next(), ++nbConnNodes)).first );
-           }
-           // add corner nodes by first vertex from edge
-           SMESH_subMeshIteratorPtr edgeSmIt =
-             sm->getDependsOnIterator(/*includeSelf*/false,
-                                      /*complexShapeFirst*/false);
-           while ( edgeSmIt->more() )
-           {
-             SMESH_subMesh* vertexSM = edgeSmIt->next();
-             // check that vertex is not already treated
-             if ( !setOfVSubMesh.insert( vertexSM ).second )
-               continue;
-             if ( vertexSM->GetSubShape().ShapeType() != TopAbs_VERTEX )
-               continue;
-
-             const SMESHDS_SubMesh* vertexSmDS = vertexSM->GetSubMeshDS();
-             SMDS_NodeIteratorPtr nodeIt = vertexSmDS->GetNodes();
-             while ( nodeIt->more() )
-             {
-               listOfElemType.push_back( SMDSAbs_Node );
-               connectivity.push_back
-                 ( mapNode2LocalID.insert( make_pair( nodeIt->next(), ++nbConnNodes)).first );
-             }
-           }
-         }
-       }
-
-       // fill node coords and assign local ids to the nodes
-       int nbNodes = mapNode2LocalID.size();
-       result->nodesXYZ.length( nbNodes );
-       TNodeLocalID node2ID = mapNode2LocalID.begin();
-       for ( i = 0; i < nbNodes; ++i, ++node2ID ) {
-         node2ID->second = i;
-         const SMDS_MeshNode* node = (const SMDS_MeshNode*) node2ID->first;
-         result->nodesXYZ[i].x = node->X();
-         result->nodesXYZ[i].y = node->Y();
-         result->nodesXYZ[i].z = node->Z();
-       }
-       // fill connectivity
-       result->elementConnectivities.length( nbConnNodes );
-       list< TNodeLocalID >::iterator connIt = connectivity.begin();
-       for ( i = 0; i < nbConnNodes; ++i, ++connIt ) {
-         result->elementConnectivities[i] = (*connIt)->second;
-       }
-
-       // fill element types
-       result->elementTypes.length( listOfElemType.size() );
-       std::list< SMDSAbs_ElementType >::const_iterator typeIt = listOfElemType.begin();
-       std::list< SMDSAbs_ElementType >::const_iterator typeEnd = listOfElemType.end();
-       for ( i = 0; typeIt != typeEnd; ++i, ++typeIt )
+        int nbShapeId = shapeIds.size();
+        theShapesId.length( nbShapeId );
+        // iterates on shapes and collect mesh entities into mesh preview
+        TSetOfInt::const_iterator idIt = shapeIds.begin();
+        TSetOfInt::const_iterator idEnd = shapeIds.end();
+        std::map< int, int > mapOfShIdNb;
+        std::set< SMESH_TLink > setOfEdge;
+        std::list< SMDSAbs_ElementType > listOfElemType;
+        typedef map<const SMDS_MeshElement*, int > TNode2LocalIDMap;
+        typedef TNode2LocalIDMap::iterator         TNodeLocalID;
+        TNode2LocalIDMap mapNode2LocalID;
+        list< TNodeLocalID > connectivity;
+        int i, nbConnNodes = 0;
+        std::set< const SMESH_subMesh* > setOfVSubMesh;
+        // iterates on shapes
+        for ( ; idIt != idEnd; idIt++ )
         {
-         SMDSAbs_ElementType elemType = *typeIt;
-         result->elementTypes[i].SMDS_ElementType = (SMESH::ElementType)elemType;
-         result->elementTypes[i].isPoly           = false;
-         result->elementTypes[i].nbNodesInElement = elemType == SMDSAbs_Edge ? 2 : 1;
-       }
-
-       // correct number of shapes
-       theShapesId.length( mapOfShIdNb.size() );
+          if ( mapOfShIdNb.find( *idIt ) != mapOfShIdNb.end() )
+            continue;
+          SMESH_subMesh* sm = myLocMesh.GetSubMeshContaining(*idIt);
+          if ( !sm || !sm->IsMeshComputed() )
+            continue;
+          
+          const TopoDS_Shape& aSh = sm->GetSubShape();
+          const int shDim = myGen.GetShapeDim( aSh );
+          if ( shDim < 1 || shDim > theDimension )
+            continue;
+
+          mapOfShIdNb[ *idIt ] = 0;
+          theShapesId[ mapOfShIdNb.size() - 1 ] = *idIt;
+
+          SMESHDS_SubMesh* smDS = sm->GetSubMeshDS();
+          if ( !smDS ) continue;
+
+          if ( theDimension == SMESH::DIM_2D )
+          {
+            SMDS_ElemIteratorPtr faceIt = smDS->GetElements();
+            while ( faceIt->more() )
+            {
+              const SMDS_MeshElement* face = faceIt->next();
+              int aNbNode = face->NbNodes();
+              if ( aNbNode > 4 )
+                aNbNode /= 2; // do not take into account additional middle nodes
+
+              SMDS_MeshNode* node1 = (SMDS_MeshNode*)face->GetNode( 0 );
+              for ( int nIndx = 0; nIndx < aNbNode; nIndx++ )
+              {
+                SMDS_MeshNode* node2 = (SMDS_MeshNode*)face->GetNode( nIndx+1 < aNbNode ? nIndx+1 : 0 );
+                if ( setOfEdge.insert( SMESH_TLink ( node1, node2 ) ).second )
+                {
+                  listOfElemType.push_back( SMDSAbs_Edge );
+                  connectivity.push_back
+                    ( mapNode2LocalID.insert( make_pair( node1, ++nbConnNodes)).first );
+                  connectivity.push_back
+                    ( mapNode2LocalID.insert( make_pair( node2, ++nbConnNodes)).first );
+                }
+                node1 = node2;
+              }
+            }
+          }
+          else if ( theDimension == SMESH::DIM_1D )
+          {
+            SMDS_NodeIteratorPtr nodeIt = smDS->GetNodes();
+            while ( nodeIt->more() )
+            {
+              listOfElemType.push_back( SMDSAbs_Node );
+              connectivity.push_back
+                ( mapNode2LocalID.insert( make_pair( nodeIt->next(), ++nbConnNodes)).first );
+            }
+            // add corner nodes by first vertex from edge
+            SMESH_subMeshIteratorPtr edgeSmIt =
+              sm->getDependsOnIterator(/*includeSelf*/false,
+                                       /*complexShapeFirst*/false);
+            while ( edgeSmIt->more() )
+            {
+              SMESH_subMesh* vertexSM = edgeSmIt->next();
+              // check that vertex is not already treated
+              if ( !setOfVSubMesh.insert( vertexSM ).second )
+                continue;
+              if ( vertexSM->GetSubShape().ShapeType() != TopAbs_VERTEX )
+                continue;
+
+              const SMESHDS_SubMesh* vertexSmDS = vertexSM->GetSubMeshDS();
+              SMDS_NodeIteratorPtr nodeIt = vertexSmDS->GetNodes();
+              while ( nodeIt->more() )
+              {
+                listOfElemType.push_back( SMDSAbs_Node );
+                connectivity.push_back
+                  ( mapNode2LocalID.insert( make_pair( nodeIt->next(), ++nbConnNodes)).first );
+              }
+            }
+          }
+        }
+
+        // fill node coords and assign local ids to the nodes
+        int nbNodes = mapNode2LocalID.size();
+        result->nodesXYZ.length( nbNodes );
+        TNodeLocalID node2ID = mapNode2LocalID.begin();
+        for ( i = 0; i < nbNodes; ++i, ++node2ID ) {
+          node2ID->second = i;
+          const SMDS_MeshNode* node = (const SMDS_MeshNode*) node2ID->first;
+          result->nodesXYZ[i].x = node->X();
+          result->nodesXYZ[i].y = node->Y();
+          result->nodesXYZ[i].z = node->Z();
+        }
+        // fill connectivity
+        result->elementConnectivities.length( nbConnNodes );
+        list< TNodeLocalID >::iterator connIt = connectivity.begin();
+        for ( i = 0; i < nbConnNodes; ++i, ++connIt ) {
+          result->elementConnectivities[i] = (*connIt)->second;
+        }
+
+        // fill element types
+        result->elementTypes.length( listOfElemType.size() );
+        std::list< SMDSAbs_ElementType >::const_iterator typeIt = listOfElemType.begin();
+        std::list< SMDSAbs_ElementType >::const_iterator typeEnd = listOfElemType.end();
+        for ( i = 0; typeIt != typeEnd; ++i, ++typeIt )
+        {
+          SMDSAbs_ElementType elemType = *typeIt;
+          result->elementTypes[i].SMDS_ElementType = (SMESH::ElementType)elemType;
+          result->elementTypes[i].isPoly           = false;
+          result->elementTypes[i].nbNodesInElement = elemType == SMDSAbs_Edge ? 2 : 1;
+        }
+
+        // correct number of shapes
+        theShapesId.length( mapOfShIdNb.size() );
       }
     }
   }
@@ -1619,7 +1619,7 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
 //=============================================================================
 
 SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
-                                        GEOM::GEOM_Object_ptr theShapeObject)
+                                         GEOM::GEOM_Object_ptr theShapeObject)
 //                                     SMESH::long_array& theNbElems)
      throw ( SALOME::SALOME_Exception )
 {
@@ -1663,10 +1663,10 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
       /*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap);
       MapShapeNbElemsItr anIt = aResMap.begin();
       for(; anIt!=aResMap.end(); anIt++) {
-       const vector<int>& aVec = (*anIt).second;
-       for(i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) {
-         nbels[i] += aVec[i];
-       }
+        const vector<int>& aVec = (*anIt).second;
+        for(i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) {
+          nbels[i] += aVec[i];
+        }
       }
 #ifdef _DEBUG_
       cout<<endl;
@@ -1808,7 +1808,7 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
         }
         if ( !geom->_is_nil() ) {
           GeomObjectToShape( geom ); // let geom client remember the found shape
-         return geom._retn();
+          return geom._retn();
         }
       }
     }
@@ -1825,16 +1825,16 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
 //================================================================================
 
 SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshesArray,
-                                              CORBA::Boolean           theUniteIdenticalGroups, 
-                                              CORBA::Boolean           theMergeNodesAndElements, 
-                                              CORBA::Double            theMergeTolerance)
+                                               CORBA::Boolean           theUniteIdenticalGroups, 
+                                               CORBA::Boolean           theMergeNodesAndElements, 
+                                               CORBA::Double            theMergeTolerance)
   throw ( SALOME::SALOME_Exception )
 {
   return ConcatenateCommon(theMeshesArray,
-                          theUniteIdenticalGroups,
-                          theMergeNodesAndElements,
-                          theMergeTolerance,
-                          false);
+                           theUniteIdenticalGroups,
+                           theMergeNodesAndElements,
+                           theMergeTolerance,
+                           false);
 }
 
 //================================================================================
@@ -1848,7 +1848,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
 
 SMESH::SMESH_Mesh_ptr
 SMESH_Gen_i::ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray,
-                                  CORBA::Boolean           theUniteIdenticalGroups, 
+                                   CORBA::Boolean           theUniteIdenticalGroups, 
                                    CORBA::Boolean           theMergeNodesAndElements, 
                                    CORBA::Double            theMergeTolerance)
   throw ( SALOME::SALOME_Exception )
@@ -1857,7 +1857,7 @@ SMESH_Gen_i::ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray,
                            theUniteIdenticalGroups,
                            theMergeNodesAndElements,
                            theMergeTolerance,
-                          true);
+                           true);
 }
 
 //================================================================================
@@ -1870,10 +1870,10 @@ SMESH_Gen_i::ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray,
 
 SMESH::SMESH_Mesh_ptr
 SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
-                              CORBA::Boolean           theUniteIdenticalGroups, 
+                               CORBA::Boolean           theUniteIdenticalGroups, 
                                CORBA::Boolean           theMergeNodesAndElements, 
                                CORBA::Double            theMergeTolerance,
-                              CORBA::Boolean           theCommonGroups)
+                               CORBA::Boolean           theCommonGroups)
   throw ( SALOME::SALOME_Exception )
 {
   typedef map<int, int> TIDsMap;
@@ -1881,7 +1881,8 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
   typedef map< pair<string, SMESH::ElementType>, TListOfNewGroups > TGroupsMap;
   typedef std::set<SMESHDS_GroupBase*> TGroups;
 
-  TPythonDump aPythonDump; // prevent dump of called methods
+  TPythonDump* pPythonDump = new TPythonDump;
+  TPythonDump& aPythonDump = *pPythonDump; // prevent dump of called methods
 
   // create mesh
   SMESH::SMESH_Mesh_var aNewMesh = CreateEmptyMesh();
@@ -1899,236 +1900,236 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
 
       // loop on meshes
       for ( int i = 0; i < theMeshesArray.length(); i++) {
-       SMESH::SMESH_Mesh_var anInitMesh = theMeshesArray[i];
-       if ( !anInitMesh->_is_nil() ) {
-         SMESH_Mesh_i* anInitImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( anInitMesh ).in() );
-         if ( anInitImpl ) {
-           ::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl();
-           SMESHDS_Mesh* anInitMeshDS = aInitLocMesh.GetMeshDS();
-
-           TIDsMap nodesMap;
-           TIDsMap elemsMap;
-
-           // loop on elements of mesh
-           SMDS_ElemIteratorPtr itElems = anInitMeshDS->elementsIterator();
-           const SMDS_MeshElement* anElem = 0;
-           const SMDS_MeshElement* aNewElem = 0;
-           int anElemNbNodes = 0;
-
-           int anNbNodes   = 0;
-           int anNbEdges   = 0;
-           int anNbFaces   = 0;
-           int anNbVolumes = 0;
-
-           SMESH::long_array_var anIDsNodes   = new SMESH::long_array();
-           SMESH::long_array_var anIDsEdges   = new SMESH::long_array();
-           SMESH::long_array_var anIDsFaces   = new SMESH::long_array();
-           SMESH::long_array_var anIDsVolumes = new SMESH::long_array();
-
-           if( theCommonGroups ) {
-             anIDsNodes->length(   anInitMeshDS->NbNodes()   );
-             anIDsEdges->length(   anInitMeshDS->NbEdges()   );
-             anIDsFaces->length(   anInitMeshDS->NbFaces()   );
-             anIDsVolumes->length( anInitMeshDS->NbVolumes() );
-           }
-
-           for ( int j = 0; itElems->more(); j++) {
-             anElem = itElems->next();
-             SMDSAbs_ElementType anElemType = anElem->GetType();
-             anElemNbNodes = anElem->NbNodes();
-             std::vector<const SMDS_MeshNode*> aNodesArray (anElemNbNodes);
-
-             // loop on nodes of element
-             const SMDS_MeshNode* aNode = 0;
-             const SMDS_MeshNode* aNewNode = 0;
-             SMDS_ElemIteratorPtr itNodes = anElem->nodesIterator();
-
-             for ( int k = 0; itNodes->more(); k++) {
-               aNode = static_cast<const SMDS_MeshNode*>(itNodes->next());
-               if ( nodesMap.find(aNode->GetID()) == nodesMap.end() ) {
-                 aNewNode = aNewMeshDS->AddNode(aNode->X(), aNode->Y(), aNode->Z());
-                 nodesMap.insert( make_pair(aNode->GetID(), aNewNode->GetID()) );
-                 if( theCommonGroups )
-                   anIDsNodes[anNbNodes++] = aNewNode->GetID();
-               }
-               else
-                 aNewNode = aNewMeshDS->FindNode( nodesMap.find(aNode->GetID())->second );
-               aNodesArray[k] = aNewNode;
-             }//nodes loop
-
-             // creates a corresponding element on existent nodes in new mesh
-             if ( anElem->IsPoly() && anElemType == SMDSAbs_Volume )
-               {
-                 const SMDS_PolyhedralVolumeOfNodes* aVolume =
-                   dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem);
-                 if ( aVolume ) {
-                   aNewElem = aNewMeshDS->AddPolyhedralVolume(aNodesArray, 
-                                                              aVolume->GetQuanities());
-                   elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
-                   if( theCommonGroups )
-                     anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
-                 }
-               }
-             else {
-               
-               aNewElem = aNewEditor.AddElement(aNodesArray,
-                                                anElemType,
-                                                anElem->IsPoly());
-               elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
-               if( theCommonGroups ) {
-                 if( anElemType == SMDSAbs_Edge )
-                   anIDsEdges[anNbEdges++] = aNewElem->GetID();
-                 else if( anElemType == SMDSAbs_Face )
-                   anIDsFaces[anNbFaces++] = aNewElem->GetID();
-                 else if( anElemType == SMDSAbs_Volume )
-                   anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
-               }
-             } 
-           }//elems loop
-           
-           aListOfGroups = anInitImpl->GetGroups();
-           SMESH::SMESH_GroupBase_ptr aGroup;
-
-           // loop on groups of mesh
-           SMESH::long_array_var anInitIDs = new SMESH::long_array();
-           SMESH::long_array_var anNewIDs = new SMESH::long_array();
-           SMESH::SMESH_Group_var aNewGroup;
-
-           SMESH::ElementType aGroupType;
-           CORBA::String_var aGroupName;
-           if ( theCommonGroups ) {
-             for(aGroupType=SMESH::NODE;aGroupType<=SMESH::VOLUME;aGroupType=(SMESH::ElementType)(aGroupType+1)) {
-               string str = "Gr";
-               SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, anInitMesh );
-               if(aMeshSObj)
-                 str += aMeshSObj->GetName();
-               str += "_";
-
-               int anLen = 0;
-
-               switch(aGroupType) {
-               case SMESH::NODE:
-                 str += "Nodes";
-                 anIDsNodes->length(anNbNodes);
-                 anLen = anNbNodes;
-                 break;
-               case SMESH::EDGE:
-                 str += "Edges";
-                 anIDsEdges->length(anNbEdges);
-                 anLen = anNbEdges;
-                 break;
-               case SMESH::FACE:
-                 str += "Faces";
-                 anIDsFaces->length(anNbFaces);
-                 anLen = anNbFaces;
-                 break;
-               case SMESH::VOLUME:
-                 str += "Volumes";
-                 anIDsVolumes->length(anNbVolumes);
-                 anLen = anNbVolumes;
-                 break;
-               default:
-                 break;
-               }
-
-               if(anLen) {
-                 aGroupName = str.c_str();
-
-                 // add a new group in the mesh
-                 aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
-
-                 switch(aGroupType) {
-                 case SMESH::NODE:
-                   aNewGroup->Add( anIDsNodes );
-                   break;
-                 case SMESH::EDGE:
-                   aNewGroup->Add( anIDsEdges );
-                   break;
-                 case SMESH::FACE:
-                   aNewGroup->Add( anIDsFaces );
-                   break;
-                 case SMESH::VOLUME:
-                   aNewGroup->Add( anIDsVolumes );
-                   break;
-                 default:
-                   break;
-                 }
-               
-                 aListOfNewGroups.clear();
-                 aListOfNewGroups.push_back(aNewGroup);
-                 aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups ));
-               }
-             }
-           }
-
-           // check that current group name and type don't have identical ones in union mesh
-           for (int i = 0; i < aListOfGroups->length(); i++) {
-             aGroup = aListOfGroups[i];
-             aListOfNewGroups.clear();
-             aGroupType = aGroup->GetType();
-             aGroupName = aGroup->GetName();
-
-             TGroupsMap::iterator anIter = aGroupsMap.find(make_pair(aGroupName, aGroupType));
-
-             // convert a list of IDs
-             anInitIDs = aGroup->GetListOfID();
-             anNewIDs->length(anInitIDs->length());
-             if ( aGroupType == SMESH::NODE )
-               for (int j = 0; j < anInitIDs->length(); j++) {
-                 anNewIDs[j] = nodesMap.find(anInitIDs[j])->second;
-               }
-             else
-               for (int j = 0; j < anInitIDs->length(); j++) {
-                 anNewIDs[j] = elemsMap.find(anInitIDs[j])->second;
-               }
-             
-             // check that current group name and type don't have identical ones in union mesh
-             if ( anIter == aGroupsMap.end() ) {
-               // add a new group in the mesh
-               aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
-               // add elements into new group
-               aNewGroup->Add( anNewIDs );
-               
-               aListOfNewGroups.push_back(aNewGroup);
-               aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups ));
-             }
-
-             else if ( theUniteIdenticalGroups ) {
-               // unite identical groups
-               TListOfNewGroups& aNewGroups = anIter->second;
-               aNewGroups.front()->Add( anNewIDs );
-             }
-
-             else {
-               // rename identical groups
-               aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
-               aNewGroup->Add( anNewIDs );
-               
-               TListOfNewGroups& aNewGroups = anIter->second;
-               string aNewGroupName;
-               if (aNewGroups.size() == 1) {
-                 aNewGroupName = string(aGroupName) + "_1";
-                 aNewGroups.front()->SetName(aNewGroupName.c_str());
-               }
-               char aGroupNum[128];
-               sprintf(aGroupNum, "%u", aNewGroups.size()+1);
-               aNewGroupName = string(aGroupName) + "_" + string(aGroupNum);
-               aNewGroup->SetName(aNewGroupName.c_str());
-               aNewGroups.push_back(aNewGroup);
-             }
-           }//groups loop
-         }
-       }
+        SMESH::SMESH_Mesh_var anInitMesh = theMeshesArray[i];
+        if ( !anInitMesh->_is_nil() ) {
+          SMESH_Mesh_i* anInitImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( anInitMesh ).in() );
+          if ( anInitImpl ) {
+            ::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl();
+            SMESHDS_Mesh* anInitMeshDS = aInitLocMesh.GetMeshDS();
+
+            TIDsMap nodesMap;
+            TIDsMap elemsMap;
+
+            // loop on elements of mesh
+            SMDS_ElemIteratorPtr itElems = anInitMeshDS->elementsIterator();
+            const SMDS_MeshElement* anElem = 0;
+            const SMDS_MeshElement* aNewElem = 0;
+            int anElemNbNodes = 0;
+
+            int anNbNodes   = 0;
+            int anNbEdges   = 0;
+            int anNbFaces   = 0;
+            int anNbVolumes = 0;
+
+            SMESH::long_array_var anIDsNodes   = new SMESH::long_array();
+            SMESH::long_array_var anIDsEdges   = new SMESH::long_array();
+            SMESH::long_array_var anIDsFaces   = new SMESH::long_array();
+            SMESH::long_array_var anIDsVolumes = new SMESH::long_array();
+
+            if( theCommonGroups ) {
+              anIDsNodes->length(   anInitMeshDS->NbNodes()   );
+              anIDsEdges->length(   anInitMeshDS->NbEdges()   );
+              anIDsFaces->length(   anInitMeshDS->NbFaces()   );
+              anIDsVolumes->length( anInitMeshDS->NbVolumes() );
+            }
+
+            for ( int j = 0; itElems->more(); j++) {
+              anElem = itElems->next();
+              SMDSAbs_ElementType anElemType = anElem->GetType();
+              anElemNbNodes = anElem->NbNodes();
+              std::vector<const SMDS_MeshNode*> aNodesArray (anElemNbNodes);
+
+              // loop on nodes of element
+              const SMDS_MeshNode* aNode = 0;
+              const SMDS_MeshNode* aNewNode = 0;
+              SMDS_ElemIteratorPtr itNodes = anElem->nodesIterator();
+
+              for ( int k = 0; itNodes->more(); k++) {
+                aNode = static_cast<const SMDS_MeshNode*>(itNodes->next());
+                if ( nodesMap.find(aNode->GetID()) == nodesMap.end() ) {
+                  aNewNode = aNewMeshDS->AddNode(aNode->X(), aNode->Y(), aNode->Z());
+                  nodesMap.insert( make_pair(aNode->GetID(), aNewNode->GetID()) );
+                  if( theCommonGroups )
+                    anIDsNodes[anNbNodes++] = aNewNode->GetID();
+                }
+                else
+                  aNewNode = aNewMeshDS->FindNode( nodesMap.find(aNode->GetID())->second );
+                aNodesArray[k] = aNewNode;
+              }//nodes loop
+
+              // creates a corresponding element on existent nodes in new mesh
+              if ( anElem->IsPoly() && anElemType == SMDSAbs_Volume )
+                {
+                  const SMDS_PolyhedralVolumeOfNodes* aVolume =
+                    dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem);
+                  if ( aVolume ) {
+                    aNewElem = aNewMeshDS->AddPolyhedralVolume(aNodesArray, 
+                                                               aVolume->GetQuanities());
+                    elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
+                    if( theCommonGroups )
+                      anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
+                  }
+                }
+              else {
+                
+                aNewElem = aNewEditor.AddElement(aNodesArray,
+                                                 anElemType,
+                                                 anElem->IsPoly());
+                elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
+                if( theCommonGroups ) {
+                  if( anElemType == SMDSAbs_Edge )
+                    anIDsEdges[anNbEdges++] = aNewElem->GetID();
+                  else if( anElemType == SMDSAbs_Face )
+                    anIDsFaces[anNbFaces++] = aNewElem->GetID();
+                  else if( anElemType == SMDSAbs_Volume )
+                    anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
+                }
+              
+            }//elems loop
+            
+            aListOfGroups = anInitImpl->GetGroups();
+            SMESH::SMESH_GroupBase_ptr aGroup;
+
+            // loop on groups of mesh
+            SMESH::long_array_var anInitIDs = new SMESH::long_array();
+            SMESH::long_array_var anNewIDs = new SMESH::long_array();
+            SMESH::SMESH_Group_var aNewGroup;
+
+            SMESH::ElementType aGroupType;
+            CORBA::String_var aGroupName;
+            if ( theCommonGroups ) {
+              for(aGroupType=SMESH::NODE;aGroupType<=SMESH::VOLUME;aGroupType=(SMESH::ElementType)(aGroupType+1)) {
+                string str = "Gr";
+                SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, anInitMesh );
+                if(aMeshSObj)
+                  str += aMeshSObj->GetName();
+                str += "_";
+
+                int anLen = 0;
+
+                switch(aGroupType) {
+                case SMESH::NODE:
+                  str += "Nodes";
+                  anIDsNodes->length(anNbNodes);
+                  anLen = anNbNodes;
+                  break;
+                case SMESH::EDGE:
+                  str += "Edges";
+                  anIDsEdges->length(anNbEdges);
+                  anLen = anNbEdges;
+                  break;
+                case SMESH::FACE:
+                  str += "Faces";
+                  anIDsFaces->length(anNbFaces);
+                  anLen = anNbFaces;
+                  break;
+                case SMESH::VOLUME:
+                  str += "Volumes";
+                  anIDsVolumes->length(anNbVolumes);
+                  anLen = anNbVolumes;
+                  break;
+                default:
+                  break;
+                }
+
+                if(anLen) {
+                  aGroupName = str.c_str();
+
+                  // add a new group in the mesh
+                  aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
+
+                  switch(aGroupType) {
+                  case SMESH::NODE:
+                    aNewGroup->Add( anIDsNodes );
+                    break;
+                  case SMESH::EDGE:
+                    aNewGroup->Add( anIDsEdges );
+                    break;
+                  case SMESH::FACE:
+                    aNewGroup->Add( anIDsFaces );
+                    break;
+                  case SMESH::VOLUME:
+                    aNewGroup->Add( anIDsVolumes );
+                    break;
+                  default:
+                    break;
+                  }
+                
+                  aListOfNewGroups.clear();
+                  aListOfNewGroups.push_back(aNewGroup);
+                  aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups ));
+                }
+              }
+            }
+
+            // check that current group name and type don't have identical ones in union mesh
+            for (int i = 0; i < aListOfGroups->length(); i++) {
+              aGroup = aListOfGroups[i];
+              aListOfNewGroups.clear();
+              aGroupType = aGroup->GetType();
+              aGroupName = aGroup->GetName();
+
+              TGroupsMap::iterator anIter = aGroupsMap.find(make_pair(aGroupName, aGroupType));
+
+              // convert a list of IDs
+              anInitIDs = aGroup->GetListOfID();
+              anNewIDs->length(anInitIDs->length());
+              if ( aGroupType == SMESH::NODE )
+                for (int j = 0; j < anInitIDs->length(); j++) {
+                  anNewIDs[j] = nodesMap.find(anInitIDs[j])->second;
+                }
+              else
+                for (int j = 0; j < anInitIDs->length(); j++) {
+                  anNewIDs[j] = elemsMap.find(anInitIDs[j])->second;
+                }
+              
+              // check that current group name and type don't have identical ones in union mesh
+              if ( anIter == aGroupsMap.end() ) {
+                // add a new group in the mesh
+                aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
+                // add elements into new group
+                aNewGroup->Add( anNewIDs );
+                
+                aListOfNewGroups.push_back(aNewGroup);
+                aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups ));
+              }
+
+              else if ( theUniteIdenticalGroups ) {
+                // unite identical groups
+                TListOfNewGroups& aNewGroups = anIter->second;
+                aNewGroups.front()->Add( anNewIDs );
+              }
+
+              else {
+                // rename identical groups
+                aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
+                aNewGroup->Add( anNewIDs );
+                
+                TListOfNewGroups& aNewGroups = anIter->second;
+                string aNewGroupName;
+                if (aNewGroups.size() == 1) {
+                  aNewGroupName = string(aGroupName) + "_1";
+                  aNewGroups.front()->SetName(aNewGroupName.c_str());
+                }
+                char aGroupNum[128];
+                sprintf(aGroupNum, "%u", aNewGroups.size()+1);
+                aNewGroupName = string(aGroupName) + "_" + string(aGroupNum);
+                aNewGroup->SetName(aNewGroupName.c_str());
+                aNewGroups.push_back(aNewGroup);
+              }
+            }//groups loop
+          }
+        }
       }//meshes loop
 
       if (theMergeNodesAndElements) {
-       // merge nodes
-       set<const SMDS_MeshNode*> aMeshNodes; // no input nodes
-       SMESH_MeshEditor::TListOfListOfNodes aGroupsOfNodes;
-       aNewEditor.FindCoincidentNodes( aMeshNodes, theMergeTolerance, aGroupsOfNodes );
-       aNewEditor.MergeNodes( aGroupsOfNodes );
-       // merge elements
-       aNewEditor.MergeEqualElements();
+        // merge nodes
+        set<const SMDS_MeshNode*> aMeshNodes; // no input nodes
+        SMESH_MeshEditor::TListOfListOfNodes aGroupsOfNodes;
+        aNewEditor.FindCoincidentNodes( aMeshNodes, theMergeTolerance, aGroupsOfNodes );
+        aNewEditor.MergeNodes( aGroupsOfNodes );
+        // merge elements
+        aNewEditor.MergeEqualElements();
       }
     }
   }
@@ -2146,9 +2147,27 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
   }
   aPythonDump << "], ";
   aPythonDump << theUniteIdenticalGroups << ", "
-             << theMergeNodesAndElements << ", "
+              << theMergeNodesAndElements << ", "
               << theMergeTolerance << ")";
 
+  delete pPythonDump; // enable python dump from GetGroups()
+
+  // 0020577: EDF 1164 SMESH: Bad dump of concatenate with create common groups
+  if ( !aNewMesh->_is_nil() )
+  {
+    SMESH::ListOfGroups_var groups = aNewMesh->GetGroups();
+  }
+
+  // IPAL21468 Change icon of compound because it need not be computed.
+  SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, aNewMesh );
+  if( !aMeshSObj->_is_nil() ) {
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::StudyBuilder_var aBuilder = myCurrentStudy->NewBuilder();
+    anAttr = aBuilder->FindOrCreateAttribute( aMeshSObj,"AttributePixMap" );
+    SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+    aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
+  }
+
   return aNewMesh._retn();
 }
 
@@ -2411,17 +2430,17 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
             aDataset->WriteOnDisk( ( char* )( strHasData.c_str() ) );
             aDataset->CloseOnDisk();
 
-           // ouv : NPAL12872
+            // ouv : NPAL12872
             // for each mesh open the HDF group basing on its auto color parameter
-           char meshAutoColorName[ 30 ];
-           sprintf( meshAutoColorName, "AutoColorMesh %d", id );
-           int anAutoColor[1];
-           anAutoColor[0] = myImpl->GetAutoColor();
-           aSize[ 0 ] = 1;
-           aDataset = new HDFdataset( meshAutoColorName, aTopGroup, HDF_INT32, aSize, 1 );
-           aDataset->CreateOnDisk();
-           aDataset->WriteOnDisk( anAutoColor );
-           aDataset->CloseOnDisk();
+            char meshAutoColorName[ 30 ];
+            sprintf( meshAutoColorName, "AutoColorMesh %d", id );
+            int anAutoColor[1];
+            anAutoColor[0] = myImpl->GetAutoColor();
+            aSize[ 0 ] = 1;
+            aDataset = new HDFdataset( meshAutoColorName, aTopGroup, HDF_INT32, aSize, 1 );
+            aDataset->CreateOnDisk();
+            aDataset->WriteOnDisk( anAutoColor );
+            aDataset->CloseOnDisk();
 
             // write reference on a shape if exists
             SALOMEDS::SObject_var myRef;
@@ -2705,328 +2724,328 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
             //if ( shapeRefFound )
             //myWriter.AddAllSubMeshes();
 
-           // groups root sub-branch
-           SALOMEDS::SObject_var myGroupsBranch;
-           for ( int i = GetNodeGroupsTag(); i <= GetVolumeGroupsTag(); i++ ) {
-             found = gotBranch->FindSubObject( i, myGroupsBranch );
-             if ( found ) {
-               char name_group[ 30 ];
-               if ( i == GetNodeGroupsTag() )
-                 strcpy( name_group, "Groups of Nodes" );
-               else if ( i == GetEdgeGroupsTag() )
-                 strcpy( name_group, "Groups of Edges" );
-               else if ( i == GetFaceGroupsTag() )
-                 strcpy( name_group, "Groups of Faces" );
-               else if ( i == GetVolumeGroupsTag() )
-                 strcpy( name_group, "Groups of Volumes" );
-
-               aGroup = new HDFgroup( name_group, aTopGroup );
-               aGroup->CreateOnDisk();
-
-               SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( myGroupsBranch );
-               for ( ; it->More(); it->Next() ) {
-                 SALOMEDS::SObject_var mySObject = it->Value();
-                 CORBA::Object_var aSubObject = SObjectToObject( mySObject );
-                 if ( !CORBA::is_nil( aSubObject ) ) {
-                   SMESH_GroupBase_i* myGroupImpl =
-                     dynamic_cast<SMESH_GroupBase_i*>( GetServant( aSubObject ).in() );
-                   if ( !myGroupImpl )
-                     continue;
-                   
-                   CORBA::String_var objStr = GetORB()->object_to_string( aSubObject );
-                   int anId = myStudyContext->findId( string( objStr.in() ) );
-                   
-                   // For each group, create a dataset named "Group <group_persistent_id>"
-                   // and store the group's user name into it
-                   char grpName[ 30 ];
-                   sprintf( grpName, "Group %d", anId );
-                   char* aUserName = myGroupImpl->GetName();
-                   aSize[ 0 ] = strlen( aUserName ) + 1;
-                   
-                   aDataset = new HDFdataset( grpName, aGroup, HDF_STRING, aSize, 1 );
-                   aDataset->CreateOnDisk();
-                   aDataset->WriteOnDisk( aUserName );
-                   aDataset->CloseOnDisk();
-
-                   // ouv : NPAL12872
-                   // For each group, create a dataset named "Group <group_persistent_id> Color"
-                   // and store the group's color into it
-                   char grpColorName[ 30 ];
-                   sprintf( grpColorName, "ColorGroup %d", anId );
-                   SALOMEDS::Color aColor = myGroupImpl->GetColor();
-                   double anRGB[3];
-                   anRGB[ 0 ] = aColor.R;
-                   anRGB[ 1 ] = aColor.G;
-                   anRGB[ 2 ] = aColor.B;
-                   aSize[ 0 ] = 3;
-                   aDataset = new HDFdataset( grpColorName, aGroup, HDF_FLOAT64, aSize, 1 );
-                   aDataset->CreateOnDisk();
-                   aDataset->WriteOnDisk( anRGB );
-                   aDataset->CloseOnDisk();
-
-                   // Store the group contents into MED file
-                   if ( myLocMesh.GetGroup( myGroupImpl->GetLocalID() ) ) {
-                     
-                     if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen_i::Save(): saving group with StoreName = "
-                                         << grpName << " to MED file" );
-                     SMESHDS_GroupBase* aGrpBaseDS =
-                       myLocMesh.GetGroup( myGroupImpl->GetLocalID() )->GetGroupDS();
-                     aGrpBaseDS->SetStoreName( grpName );
-
-                     // Pass SMESHDS_Group to MED writer 
-                     SMESHDS_Group* aGrpDS = dynamic_cast<SMESHDS_Group*>( aGrpBaseDS );
-                     if ( aGrpDS )
-                       myWriter.AddGroup( aGrpDS );
-                     
-                     // write reference on a shape if exists
-                     SMESHDS_GroupOnGeom* aGeomGrp =
-                       dynamic_cast<SMESHDS_GroupOnGeom*>( aGrpBaseDS );
-                     if ( aGeomGrp ) {
-                       SALOMEDS::SObject_var mySubRef, myShape;
-                       if (mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef ) &&
-                           mySubRef->ReferencedObject( myShape ) &&
-                           !CORBA::is_nil( myShape->GetObject() ))
-                       {
-                         string myRefOnObject = myShape->GetID();
-                         if ( myRefOnObject.length() > 0 ) {
-                           char aRefName[ 30 ];
-                           sprintf( aRefName, "Ref on shape %d", anId);
-                           aSize[ 0 ] = myRefOnObject.length() + 1;
-                           aDataset = new HDFdataset(aRefName, aGroup, HDF_STRING, aSize, 1);
-                           aDataset->CreateOnDisk();
-                           aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) );
-                           aDataset->CloseOnDisk();
-                         }
-                       }
-                       else // shape ref is invalid:
-                       {
-                         // save a group on geometry as ordinary group
-                         myWriter.AddGroup( aGeomGrp );
-                       }
-                     }
-                   }
-                 }
-               }
-               aGroup->CloseOnDisk();
-             }
-           } // loop on groups 
-           
-           if ( strcmp( strHasData.c_str(), "1" ) == 0 )
-           {
-             // Flush current mesh information into MED file
-             myWriter.Perform();
-             
-             // maybe a shape was deleted in the study
-             if ( !shapeRefFound && !mySMESHDSMesh->ShapeToMesh().IsNull() && hasShape) {
-               TopoDS_Shape nullShape;
-               myLocMesh.ShapeToMesh( nullShape ); // remove shape referring data
-             }
-             
-             if ( !mySMESHDSMesh->SubMeshes().empty() )
-             {
-               // Store submeshes
-               // ----------------
-               aGroup = new HDFgroup( "Submeshes", aTopGroup );
-               aGroup->CreateOnDisk();
-               
-               // each element belongs to one or none submesh,
-               // so for each node/element, we store a submesh ID
-               
-               // Make maps of submesh IDs of elements sorted by element IDs
-               typedef int TElemID;
-               typedef int TSubMID;
-               map< TElemID, TSubMID > eId2smId, nId2smId;
-               map< TElemID, TSubMID >::iterator hint; // insertion to map is done before hint
-               const map<int,SMESHDS_SubMesh*>& aSubMeshes = mySMESHDSMesh->SubMeshes();
-               map<int,SMESHDS_SubMesh*>::const_iterator itSubM ( aSubMeshes.begin() );
-               SMDS_NodeIteratorPtr itNode;
-               SMDS_ElemIteratorPtr itElem;
-               for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ )
-               {
-                 TSubMID          aSubMeID = itSubM->first;
-                 SMESHDS_SubMesh* aSubMesh = itSubM->second;
-                 if ( aSubMesh->IsComplexSubmesh() )
-                   continue; // submesh containing other submeshs
-                 // nodes
-                 hint = nId2smId.begin(); // optimize insertion basing on increasing order of elem Ids in submesh
-                 for ( itNode = aSubMesh->GetNodes(); itNode->more(); ++hint)
-                   hint = nId2smId.insert( hint, make_pair( itNode->next()->GetID(), aSubMeID ));
+            // groups root sub-branch
+            SALOMEDS::SObject_var myGroupsBranch;
+            for ( int i = GetNodeGroupsTag(); i <= GetVolumeGroupsTag(); i++ ) {
+              found = gotBranch->FindSubObject( i, myGroupsBranch );
+              if ( found ) {
+                char name_group[ 30 ];
+                if ( i == GetNodeGroupsTag() )
+                  strcpy( name_group, "Groups of Nodes" );
+                else if ( i == GetEdgeGroupsTag() )
+                  strcpy( name_group, "Groups of Edges" );
+                else if ( i == GetFaceGroupsTag() )
+                  strcpy( name_group, "Groups of Faces" );
+                else if ( i == GetVolumeGroupsTag() )
+                  strcpy( name_group, "Groups of Volumes" );
+
+                aGroup = new HDFgroup( name_group, aTopGroup );
+                aGroup->CreateOnDisk();
+
+                SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( myGroupsBranch );
+                for ( ; it->More(); it->Next() ) {
+                  SALOMEDS::SObject_var mySObject = it->Value();
+                  CORBA::Object_var aSubObject = SObjectToObject( mySObject );
+                  if ( !CORBA::is_nil( aSubObject ) ) {
+                    SMESH_GroupBase_i* myGroupImpl =
+                      dynamic_cast<SMESH_GroupBase_i*>( GetServant( aSubObject ).in() );
+                    if ( !myGroupImpl )
+                      continue;
+                    
+                    CORBA::String_var objStr = GetORB()->object_to_string( aSubObject );
+                    int anId = myStudyContext->findId( string( objStr.in() ) );
+                    
+                    // For each group, create a dataset named "Group <group_persistent_id>"
+                    // and store the group's user name into it
+                    char grpName[ 30 ];
+                    sprintf( grpName, "Group %d", anId );
+                    char* aUserName = myGroupImpl->GetName();
+                    aSize[ 0 ] = strlen( aUserName ) + 1;
+                    
+                    aDataset = new HDFdataset( grpName, aGroup, HDF_STRING, aSize, 1 );
+                    aDataset->CreateOnDisk();
+                    aDataset->WriteOnDisk( aUserName );
+                    aDataset->CloseOnDisk();
+
+                    // ouv : NPAL12872
+                    // For each group, create a dataset named "Group <group_persistent_id> Color"
+                    // and store the group's color into it
+                    char grpColorName[ 30 ];
+                    sprintf( grpColorName, "ColorGroup %d", anId );
+                    SALOMEDS::Color aColor = myGroupImpl->GetColor();
+                    double anRGB[3];
+                    anRGB[ 0 ] = aColor.R;
+                    anRGB[ 1 ] = aColor.G;
+                    anRGB[ 2 ] = aColor.B;
+                    aSize[ 0 ] = 3;
+                    aDataset = new HDFdataset( grpColorName, aGroup, HDF_FLOAT64, aSize, 1 );
+                    aDataset->CreateOnDisk();
+                    aDataset->WriteOnDisk( anRGB );
+                    aDataset->CloseOnDisk();
+
+                    // Store the group contents into MED file
+                    if ( myLocMesh.GetGroup( myGroupImpl->GetLocalID() ) ) {
+                      
+                      if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen_i::Save(): saving group with StoreName = "
+                                          << grpName << " to MED file" );
+                      SMESHDS_GroupBase* aGrpBaseDS =
+                        myLocMesh.GetGroup( myGroupImpl->GetLocalID() )->GetGroupDS();
+                      aGrpBaseDS->SetStoreName( grpName );
+
+                      // Pass SMESHDS_Group to MED writer 
+                      SMESHDS_Group* aGrpDS = dynamic_cast<SMESHDS_Group*>( aGrpBaseDS );
+                      if ( aGrpDS )
+                        myWriter.AddGroup( aGrpDS );
+                      
+                      // write reference on a shape if exists
+                      SMESHDS_GroupOnGeom* aGeomGrp =
+                        dynamic_cast<SMESHDS_GroupOnGeom*>( aGrpBaseDS );
+                      if ( aGeomGrp ) {
+                        SALOMEDS::SObject_var mySubRef, myShape;
+                        if (mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef ) &&
+                            mySubRef->ReferencedObject( myShape ) &&
+                            !CORBA::is_nil( myShape->GetObject() ))
+                        {
+                          string myRefOnObject = myShape->GetID();
+                          if ( myRefOnObject.length() > 0 ) {
+                            char aRefName[ 30 ];
+                            sprintf( aRefName, "Ref on shape %d", anId);
+                            aSize[ 0 ] = myRefOnObject.length() + 1;
+                            aDataset = new HDFdataset(aRefName, aGroup, HDF_STRING, aSize, 1);
+                            aDataset->CreateOnDisk();
+                            aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) );
+                            aDataset->CloseOnDisk();
+                          }
+                        }
+                        else // shape ref is invalid:
+                        {
+                          // save a group on geometry as ordinary group
+                          myWriter.AddGroup( aGeomGrp );
+                        }
+                      }
+                    }
+                  }
+                }
+                aGroup->CloseOnDisk();
+              }
+            } // loop on groups 
+            
+            if ( strcmp( strHasData.c_str(), "1" ) == 0 )
+            {
+              // Flush current mesh information into MED file
+              myWriter.Perform();
+              
+              // maybe a shape was deleted in the study
+              if ( !shapeRefFound && !mySMESHDSMesh->ShapeToMesh().IsNull() && hasShape) {
+                TopoDS_Shape nullShape;
+                myLocMesh.ShapeToMesh( nullShape ); // remove shape referring data
+              }
+              
+              if ( !mySMESHDSMesh->SubMeshes().empty() )
+              {
+                // Store submeshes
+                // ----------------
+                aGroup = new HDFgroup( "Submeshes", aTopGroup );
+                aGroup->CreateOnDisk();
+                
+                // each element belongs to one or none submesh,
+                // so for each node/element, we store a submesh ID
+                
+                // Make maps of submesh IDs of elements sorted by element IDs
+                typedef int TElemID;
+                typedef int TSubMID;
+                map< TElemID, TSubMID > eId2smId, nId2smId;
+                map< TElemID, TSubMID >::iterator hint; // insertion to map is done before hint
+                const map<int,SMESHDS_SubMesh*>& aSubMeshes = mySMESHDSMesh->SubMeshes();
+                map<int,SMESHDS_SubMesh*>::const_iterator itSubM ( aSubMeshes.begin() );
+                SMDS_NodeIteratorPtr itNode;
+                SMDS_ElemIteratorPtr itElem;
+                for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ )
+                {
+                  TSubMID          aSubMeID = itSubM->first;
+                  SMESHDS_SubMesh* aSubMesh = itSubM->second;
+                  if ( aSubMesh->IsComplexSubmesh() )
+                    continue; // submesh containing other submeshs
+                  // nodes
+                  hint = nId2smId.begin(); // optimize insertion basing on increasing order of elem Ids in submesh
+                  for ( itNode = aSubMesh->GetNodes(); itNode->more(); ++hint)
+                    hint = nId2smId.insert( hint, make_pair( itNode->next()->GetID(), aSubMeID ));
                   // elements
-                 hint = eId2smId.begin();
-                 for ( itElem = aSubMesh->GetElements(); itElem->more(); ++hint)
-                   hint = eId2smId.insert( hint, make_pair( itElem->next()->GetID(), aSubMeID ));
-               }
-               
-               // Care of elements that are not on submeshes
-               if ( mySMESHDSMesh->NbNodes() != nId2smId.size() ) {
-                 for ( itNode = mySMESHDSMesh->nodesIterator(); itNode->more(); )
-                   /*  --- stl_map.h says : */
-                   /*  A %map relies on unique keys and thus a %pair is only inserted if its */
-                   /*  first element (the key) is not already present in the %map.           */
-                   nId2smId.insert( make_pair( itNode->next()->GetID(), 0 ));
-               }
-               int nbElems = mySMESHDSMesh->NbEdges() + mySMESHDSMesh->NbFaces() + mySMESHDSMesh->NbVolumes();
-               if ( nbElems != eId2smId.size() ) {
-                 for ( itElem = mySMESHDSMesh->elementsIterator(); itElem->more(); )
-                   eId2smId.insert( make_pair( itElem->next()->GetID(), 0 ));
-               }
-               
-               // Store submesh IDs
-               for ( int isNode = 0; isNode < 2; ++isNode )
-               {
-                 map< TElemID, TSubMID >& id2smId = isNode ? nId2smId : eId2smId;
-                 if ( id2smId.empty() ) continue;
-                 map< TElemID, TSubMID >::const_iterator id_smId = id2smId.begin();
-                 // make and fill array of submesh IDs
-                 int* smIDs = new int [ id2smId.size() ];
-                 for ( int i = 0; id_smId != id2smId.end(); ++id_smId, ++i )
-                   smIDs[ i ] = id_smId->second;
-                 // write HDF group
-                 aSize[ 0 ] = id2smId.size();
-                 string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
-                 aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 );
-                 aDataset->CreateOnDisk();
-                 aDataset->WriteOnDisk( smIDs );
-                 aDataset->CloseOnDisk();
-                 //
-                 delete smIDs;
-               }
+                  hint = eId2smId.begin();
+                  for ( itElem = aSubMesh->GetElements(); itElem->more(); ++hint)
+                    hint = eId2smId.insert( hint, make_pair( itElem->next()->GetID(), aSubMeID ));
+                }
+                
+                // Care of elements that are not on submeshes
+                if ( mySMESHDSMesh->NbNodes() != nId2smId.size() ) {
+                  for ( itNode = mySMESHDSMesh->nodesIterator(); itNode->more(); )
+                    /*  --- stl_map.h says : */
+                    /*  A %map relies on unique keys and thus a %pair is only inserted if its */
+                    /*  first element (the key) is not already present in the %map.           */
+                    nId2smId.insert( make_pair( itNode->next()->GetID(), 0 ));
+                }
+                int nbElems = mySMESHDSMesh->NbEdges() + mySMESHDSMesh->NbFaces() + mySMESHDSMesh->NbVolumes();
+                if ( nbElems != eId2smId.size() ) {
+                  for ( itElem = mySMESHDSMesh->elementsIterator(); itElem->more(); )
+                    eId2smId.insert( make_pair( itElem->next()->GetID(), 0 ));
+                }
+                
+                // Store submesh IDs
+                for ( int isNode = 0; isNode < 2; ++isNode )
+                {
+                  map< TElemID, TSubMID >& id2smId = isNode ? nId2smId : eId2smId;
+                  if ( id2smId.empty() ) continue;
+                  map< TElemID, TSubMID >::const_iterator id_smId = id2smId.begin();
+                  // make and fill array of submesh IDs
+                  int* smIDs = new int [ id2smId.size() ];
+                  for ( int i = 0; id_smId != id2smId.end(); ++id_smId, ++i )
+                    smIDs[ i ] = id_smId->second;
+                  // write HDF group
+                  aSize[ 0 ] = id2smId.size();
+                  string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
+                  aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 );
+                  aDataset->CreateOnDisk();
+                  aDataset->WriteOnDisk( smIDs );
+                  aDataset->CloseOnDisk();
+                  //
+                  delete smIDs;
+                }
+                
+                // Store node positions on sub-shapes (SMDS_Position):
+                // ----------------------------------------------------
+                
+                aGroup = new HDFgroup( "Node Positions", aTopGroup );
+                aGroup->CreateOnDisk();
+                
+                // in aGroup, create 5 datasets to contain:
+                // "Nodes on Edges" - ID of node on edge
+                // "Edge positions" - U parameter on node on edge
+                // "Nodes on Faces" - ID of node on face
+                // "Face U positions" - U parameter of node on face
+                // "Face V positions" - V parameter of node on face
                 
-               // Store node positions on sub-shapes (SMDS_Position):
-               // ----------------------------------------------------
-               
-               aGroup = new HDFgroup( "Node Positions", aTopGroup );
-               aGroup->CreateOnDisk();
-               
-               // in aGroup, create 5 datasets to contain:
-               // "Nodes on Edges" - ID of node on edge
-               // "Edge positions" - U parameter on node on edge
-               // "Nodes on Faces" - ID of node on face
-               // "Face U positions" - U parameter of node on face
-               // "Face V positions" - V parameter of node on face
-               
-               // Find out nb of nodes on edges and faces
-               // Collect corresponing sub-meshes
-               int nbEdgeNodes = 0, nbFaceNodes = 0;
-               list<SMESHDS_SubMesh*> aEdgeSM, aFaceSM;
-               // loop on SMESHDS_SubMesh'es
-               for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ )
-               {
-                 SMESHDS_SubMesh* aSubMesh = (*itSubM).second;
-                 if ( aSubMesh->IsComplexSubmesh() )
-                   continue; // submesh containing other submeshs
-                 int nbNodes = aSubMesh->NbNodes();
-                 if ( nbNodes == 0 ) continue;
-                 
-                 int aShapeID = (*itSubM).first;
-                 int aShapeType = mySMESHDSMesh->IndexToShape( aShapeID ).ShapeType();
-                 // write only SMDS_FacePosition and SMDS_EdgePosition
-                 switch ( aShapeType ) {
-                 case TopAbs_FACE:
-                   nbFaceNodes += nbNodes;
-                   aFaceSM.push_back( aSubMesh );
-                   break;
-                 case TopAbs_EDGE:
-                   nbEdgeNodes += nbNodes;
-                   aEdgeSM.push_back( aSubMesh );
-                   break;
-                 default:
-                   continue;
-                 }
-               }
-               // Treat positions on edges or faces
-               for ( int onFace = 0; onFace < 2; onFace++ )
-               {
-                 // Create arrays to store in datasets
-                 int iNode = 0, nbNodes = ( onFace ? nbFaceNodes : nbEdgeNodes );
-                 if (!nbNodes) continue;
-                 int* aNodeIDs = new int [ nbNodes ];
-                 double* aUPos = new double [ nbNodes ];
-                 double* aVPos = ( onFace ? new double[ nbNodes ] : 0 );
-                 
-                 // Fill arrays
-                 // loop on sub-meshes
-                 list<SMESHDS_SubMesh*> * pListSM = ( onFace ? &aFaceSM : &aEdgeSM );
-                 list<SMESHDS_SubMesh*>::iterator itSM = pListSM->begin();
-                 for ( ; itSM != pListSM->end(); itSM++ )
-                 {
-                   SMESHDS_SubMesh* aSubMesh = (*itSM);
-                   
-                   SMDS_NodeIteratorPtr itNode = aSubMesh->GetNodes();
-                   // loop on nodes in aSubMesh
-                   while ( itNode->more() )
-                   {
-                     //node ID
-                     const SMDS_MeshNode* node = itNode->next();
-                     aNodeIDs [ iNode ] = node->GetID();
-                     
-                     // Position
-                     const SMDS_PositionPtr pos = node->GetPosition();
-                     if ( onFace ) { // on FACE
-                       const SMDS_FacePosition* fPos =
-                         dynamic_cast<const SMDS_FacePosition*>( pos.get() );
-                       if ( fPos ) {
-                         aUPos[ iNode ] = fPos->GetUParameter();
-                         aVPos[ iNode ] = fPos->GetVParameter();
-                         iNode++;
-                       }
-                       else
-                         nbNodes--;
-                     }
-                     else { // on EDGE
-                       const SMDS_EdgePosition* ePos =
-                         dynamic_cast<const SMDS_EdgePosition*>( pos.get() );
-                       if ( ePos ) {
-                         aUPos[ iNode ] = ePos->GetUParameter();
-                         iNode++;
-                       }
-                       else
-                         nbNodes--;
-                     }
-                   } // loop on nodes in aSubMesh
-                 } // loop on sub-meshes
-                 
-                 // Write datasets
-                 if ( nbNodes )
-                 {
-                   aSize[ 0 ] = nbNodes;
-                   // IDS
-                   string aDSName( onFace ? "Nodes on Faces" : "Nodes on Edges");
-                   aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 );
-                   aDataset->CreateOnDisk();
-                   aDataset->WriteOnDisk( aNodeIDs );
-                   aDataset->CloseOnDisk();
-               
-                   // U Positions
-                   aDSName = ( onFace ? "Face U positions" : "Edge positions");
-                   aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_FLOAT64, aSize, 1);
-                   aDataset->CreateOnDisk();
-                   aDataset->WriteOnDisk( aUPos );
-                   aDataset->CloseOnDisk();
-                   // V Positions
-                   if ( onFace ) {
-                     aDataset = new HDFdataset( "Face V positions", aGroup, HDF_FLOAT64, aSize, 1);
-                     aDataset->CreateOnDisk();
-                     aDataset->WriteOnDisk( aVPos );
-                     aDataset->CloseOnDisk();
-                   }
-                 }
-                 delete [] aNodeIDs;
-                 delete [] aUPos;
-                 if ( aVPos ) delete [] aVPos;
-                 
-               } // treat positions on edges or faces
-               
-               // close "Node Positions" group
-               aGroup->CloseOnDisk(); 
-               
-             } // if ( there are submeshes in SMESHDS_Mesh )
-           } // if ( hasData )
-           
-           // close mesh HDF group
-           aTopGroup->CloseOnDisk();
-         }
-       }
+                // Find out nb of nodes on edges and faces
+                // Collect corresponing sub-meshes
+                int nbEdgeNodes = 0, nbFaceNodes = 0;
+                list<SMESHDS_SubMesh*> aEdgeSM, aFaceSM;
+                // loop on SMESHDS_SubMesh'es
+                for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ )
+                {
+                  SMESHDS_SubMesh* aSubMesh = (*itSubM).second;
+                  if ( aSubMesh->IsComplexSubmesh() )
+                    continue; // submesh containing other submeshs
+                  int nbNodes = aSubMesh->NbNodes();
+                  if ( nbNodes == 0 ) continue;
+                  
+                  int aShapeID = (*itSubM).first;
+                  int aShapeType = mySMESHDSMesh->IndexToShape( aShapeID ).ShapeType();
+                  // write only SMDS_FacePosition and SMDS_EdgePosition
+                  switch ( aShapeType ) {
+                  case TopAbs_FACE:
+                    nbFaceNodes += nbNodes;
+                    aFaceSM.push_back( aSubMesh );
+                    break;
+                  case TopAbs_EDGE:
+                    nbEdgeNodes += nbNodes;
+                    aEdgeSM.push_back( aSubMesh );
+                    break;
+                  default:
+                    continue;
+                  }
+                }
+                // Treat positions on edges or faces
+                for ( int onFace = 0; onFace < 2; onFace++ )
+                {
+                  // Create arrays to store in datasets
+                  int iNode = 0, nbNodes = ( onFace ? nbFaceNodes : nbEdgeNodes );
+                  if (!nbNodes) continue;
+                  int* aNodeIDs = new int [ nbNodes ];
+                  double* aUPos = new double [ nbNodes ];
+                  double* aVPos = ( onFace ? new double[ nbNodes ] : 0 );
+                  
+                  // Fill arrays
+                  // loop on sub-meshes
+                  list<SMESHDS_SubMesh*> * pListSM = ( onFace ? &aFaceSM : &aEdgeSM );
+                  list<SMESHDS_SubMesh*>::iterator itSM = pListSM->begin();
+                  for ( ; itSM != pListSM->end(); itSM++ )
+                  {
+                    SMESHDS_SubMesh* aSubMesh = (*itSM);
+                    
+                    SMDS_NodeIteratorPtr itNode = aSubMesh->GetNodes();
+                    // loop on nodes in aSubMesh
+                    while ( itNode->more() )
+                    {
+                      //node ID
+                      const SMDS_MeshNode* node = itNode->next();
+                      aNodeIDs [ iNode ] = node->GetID();
+                      
+                      // Position
+                      const SMDS_PositionPtr pos = node->GetPosition();
+                      if ( onFace ) { // on FACE
+                        const SMDS_FacePosition* fPos =
+                          dynamic_cast<const SMDS_FacePosition*>( pos.get() );
+                        if ( fPos ) {
+                          aUPos[ iNode ] = fPos->GetUParameter();
+                          aVPos[ iNode ] = fPos->GetVParameter();
+                          iNode++;
+                        }
+                        else
+                          nbNodes--;
+                      }
+                      else { // on EDGE
+                        const SMDS_EdgePosition* ePos =
+                          dynamic_cast<const SMDS_EdgePosition*>( pos.get() );
+                        if ( ePos ) {
+                          aUPos[ iNode ] = ePos->GetUParameter();
+                          iNode++;
+                        }
+                        else
+                          nbNodes--;
+                      }
+                    } // loop on nodes in aSubMesh
+                  } // loop on sub-meshes
+                  
+                  // Write datasets
+                  if ( nbNodes )
+                  {
+                    aSize[ 0 ] = nbNodes;
+                    // IDS
+                    string aDSName( onFace ? "Nodes on Faces" : "Nodes on Edges");
+                    aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 );
+                    aDataset->CreateOnDisk();
+                    aDataset->WriteOnDisk( aNodeIDs );
+                    aDataset->CloseOnDisk();
+                
+                    // U Positions
+                    aDSName = ( onFace ? "Face U positions" : "Edge positions");
+                    aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_FLOAT64, aSize, 1);
+                    aDataset->CreateOnDisk();
+                    aDataset->WriteOnDisk( aUPos );
+                    aDataset->CloseOnDisk();
+                    // V Positions
+                    if ( onFace ) {
+                      aDataset = new HDFdataset( "Face V positions", aGroup, HDF_FLOAT64, aSize, 1);
+                      aDataset->CreateOnDisk();
+                      aDataset->WriteOnDisk( aVPos );
+                      aDataset->CloseOnDisk();
+                    }
+                  }
+                  delete [] aNodeIDs;
+                  delete [] aUPos;
+                  if ( aVPos ) delete [] aVPos;
+                  
+                } // treat positions on edges or faces
+                
+                // close "Node Positions" group
+                aGroup->CloseOnDisk(); 
+                
+              } // if ( there are submeshes in SMESHDS_Mesh )
+            } // if ( hasData )
+            
+            // close mesh HDF group
+            aTopGroup->CloseOnDisk();
+          }
+        }
       }
     }
   }
@@ -3055,8 +3074,8 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
 //=============================================================================
 
 SALOMEDS::TMPFile* SMESH_Gen_i::SaveASCII( SALOMEDS::SComponent_ptr theComponent,
-                                          const char*              theURL,
-                                          bool                     isMultiFile ) {
+                                           const char*              theURL,
+                                           bool                     isMultiFile ) {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::SaveASCII" );
   SALOMEDS::TMPFile_var aStreamFile = Save( theComponent, theURL, isMultiFile );
   return aStreamFile._retn();
@@ -3130,9 +3149,9 @@ private:
 //=============================================================================
 
 bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
-                       const SALOMEDS::TMPFile& theStream,
-                       const char*              theURL,
-                       bool                     isMultiFile )
+                        const SALOMEDS::TMPFile& theStream,
+                        const char*              theURL,
+                        bool                     isMultiFile )
 {
   INFOS( "SMESH_Gen_i::Load" );
 
@@ -3161,7 +3180,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
   // Convert the stream into sequence of files to process
   SALOMEDS::ListOfFileNames_var aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
                                                                             tmpDir.ToCString(),
-                                                                           isMultiFile );
+                                                                            isMultiFile );
   TCollection_AsciiString aStudyName( "" );
   if ( isMultiFile ) 
     aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( myCurrentStudy->URL() ).c_str() );
@@ -3217,88 +3236,88 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
       // get number of hypotheses
       int aNbObjects = aTopGroup->nInternalObjects(); 
       for ( int j = 0; j < aNbObjects; j++ ) {
-       // try to identify hypothesis
-       char hypGrpName[ HDF_NAME_MAX_LEN+1 ];
+        // try to identify hypothesis
+        char hypGrpName[ HDF_NAME_MAX_LEN+1 ];
         aTopGroup->InternalObjectIndentify( j, hypGrpName );
 
-       if ( string( hypGrpName ).substr( 0, 10 ) == string( "Hypothesis" ) ) {
-         // open hypothesis group
-         aGroup = new HDFgroup( hypGrpName, aTopGroup ); 
-         aGroup->OpenOnDisk();
-
-         // --> get hypothesis id
-         int    id = atoi( string( hypGrpName ).substr( 10 ).c_str() );
-         string hypname;
-         string libname;
-         string hypdata;
-
-         // get number of datasets
-         int aNbSubObjects = aGroup->nInternalObjects();
-         for ( int k = 0; k < aNbSubObjects; k++ ) {
-           // identify dataset
-           char name_of_subgroup[ HDF_NAME_MAX_LEN+1 ];
-           aGroup->InternalObjectIndentify( k, name_of_subgroup );
-           // --> get hypothesis name
-           if ( strcmp( name_of_subgroup, "Name"  ) == 0 ) {
-             aDataset = new HDFdataset( name_of_subgroup, aGroup );
-             aDataset->OpenOnDisk();
-             size = aDataset->GetSize();
-             char* hypname_str = new char[ size ];
-             aDataset->ReadFromDisk( hypname_str );
-             hypname = string( hypname_str );
-             delete [] hypname_str;
-             aDataset->CloseOnDisk();
-           }
-           // --> get hypothesis plugin library name
-           if ( strcmp( name_of_subgroup, "LibName"  ) == 0 ) {
-             aDataset = new HDFdataset( name_of_subgroup, aGroup );
-             aDataset->OpenOnDisk();
-             size = aDataset->GetSize();
-             char* libname_str = new char[ size ];
-             aDataset->ReadFromDisk( libname_str );
-             if(MYDEBUG) SCRUTE( libname_str );
-             libname = string( libname_str );
-             delete [] libname_str;
-             aDataset->CloseOnDisk();
-           }
-           // --> get hypothesis data
-           if ( strcmp( name_of_subgroup, "Data"  ) == 0 ) {
-             aDataset = new HDFdataset( name_of_subgroup, aGroup );
-             aDataset->OpenOnDisk();
-             size = aDataset->GetSize();
-             char* hypdata_str = new char[ size ];
-             aDataset->ReadFromDisk( hypdata_str );
-             hypdata = string( hypdata_str );
-             delete [] hypdata_str;
-             aDataset->CloseOnDisk();
-           }
-         }
-         // close hypothesis HDF group
-         aGroup->CloseOnDisk();
-
-         // --> restore hypothesis from data
-         if ( id > 0 && !hypname.empty()/* && !hypdata.empty()*/ ) { // VSR : persistent data can be empty
-           if(MYDEBUG) MESSAGE("VSR - load hypothesis : id = " << id <<
+        if ( string( hypGrpName ).substr( 0, 10 ) == string( "Hypothesis" ) ) {
+          // open hypothesis group
+          aGroup = new HDFgroup( hypGrpName, aTopGroup ); 
+          aGroup->OpenOnDisk();
+
+          // --> get hypothesis id
+          int    id = atoi( string( hypGrpName ).substr( 10 ).c_str() );
+          string hypname;
+          string libname;
+          string hypdata;
+
+          // get number of datasets
+          int aNbSubObjects = aGroup->nInternalObjects();
+          for ( int k = 0; k < aNbSubObjects; k++ ) {
+            // identify dataset
+            char name_of_subgroup[ HDF_NAME_MAX_LEN+1 ];
+            aGroup->InternalObjectIndentify( k, name_of_subgroup );
+            // --> get hypothesis name
+            if ( strcmp( name_of_subgroup, "Name"  ) == 0 ) {
+              aDataset = new HDFdataset( name_of_subgroup, aGroup );
+              aDataset->OpenOnDisk();
+              size = aDataset->GetSize();
+              char* hypname_str = new char[ size ];
+              aDataset->ReadFromDisk( hypname_str );
+              hypname = string( hypname_str );
+              delete [] hypname_str;
+              aDataset->CloseOnDisk();
+            }
+            // --> get hypothesis plugin library name
+            if ( strcmp( name_of_subgroup, "LibName"  ) == 0 ) {
+              aDataset = new HDFdataset( name_of_subgroup, aGroup );
+              aDataset->OpenOnDisk();
+              size = aDataset->GetSize();
+              char* libname_str = new char[ size ];
+              aDataset->ReadFromDisk( libname_str );
+              if(MYDEBUG) SCRUTE( libname_str );
+              libname = string( libname_str );
+              delete [] libname_str;
+              aDataset->CloseOnDisk();
+            }
+            // --> get hypothesis data
+            if ( strcmp( name_of_subgroup, "Data"  ) == 0 ) {
+              aDataset = new HDFdataset( name_of_subgroup, aGroup );
+              aDataset->OpenOnDisk();
+              size = aDataset->GetSize();
+              char* hypdata_str = new char[ size ];
+              aDataset->ReadFromDisk( hypdata_str );
+              hypdata = string( hypdata_str );
+              delete [] hypdata_str;
+              aDataset->CloseOnDisk();
+            }
+          }
+          // close hypothesis HDF group
+          aGroup->CloseOnDisk();
+
+          // --> restore hypothesis from data
+          if ( id > 0 && !hypname.empty()/* && !hypdata.empty()*/ ) { // VSR : persistent data can be empty
+            if(MYDEBUG) MESSAGE("VSR - load hypothesis : id = " << id <<
                                 ", name = " << hypname.c_str() << ", persistent string = " << hypdata.c_str());
             SMESH::SMESH_Hypothesis_var myHyp;
 
-           try { // protect persistence mechanism against exceptions
-             myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() );
-           }
-           catch (...) {
-             INFOS( "Exception during hypothesis creation" );
-           }
+            try { // protect persistence mechanism against exceptions
+              myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() );
+            }
+            catch (...) {
+              INFOS( "Exception during hypothesis creation" );
+            }
 
-           SMESH_Hypothesis_i* myImpl = dynamic_cast<SMESH_Hypothesis_i*>( GetServant( myHyp ).in() );
-           if ( myImpl ) {
-             // myImpl->LoadFrom( hypdata.c_str() );
+            SMESH_Hypothesis_i* myImpl = dynamic_cast<SMESH_Hypothesis_i*>( GetServant( myHyp ).in() );
+            if ( myImpl ) {
+              // myImpl->LoadFrom( hypdata.c_str() );
               hypDataList.push_back( make_pair( myImpl, hypdata ));
-             string iorString = GetORB()->object_to_string( myHyp );
-             int newId = myStudyContext->findId( iorString );
-             myStudyContext->mapOldToNew( id, newId );
-           }
-           else
-             if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen::Load - can't get servant" );
+              string iorString = GetORB()->object_to_string( myHyp );
+              int newId = myStudyContext->findId( iorString );
+              myStudyContext->mapOldToNew( id, newId );
+            }
+            else
+              if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen::Load - can't get servant" );
           }
         }
       }
@@ -3316,89 +3335,89 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
       // get number of algorithms
       int aNbObjects = aTopGroup->nInternalObjects(); 
       for ( int j = 0; j < aNbObjects; j++ ) {
-       // try to identify algorithm
-       char hypGrpName[ HDF_NAME_MAX_LEN+1 ];
+        // try to identify algorithm
+        char hypGrpName[ HDF_NAME_MAX_LEN+1 ];
         aTopGroup->InternalObjectIndentify( j, hypGrpName );
 
-       if ( string( hypGrpName ).substr( 0, 9 ) == string( "Algorithm" ) ) {
-         // open algorithm group
-         aGroup = new HDFgroup( hypGrpName, aTopGroup ); 
-         aGroup->OpenOnDisk();
-
-         // --> get algorithm id
-         int    id = atoi( string( hypGrpName ).substr( 9 ).c_str() );
-         string hypname;
-         string libname;
-         string hypdata;
-
-         // get number of datasets
-         int aNbSubObjects = aGroup->nInternalObjects();
-         for ( int k = 0; k < aNbSubObjects; k++ ) {
-           // identify dataset
-           char name_of_subgroup[ HDF_NAME_MAX_LEN+1 ];
-           aGroup->InternalObjectIndentify( k, name_of_subgroup );
-           // --> get algorithm name
-           if ( strcmp( name_of_subgroup, "Name"  ) == 0 ) {
-             aDataset = new HDFdataset( name_of_subgroup, aGroup );
-             aDataset->OpenOnDisk();
-             size = aDataset->GetSize();
-             char* hypname_str = new char[ size ];
-             aDataset->ReadFromDisk( hypname_str );
-             hypname = string( hypname_str );
-             delete [] hypname_str;
-             aDataset->CloseOnDisk();
-           }
-           // --> get algorithm plugin library name
-           if ( strcmp( name_of_subgroup, "LibName"  ) == 0 ) {
-             aDataset = new HDFdataset( name_of_subgroup, aGroup );
-             aDataset->OpenOnDisk();
-             size = aDataset->GetSize();
-             char* libname_str = new char[ size ];
-             aDataset->ReadFromDisk( libname_str );
-             if(MYDEBUG) SCRUTE( libname_str );
-             libname = string( libname_str );
-             delete [] libname_str;
-             aDataset->CloseOnDisk();
-           }
-           // --> get algorithm data
-           if ( strcmp( name_of_subgroup, "Data"  ) == 0 ) {
-             aDataset = new HDFdataset( name_of_subgroup, aGroup );
-             aDataset->OpenOnDisk();
-             size = aDataset->GetSize();
-             char* hypdata_str = new char[ size ];
-             aDataset->ReadFromDisk( hypdata_str );
-             if(MYDEBUG) SCRUTE( hypdata_str );
-             hypdata = string( hypdata_str );
-             delete [] hypdata_str;
-             aDataset->CloseOnDisk();
-           }
-         }
-         // close algorithm HDF group
-         aGroup->CloseOnDisk();
-
-         // --> restore algorithm from data
-         if ( id > 0 && !hypname.empty()/* && !hypdata.empty()*/ ) { // VSR : persistent data can be empty
-           if(MYDEBUG) MESSAGE("VSR - load algo : id = " << id <<
+        if ( string( hypGrpName ).substr( 0, 9 ) == string( "Algorithm" ) ) {
+          // open algorithm group
+          aGroup = new HDFgroup( hypGrpName, aTopGroup ); 
+          aGroup->OpenOnDisk();
+
+          // --> get algorithm id
+          int    id = atoi( string( hypGrpName ).substr( 9 ).c_str() );
+          string hypname;
+          string libname;
+          string hypdata;
+
+          // get number of datasets
+          int aNbSubObjects = aGroup->nInternalObjects();
+          for ( int k = 0; k < aNbSubObjects; k++ ) {
+            // identify dataset
+            char name_of_subgroup[ HDF_NAME_MAX_LEN+1 ];
+            aGroup->InternalObjectIndentify( k, name_of_subgroup );
+            // --> get algorithm name
+            if ( strcmp( name_of_subgroup, "Name"  ) == 0 ) {
+              aDataset = new HDFdataset( name_of_subgroup, aGroup );
+              aDataset->OpenOnDisk();
+              size = aDataset->GetSize();
+              char* hypname_str = new char[ size ];
+              aDataset->ReadFromDisk( hypname_str );
+              hypname = string( hypname_str );
+              delete [] hypname_str;
+              aDataset->CloseOnDisk();
+            }
+            // --> get algorithm plugin library name
+            if ( strcmp( name_of_subgroup, "LibName"  ) == 0 ) {
+              aDataset = new HDFdataset( name_of_subgroup, aGroup );
+              aDataset->OpenOnDisk();
+              size = aDataset->GetSize();
+              char* libname_str = new char[ size ];
+              aDataset->ReadFromDisk( libname_str );
+              if(MYDEBUG) SCRUTE( libname_str );
+              libname = string( libname_str );
+              delete [] libname_str;
+              aDataset->CloseOnDisk();
+            }
+            // --> get algorithm data
+            if ( strcmp( name_of_subgroup, "Data"  ) == 0 ) {
+              aDataset = new HDFdataset( name_of_subgroup, aGroup );
+              aDataset->OpenOnDisk();
+              size = aDataset->GetSize();
+              char* hypdata_str = new char[ size ];
+              aDataset->ReadFromDisk( hypdata_str );
+              if(MYDEBUG) SCRUTE( hypdata_str );
+              hypdata = string( hypdata_str );
+              delete [] hypdata_str;
+              aDataset->CloseOnDisk();
+            }
+          }
+          // close algorithm HDF group
+          aGroup->CloseOnDisk();
+
+          // --> restore algorithm from data
+          if ( id > 0 && !hypname.empty()/* && !hypdata.empty()*/ ) { // VSR : persistent data can be empty
+            if(MYDEBUG) MESSAGE("VSR - load algo : id = " << id <<
                                 ", name = " << hypname.c_str() << ", persistent string = " << hypdata.c_str());
             SMESH::SMESH_Hypothesis_var myHyp;
 
-           try { // protect persistence mechanism against exceptions
-             myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() );
-           }
-           catch (...) {
-             INFOS( "Exception during hypothesis creation" );
-           }
+            try { // protect persistence mechanism against exceptions
+              myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() );
+            }
+            catch (...) {
+              INFOS( "Exception during hypothesis creation" );
+            }
 
-           SMESH_Hypothesis_i* myImpl = dynamic_cast<SMESH_Hypothesis_i*>( GetServant( myHyp ).in() );
-           if ( myImpl ) {
-             //myImpl->LoadFrom( hypdata.c_str() );
+            SMESH_Hypothesis_i* myImpl = dynamic_cast<SMESH_Hypothesis_i*>( GetServant( myHyp ).in() );
+            if ( myImpl ) {
+              //myImpl->LoadFrom( hypdata.c_str() );
               hypDataList.push_back( make_pair( myImpl, hypdata ));
-             string iorString = GetORB()->object_to_string( myHyp );
-             int newId = myStudyContext->findId( iorString );
-             myStudyContext->mapOldToNew( id, newId );
-           }
-           else
-             if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen::Load - can't get servant" );
+              string iorString = GetORB()->object_to_string( myHyp );
+              int newId = myStudyContext->findId( iorString );
+              myStudyContext->mapOldToNew( id, newId );
+            }
+            else
+              if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen::Load - can't get servant" );
           }
         }
       }
@@ -3414,44 +3433,44 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
       aFile->InternalObjectIndentify( i, meshName );
 
       if ( string( meshName ).substr( 0, 4 ) == string( "Mesh" ) ) {
-       // --> get mesh id
-       int id = atoi( string( meshName ).substr( 4 ).c_str() );
-       if ( id <= 0 )
-         continue;
-
-       // open mesh HDF group
-       aTopGroup = new HDFgroup( meshName, aFile ); 
-       aTopGroup->OpenOnDisk();
-
-       // get number of child HDF objects
-       int aNbObjects = aTopGroup->nInternalObjects(); 
-       if ( aNbObjects > 0 ) {
-         // create mesh
-         if(MYDEBUG) MESSAGE( "VSR - load mesh : id = " << id );
-         SMESH::SMESH_Mesh_var myNewMesh = this->createMesh();
-         SMESH_Mesh_i* myNewMeshImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( myNewMesh ).in() );
+        // --> get mesh id
+        int id = atoi( string( meshName ).substr( 4 ).c_str() );
+        if ( id <= 0 )
+          continue;
+
+        // open mesh HDF group
+        aTopGroup = new HDFgroup( meshName, aFile ); 
+        aTopGroup->OpenOnDisk();
+
+        // get number of child HDF objects
+        int aNbObjects = aTopGroup->nInternalObjects(); 
+        if ( aNbObjects > 0 ) {
+          // create mesh
+          if(MYDEBUG) MESSAGE( "VSR - load mesh : id = " << id );
+          SMESH::SMESH_Mesh_var myNewMesh = this->createMesh();
+          SMESH_Mesh_i* myNewMeshImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( myNewMesh ).in() );
           if ( !myNewMeshImpl )
-           continue;
+            continue;
           meshGroupList.push_back( make_pair( myNewMeshImpl, aTopGroup ));
 
-         string iorString = GetORB()->object_to_string( myNewMesh );
-         int newId = myStudyContext->findId( iorString );
-         myStudyContext->mapOldToNew( id, newId );
-
-         // ouv : NPAL12872
-         // try to read and set auto color flag
-         char aMeshAutoColorName[ 30 ];
-         sprintf( aMeshAutoColorName, "AutoColorMesh %d", id);
-         if( aTopGroup->ExistInternalObject( aMeshAutoColorName ) )
-         {
-           aDataset = new HDFdataset( aMeshAutoColorName, aTopGroup );
-           aDataset->OpenOnDisk();
-           size = aDataset->GetSize();
-           int* anAutoColor = new int[ size ];
-           aDataset->ReadFromDisk( anAutoColor );
-           aDataset->CloseOnDisk();
-           myNewMeshImpl->SetAutoColor( (bool)anAutoColor[0] );
-         }
+          string iorString = GetORB()->object_to_string( myNewMesh );
+          int newId = myStudyContext->findId( iorString );
+          myStudyContext->mapOldToNew( id, newId );
+
+          // ouv : NPAL12872
+          // try to read and set auto color flag
+          char aMeshAutoColorName[ 30 ];
+          sprintf( aMeshAutoColorName, "AutoColorMesh %d", id);
+          if( aTopGroup->ExistInternalObject( aMeshAutoColorName ) )
+          {
+            aDataset = new HDFdataset( aMeshAutoColorName, aTopGroup );
+            aDataset->OpenOnDisk();
+            size = aDataset->GetSize();
+            int* anAutoColor = new int[ size ];
+            aDataset->ReadFromDisk( anAutoColor );
+            aDataset->CloseOnDisk();
+            myNewMeshImpl->SetAutoColor( (bool)anAutoColor[0] );
+          }
 
           // try to read and set reference to shape
           GEOM::GEOM_Object_var aShapeObject;
@@ -4075,21 +4094,21 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
               SMESHDS_GroupBase* aGroupBaseDS = aLocalGroup->GetGroupDS();
               aGroupBaseDS->SetStoreName( name_dataset );
 
-             // ouv : NPAL12872
-             // Read color of the group
+              // ouv : NPAL12872
+              // Read color of the group
               char aGroupColorName[ 30 ];
               sprintf( aGroupColorName, "ColorGroup %d", subid);
               if ( aGroup->ExistInternalObject( aGroupColorName ) )
-             {
-               aDataset = new HDFdataset( aGroupColorName, aGroup );
-               aDataset->OpenOnDisk();
-               size = aDataset->GetSize();
-               double* anRGB = new double[ size ];
-               aDataset->ReadFromDisk( anRGB );
-               aDataset->CloseOnDisk();
-               Quantity_Color aColor( anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB );
-               aGroupBaseDS->SetColor( aColor );
-             }
+              {
+                aDataset = new HDFdataset( aGroupColorName, aGroup );
+                aDataset->OpenOnDisk();
+                size = aDataset->GetSize();
+                double* anRGB = new double[ size ];
+                aDataset->ReadFromDisk( anRGB );
+                aDataset->CloseOnDisk();
+                Quantity_Color aColor( anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB );
+                aGroupBaseDS->SetColor( aColor );
+              }
 
               // Fill group with contents from MED file
               SMESHDS_Group* aGrp = dynamic_cast<SMESHDS_Group*>( aGroupBaseDS );
@@ -4126,9 +4145,9 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
 //=============================================================================
 
 bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent,
-                            const SALOMEDS::TMPFile& theStream,
-                            const char*              theURL,
-                            bool                     isMultiFile ) {
+                             const SALOMEDS::TMPFile& theStream,
+                             const char*              theURL,
+                             bool                     isMultiFile ) {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::LoadASCII" );
   return Load( theComponent, theStream, theURL, isMultiFile );
 
@@ -4197,6 +4216,7 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent )
 //     context->myDocument = 0;
 //   }
   
+  myCurrentStudy = SALOMEDS::Study::_nil();
   return;
 }
 
@@ -4224,9 +4244,9 @@ char* SMESH_Gen_i::ComponentDataType()
 //=============================================================================
 
 char* SMESH_Gen_i::IORToLocalPersistentID( SALOMEDS::SObject_ptr /*theSObject*/,
-                                          const char*           IORString,
-                                          CORBA::Boolean        /*isMultiFile*/,
-                                          CORBA::Boolean        /*isASCII*/ )
+                                           const char*           IORString,
+                                           CORBA::Boolean        /*isMultiFile*/,
+                                           CORBA::Boolean        /*isASCII*/ )
 {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::IORToLocalPersistentID" );
   StudyContext* myStudyContext = GetCurrentStudyContext();
@@ -4252,9 +4272,9 @@ char* SMESH_Gen_i::IORToLocalPersistentID( SALOMEDS::SObject_ptr /*theSObject*/,
 //=============================================================================
 
 char* SMESH_Gen_i::LocalPersistentIDToIOR( SALOMEDS::SObject_ptr /*theSObject*/,
-                                          const char*           aLocalPersistentID,
-                                          CORBA::Boolean        /*isMultiFile*/,
-                                          CORBA::Boolean        /*isASCII*/ )
+                                           const char*           aLocalPersistentID,
+                                           CORBA::Boolean        /*isMultiFile*/,
+                                           CORBA::Boolean        /*isASCII*/ )
 {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::LocalPersistentIDToIOR(): id = " << aLocalPersistentID );
   StudyContext* myStudyContext = GetCurrentStudyContext();
@@ -4318,6 +4338,11 @@ void SMESH_Gen_i::SetName(const char* theIOR,
   }
 }
 
+int SMESH_Gen_i::GetCurrentStudyID()
+{
+  return myCurrentStudy->_is_nil() || myCurrentStudy->_non_existent() ? -1 : myCurrentStudy->StudyId();
+}
+    
 //=============================================================================
 /*! 
  *  SMESHEngine_factory
@@ -4329,10 +4354,10 @@ void SMESH_Gen_i::SetName(const char* theIOR,
 extern "C"
 { SMESH_I_EXPORT
   PortableServer::ObjectId* SMESHEngine_factory( CORBA::ORB_ptr            orb,
-                                                PortableServer::POA_ptr   poa, 
-                                                PortableServer::ObjectId* contId,
-                                                const char*               instanceName, 
-                                                const char*               interfaceName )
+                                                 PortableServer::POA_ptr   poa, 
+                                                 PortableServer::ObjectId* contId,
+                                                 const char*               instanceName, 
+                                                 const char*               interfaceName )
   {
     if(MYDEBUG) MESSAGE( "PortableServer::ObjectId* SMESHEngine_factory()" );
     if(MYDEBUG) SCRUTE(interfaceName);
index 9ba9bdbb9e5a0d85c7a230ed0dc4111fbe886e02..13bca294ab715d73c53b84258e6d3a3733d1c9c6 100644 (file)
@@ -176,7 +176,7 @@ public:
   // *****************************************
   // Set a new Mesh object name
   void SetName(const char* theIOR,
-              const char* theName);
+               const char* theName);
 
   //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
   void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
@@ -266,9 +266,9 @@ public:
    * Return mesh preview structure
    */
   SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
-                                       GEOM::GEOM_Object_ptr theSubObject,
-                                       SMESH::Dimension      theDimension,
-                                       SMESH::long_array&    theShapesId )
+                                        GEOM::GEOM_Object_ptr theSubObject,
+                                        SMESH::Dimension      theDimension,
+                                        SMESH::long_array&    theShapesId )
     throw ( SALOME::SALOME_Exception );
 
   // Returns errors of hypotheses definintion
@@ -294,30 +294,30 @@ public:
 
   // Return geometrical object the given element is built on. Don't publish it in study.
   GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
-                                                  CORBA::Long            theElementID)
+                                                   CORBA::Long            theElementID)
     throw ( SALOME::SALOME_Exception );
 
   // Concatenate the given meshes into one mesh
   SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::mesh_array& theMeshesArray, 
-                                         CORBA::Boolean           theUniteIdenticalGroups, 
-                                         CORBA::Boolean           theMergeNodesAndElements, 
-                                         CORBA::Double            theMergeTolerance,
-                                         CORBA::Boolean           theCommonGroups)
+                                          CORBA::Boolean           theUniteIdenticalGroups, 
+                                          CORBA::Boolean           theMergeNodesAndElements, 
+                                          CORBA::Double            theMergeTolerance,
+                                          CORBA::Boolean           theCommonGroups)
     throw ( SALOME::SALOME_Exception );
 
   // Concatenate the given meshes into one mesh
   SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray, 
-                                   CORBA::Boolean           theUniteIdenticalGroups, 
-                                   CORBA::Boolean           theMergeNodesAndElements, 
-                                   CORBA::Double            theMergeTolerance)
+                                    CORBA::Boolean           theUniteIdenticalGroups, 
+                                    CORBA::Boolean           theMergeNodesAndElements, 
+                                    CORBA::Double            theMergeTolerance)
     throw ( SALOME::SALOME_Exception );
 
   // Concatenate the given meshes into one mesh
   // Create the groups of all elements from initial meshes
   SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray, 
-                                             CORBA::Boolean           theUniteIdenticalGroups, 
-                                             CORBA::Boolean           theMergeNodesAndElements, 
-                                             CORBA::Double            theMergeTolerance)
+                                              CORBA::Boolean           theUniteIdenticalGroups, 
+                                              CORBA::Boolean           theMergeNodesAndElements, 
+                                              CORBA::Double            theMergeTolerance)
     throw ( SALOME::SALOME_Exception );
 
   // ****************************************************
@@ -326,22 +326,22 @@ public:
 
   // Save SMESH data
   SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
-                        const char*              theURL,
-                        bool                     isMultiFile );
+                         const char*              theURL,
+                         bool                     isMultiFile );
   // Load SMESH data
   bool Load( SALOMEDS::SComponent_ptr theComponent,
-            const SALOMEDS::TMPFile& theStream,
-            const char*              theURL,
-            bool                     isMultiFile );
+             const SALOMEDS::TMPFile& theStream,
+             const char*              theURL,
+             bool                     isMultiFile );
   // Save SMESH data in ASCII format
   SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
-                               const char*              theURL,
-                               bool                     isMultiFile );
+                                const char*              theURL,
+                                bool                     isMultiFile );
   // Load SMESH data in ASCII format
   bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
-                 const SALOMEDS::TMPFile& theStream,
-                 const char*              theURL,
-                 bool                     isMultiFile );
+                  const SALOMEDS::TMPFile& theStream,
+                  const char*              theURL,
+                  bool                     isMultiFile );
 
   // Create filter manager
   SMESH::FilterManager_ptr CreateFilterManager();
@@ -357,22 +357,22 @@ public:
     
   // Transform data from transient form to persistent
   char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
-                               const char*           IORString,
-                               CORBA::Boolean        isMultiFile,
-                               CORBA::Boolean        isASCII );
+                                const char*           IORString,
+                                CORBA::Boolean        isMultiFile,
+                                CORBA::Boolean        isASCII );
   // Transform data from persistent form to transient
   char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
-                               const char*           aLocalPersistentID,
-                               CORBA::Boolean        isMultiFile,
-                               CORBA::Boolean        isASCII );
+                                const char*           aLocalPersistentID,
+                                CORBA::Boolean        isMultiFile,
+                                CORBA::Boolean        isASCII );
 
   // Returns true if object can be published in the study
   bool CanPublishInStudy( CORBA::Object_ptr theIOR );
   // Publish object in the study
   SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::Study_ptr   theStudy,
-                                       SALOMEDS::SObject_ptr theSObject,
-                                       CORBA::Object_ptr     theObject,
-                                       const char*           theName ) 
+                                        SALOMEDS::SObject_ptr theSObject,
+                                        CORBA::Object_ptr     theObject,
+                                        const char*           theName ) 
     throw ( SALOME::SALOME_Exception );
 
   // Copy-paste methods - returns true if object can be copied to the clipboard
@@ -383,8 +383,8 @@ public:
   CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
   // Copy-paste methods - paste object from the clipboard
   SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
-                                  CORBA::Long              theObjectID,
-                                  SALOMEDS::SObject_ptr    theObject ) {
+                                   CORBA::Long              theObjectID,
+                                   SALOMEDS::SObject_ptr    theObject ) {
     SALOMEDS::SObject_var aResultSO;
     return aResultSO._retn();
   }
@@ -394,8 +394,8 @@ public:
   // ============
 
   virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, 
-                                      CORBA::Boolean isPublished, 
-                                      CORBA::Boolean& isValidScript);
+                                       CORBA::Boolean isPublished, 
+                                       CORBA::Boolean& isValidScript);
 
   void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
 
@@ -452,7 +452,7 @@ public:
                                         SMESH::SMESH_Mesh_ptr    theMesh,
                                         SMESH::SMESH_subMesh_ptr theSubMesh,
                                         GEOM::GEOM_Object_ptr    theShapeObject,
-                                       const char*              theName = 0);
+                                        const char*              theName = 0);
   SALOMEDS::SObject_ptr PublishGroup (SALOMEDS::Study_ptr    theStudy,
                                       SMESH::SMESH_Mesh_ptr  theMesh,
                                       SMESH::SMESH_GroupBase_ptr theGroup,
@@ -498,8 +498,7 @@ public:
   }
 
   // Get current study ID
-  int GetCurrentStudyID()
-  { return myCurrentStudy->_is_nil() ? -1 : myCurrentStudy->StudyId(); }
+  int GetCurrentStudyID();
 
   /*!
    * \brief Find SObject for an algo
index bce1e6eb530db0e6d710be26024c952fe16417f5..2b216fe268d77330f4480a45880151cf4f2ecf69 100644 (file)
@@ -210,8 +210,10 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha
     GEOM_Client* aClient = GetShapeReader();
     TCollection_AsciiString IOR;
     if ( aClient && aClient->Find( theShape, IOR ))
-      aShapeObj = GEOM::GEOM_Object::_narrow
-        ( GetORB()->string_to_object( IOR.ToCString() ) );
+    {
+      CORBA::Object_var obj = GetORB()->string_to_object( IOR.ToCString() );
+      aShapeObj = GEOM::GEOM_Object::_narrow ( obj );
+    }
   }
   return aShapeObj._retn();
 }
@@ -262,7 +264,8 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
   }
   if ( thePixMap ) {
     anAttr  = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
-    SALOMEDS::AttributePixMap::_narrow( anAttr )->SetPixMap( thePixMap );
+    SALOMEDS::AttributePixMap_var pm = SALOMEDS::AttributePixMap::_narrow( anAttr );
+    pm->SetPixMap( thePixMap );
   }
   if ( !theSelectable ) {
     anAttr   = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeSelectable" );
@@ -368,9 +371,9 @@ static void addReference (SALOMEDS::Study_ptr   theStudy,
 //=============================================================================
 
 SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy,
-                                                 SALOMEDS::SObject_ptr theSObject,
-                                                 CORBA::Object_ptr     theIOR,
-                                                 const char*           theName)
+                                                  SALOMEDS::SObject_ptr theSObject,
+                                                  CORBA::Object_ptr     theIOR,
+                                                  const char*           theName)
      throw (SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
@@ -465,9 +468,9 @@ static long findMaxChildTag( SALOMEDS::SObject_ptr theSObject )
     if ( !aStudy->_is_nil() ) {
       SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator( theSObject );
       for ( ; anIter->More(); anIter->Next() ) {
-       long nTag = anIter->Value()->Tag();
-       if ( nTag > aTag )
-         aTag = nTag;
+        long nTag = anIter->Value()->Tag();
+        if ( nTag > aTag )
+          aTag = nTag;
       }
     }
   }
@@ -518,13 +521,12 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
 
     // Publish global hypotheses
 
-    SMESH::ListOfHypothesis * hypList = theMesh->GetHypothesisList( aShapeObject );
-    if ( hypList )
-      for ( int i = 0; i < hypList->length(); i++ ) {
-        SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( (*hypList)[ i ]);
-        PublishHypothesis( theStudy, aHyp );
-        AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
-      }
+    SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( aShapeObject );
+    for ( int i = 0; i < hypList->length(); i++ ) {
+      SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
+      PublishHypothesis( theStudy, aHyp );
+      AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
+    }
   }
 
   // Publish submeshes
@@ -900,9 +902,9 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
   SALOMEDS::SObject_var aSObj =  ObjectToSObject(aStudy,theObject);
   if(aSObj->_is_nil())  
     return;
-  
+
   SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
-  
+
   SALOMEDS::GenericAttribute_var aFindAttr;
   bool hasAttr = aSObj->FindAttribute(aFindAttr, "AttributeString");
   if(VARIABLE_DEBUG)
@@ -912,23 +914,23 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
   anAttr = aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString");
   SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
 
+  CORBA::String_var oldparVar = aStringAttr->Value();
+  CORBA::String_var inpparVar = ParseParameters(theParameters);
   TCollection_AsciiString aNewParams;
-  TCollection_AsciiString aOldParameters(aStringAttr->Value());
-  TCollection_AsciiString anInputParams(ParseParameters(theParameters));
-  
+  TCollection_AsciiString aOldParameters(oldparVar.inout());
+  TCollection_AsciiString anInputParams(inpparVar.inout());
   if(!hasAttr)
     aNewParams = anInputParams;
   else 
     aNewParams = aOldParameters+"|"+anInputParams;
 
   if(VARIABLE_DEBUG)
-    {
-      cout<<"Input Parameters : "<<anInputParams<<endl;
-      cout<<"Old Parameters : "<<aOldParameters<<endl;
-      cout<<"New Parameters : "<<aNewParams<<endl;
-    }
-  
-  
+  {
+    cout<<"Input Parameters : "<<anInputParams<<endl;
+    cout<<"Old Parameters : "<<aOldParameters<<endl;
+    cout<<"New Parameters : "<<aNewParams<<endl;
+  }
+
   aStringAttr->SetValue( aNewParams.ToCString() );
 }
 
@@ -938,21 +940,45 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
 //=======================================================================
 char* SMESH_Gen_i::ParseParameters(const char* theParameters)
 {
-  const char* aParameters = CORBA::string_dup(theParameters);
+  //const char* aParameters = theParameters;
+//   const char* aParameters = CORBA::string_dup(theParameters);
   TCollection_AsciiString anInputParams;
-  SALOMEDS::Study_ptr aStudy = GetCurrentStudy();
+  SALOMEDS::Study_var aStudy = GetCurrentStudy();
   if( !aStudy->_is_nil() ) {
-    SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
-    for(int j=0;j<aSections->length();j++) {
-      SALOMEDS::ListOfStrings aVars= aSections[j];
-      for(int i=0;i<aVars.length();i++ ) {
-        anInputParams += aStudy->IsVariable(aVars[i].in()) ? 
-          TCollection_AsciiString(aVars[i].in()) : TCollection_AsciiString("");
-        if(i != aVars.length()-1)
-          anInputParams+=":";
+//     SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(theParameters);
+//     for(int j=0;j<aSections->length();j++) {
+//       SALOMEDS::ListOfStrings aVars= aSections[j];
+//       for(int i=0;i<aVars.length();i++ ) {
+//         anInputParams += aStudy->IsVariable(aVars[i].in()) ? 
+//           TCollection_AsciiString(aVars[i].in()) : TCollection_AsciiString("");
+//         if(i != aVars.length()-1)
+//           anInputParams+=":";
+//       }
+//       if(j!=aSections->length()-1)
+//         anInputParams+="|";
+//     }
+    TCollection_AsciiString paramStr( theParameters );
+    static TCollection_AsciiString separators(":|");
+    int beg = 0, end;
+    char sep, *pParams = (char*)paramStr.ToCString();
+    while ( beg < paramStr.Length() )
+    {
+      end = beg-1;
+      while ( ++end < paramStr.Length() )
+        if ( pParams[end] == ':' || pParams[end] == '|')
+          break;
+      if ( end < paramStr.Length())
+      {
+        sep = pParams[end];
+        pParams[end] = '\0';
       }
-      if(j!=aSections->length()-1)
-        anInputParams+="|";
+      if ( aStudy->IsVariable( pParams+beg ))
+        anInputParams += pParams+beg;
+      if ( end < paramStr.Length() )
+        anInputParams += sep;
+      else
+        break;
+      beg = end + 1;
     }
   }
   return CORBA::string_dup(anInputParams.ToCString());
index 2f9a7f775e98568834cf1af898e66412cd9c39b9..7502c5409c8901569c350080a2564b4945071e11 100644 (file)
@@ -305,8 +305,8 @@ typedef bool (SMESHDS_Group::*TFunChangeGroup)(const int);
 
 CORBA::Long 
 ChangeByPredicate( SMESH::Predicate_i* thePredicate,
-                  SMESHDS_GroupBase* theGroupBase,
-                  TFunChangeGroup theFun)
+                   SMESHDS_GroupBase* theGroupBase,
+                   TFunChangeGroup theFun)
 {
   CORBA::Long aNb = 0;
   if(SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>(theGroupBase)){
@@ -317,7 +317,7 @@ ChangeByPredicate( SMESH::Predicate_i* thePredicate,
     CORBA::Long i = 0, iEnd = aSequence.size();
     for(; i < iEnd; i++)
       if((aGroupDS->*theFun)(aSequence[i]))
-       aNb++;
+        aNb++;
     return aNb;
   }
   return aNb;
index 35bacddc328c692b912f73e19ef173150217c900..393e49c42cf66308e2f1a9d69eabfb72bbc02934 100644 (file)
@@ -77,7 +77,7 @@ SMESH_MEDFamily_i::~SMESH_MEDFamily_i()
  */
 //=============================================================================
 SMESH_MEDFamily_i::SMESH_MEDFamily_i(int identifier, SMESH_subMesh_i* sm,
-                                    string name, string description, SALOME_MED::medEntityMesh entity): 
+                                     string name, string description, SALOME_MED::medEntityMesh entity): 
   SMESH_MEDSupport_i( sm, name, description, entity ),
   
   _subMesh_i(sm),
@@ -103,7 +103,7 @@ throw (SALOME::SALOME_Exception)
 {
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR); 
+                                 SALOME::INTERNAL_ERROR); 
   return _identifier;
   
 }
@@ -117,7 +117,7 @@ throw (SALOME::SALOME_Exception)
 {
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
   return _numberOfAttribute;
 }
 //=============================================================================
@@ -130,12 +130,12 @@ throw (SALOME::SALOME_Exception)
 {
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
   if (_numberOfAttribute == 0)
     {
       MESSAGE("Les familles SMESH n ont pas d attribut");
       THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                                  ,SALOME::BAD_PARAM);
+                                   ,SALOME::BAD_PARAM);
     };
   
   SALOME_MED::long_array_var myseq= new SALOME_MED::long_array;
@@ -157,15 +157,15 @@ CORBA::Long SMESH_MEDFamily_i::getAttributeIdentifier(CORBA::Long i)
 {    
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
   MESSAGE("Les familles SMESH n ont pas d attribut");
   THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                              ,SALOME::BAD_PARAM);
+                               ,SALOME::BAD_PARAM);
   if (_numberOfAttribute == 0)
     {
       MESSAGE("Les familles SMESH n ont pas d attribut");
       THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                                  ,SALOME::BAD_PARAM);
+                                   ,SALOME::BAD_PARAM);
     };
   ASSERT (i <= _numberOfAttribute);
   return _attributeIdentifier[i];
@@ -180,13 +180,13 @@ SALOME_MED::long_array*  SMESH_MEDFamily_i::getAttributesValues()
 {
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
 
   if (_numberOfAttribute == 0)
     {
       MESSAGE("Les familles SMESH n ont pas d attribut");
       THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                                  ,SALOME::BAD_PARAM);
+                                   ,SALOME::BAD_PARAM);
     };
 
   SALOME_MED::long_array_var myseq= new SALOME_MED::long_array;
@@ -207,12 +207,12 @@ CORBA::Long  SMESH_MEDFamily_i::getAttributeValue(CORBA::Long i)
 {   
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
   if (_numberOfAttribute == 0)
     {
       MESSAGE("Les familles SMESH n ont pas d attribut");
       THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                                  ,SALOME::BAD_PARAM);
+                                   ,SALOME::BAD_PARAM);
     }
 
   ASSERT (i <= _numberOfAttribute);
@@ -228,12 +228,12 @@ SALOME_MED::string_array * SMESH_MEDFamily_i::getAttributesDescriptions()
 {
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
   if (_numberOfAttribute == 0)
     {
       MESSAGE("Les familles SMESH n ont pas d attribut");
       THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                                  ,SALOME::BAD_PARAM);
+                                   ,SALOME::BAD_PARAM);
     }
   SALOME_MED::string_array_var myseq = new SALOME_MED::string_array;
   for (int i=0;i<_numberOfAttribute;i++)
@@ -252,12 +252,12 @@ char *  SMESH_MEDFamily_i::getAttributeDescription( CORBA::Long i)
 {   
   if (_subMeshDS==NULL)
     THROW_SALOME_CORBA_EXCEPTION("No associated Family",\
-                                SALOME::INTERNAL_ERROR);
+                                 SALOME::INTERNAL_ERROR);
   if (_numberOfAttribute == 0)
     {
       MESSAGE("Les familles SMESH n ont pas d attribut");
       THROW_SALOME_CORBA_EXCEPTION("No attributes"\
-                                  ,SALOME::BAD_PARAM);
+                                   ,SALOME::BAD_PARAM);
     }
   ASSERT (i <= _numberOfAttribute);
   return CORBA::string_dup(_attributeDescription[i].c_str());
index 2b850fc8a5bca3818b26d9aa580e6a117286702d..e6af380679c25da3f919f6bce29eac62124b5a01 100644 (file)
@@ -56,7 +56,7 @@ public :
   
   // Constructors and associated internal methods
   SMESH_MEDFamily_i(int identifier, SMESH_subMesh_i* sm,
-                   std::string name, std::string description, SALOME_MED::medEntityMesh entity );
+                    std::string name, std::string description, SALOME_MED::medEntityMesh entity );
   SMESH_MEDFamily_i(const SMESH_MEDFamily_i & f);
   
   // IDL Methods
index 9ee46fda3c0c8b9b17b6e94f1e037aaed5c7c42c..f73bf1102c35ef9004f1da5ea9813f1c315261b6 100644 (file)
@@ -24,6 +24,7 @@
 //  Module : SMESH
 //
 #include "SMESH_MEDMesh_i.hxx"
+#include "SMESH_Gen_i.hxx"
 #include "SMESH_Mesh_i.hxx"
 
 #include "SMESHDS_Mesh.hxx"
@@ -69,8 +70,8 @@ using namespace std;
 // PN Est-ce un const ?
 SMESH_MEDMesh_i::SMESH_MEDMesh_i()
 {
-       BEGIN_OF("Default Constructor SMESH_MEDMesh_i");
-       END_OF("Default Constructor SMESH_MEDMesh_i");
+  BEGIN_OF("Default Constructor SMESH_MEDMesh_i");
+  END_OF("Default Constructor SMESH_MEDMesh_i");
 }
 
 //=============================================================================
@@ -88,18 +89,18 @@ SMESH_MEDMesh_i::~SMESH_MEDMesh_i()
  */
 //=============================================================================
 SMESH_MEDMesh_i::SMESH_MEDMesh_i(::SMESH_Mesh_i * m_i):_meshId(""),
-                                                      _compte(false),
-                                                      _creeFamily(false),
-                                                      _famIdent(0),
-                                                      _indexElts(0),
-                                                      _indexEnts(0)
+                                                       _compte(false),
+                                                       _creeFamily(false),
+                                                       _famIdent(0),
+                                                       _indexElts(0),
+                                                       _indexEnts(0)
 {
-       BEGIN_OF("Constructor SMESH_MEDMesh_i");
+  BEGIN_OF("Constructor SMESH_MEDMesh_i");
 
-       _mesh_i = m_i;
-       _meshDS = _mesh_i->GetImpl().GetMeshDS();
+  _mesh_i = m_i;
+  _meshDS = _mesh_i->GetImpl().GetMeshDS();
 
-       END_OF("Constructor SMESH_MEDMesh_i");
+  END_OF("Constructor SMESH_MEDMesh_i");
 }
 
 //=============================================================================
@@ -109,22 +110,28 @@ SMESH_MEDMesh_i::SMESH_MEDMesh_i(::SMESH_Mesh_i * m_i):_meshId(""),
 //=============================================================================
 char *SMESH_MEDMesh_i::getName() throw(SALOME::SALOME_Exception)
 {
-       if (_meshDS == NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-
-       try
-       {
-               // A COMPLETER PAR LE NOM DU MAILLAGE
-               //return CORBA::string_dup(_mesh_i->getName().c_str());
-               return CORBA::string_dup("toto");
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant au nom");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
+  if (_meshDS == NULL)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+
+  try
+  {
+    SMESH_Gen_i*             gen = SMESH_Gen_i::GetSMESHGen();
+    SALOMEDS::Study_var    study = gen->GetCurrentStudy();
+    SALOMEDS::SObject_var meshSO = gen->ObjectToSObject( study, _mesh_i->_this());
+    if ( meshSO->_is_nil() )
+      return CORBA::string_dup("toto");
+
+    CORBA::String_var name = meshSO->GetName();
+    return CORBA::string_dup( name.in() );
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant au nom");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
+  return 0;
 }
 
 //=============================================================================
@@ -134,8 +141,8 @@ char *SMESH_MEDMesh_i::getName() throw(SALOME::SALOME_Exception)
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getCorbaIndex()throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Non Implemente");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  MESSAGE("Non Implemente");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
 }
 
 //=============================================================================
@@ -145,11 +152,11 @@ CORBA::Long SMESH_MEDMesh_i::getCorbaIndex()throw(SALOME::SALOME_Exception)
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getSpaceDimension()throw(SALOME::SALOME_Exception)
 {
-       // PN : Il semblerait que la dimension soit fixee a 3
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       return 3;
+  // PN : Il semblerait que la dimension soit fixee a 3
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  return 3;
 }
 
 //=============================================================================
@@ -159,14 +166,14 @@ CORBA::Long SMESH_MEDMesh_i::getSpaceDimension()throw(SALOME::SALOME_Exception)
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getMeshDimension()throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       // PN : Il semblerait que la dimension soit fixee a 3
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       return 3;
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  // PN : Il semblerait que la dimension soit fixee a 3
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  return 3;
 }
 //=============================================================================
 /*!
@@ -188,7 +195,7 @@ CORBA::Boolean SMESH_MEDMesh_i::getIsAGrid() throw (SALOME::SALOME_Exception)
 //=============================================================================
 CORBA::Boolean
 SMESH_MEDMesh_i::existConnectivity(SALOME_MED::medConnectivity connectivityType,
-                                  SALOME_MED::medEntityMesh entity)
+                                   SALOME_MED::medEntityMesh entity)
   throw (SALOME::SALOME_Exception)
 {
   MESSAGE("!!!!!! IMPLEMENTED BUT ONLY PARTIALLY !!!!!!");
@@ -218,21 +225,21 @@ CORBA::Double SMESH_MEDMesh_i::getCoordinate(CORBA::Long Number, CORBA::Long Axi
 //=============================================================================
 char *SMESH_MEDMesh_i::getCoordinatesSystem() throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       // PN : En dur. Non encore prevu
-       try
-       {
-               string systcoo = "CARTESIEN";
-               return CORBA::string_dup(systcoo.c_str());
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant au maillage");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  // PN : En dur. Non encore prevu
+  try
+  {
+    string systcoo = "CARTESIEN";
+    return CORBA::string_dup(systcoo.c_str());
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant au maillage");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
 }
 
 //=============================================================================
@@ -240,56 +247,56 @@ char *SMESH_MEDMesh_i::getCoordinatesSystem() throw(SALOME::SALOME_Exception)
  * CORBA: Accessor for Coordinates
  */
 //=============================================================================
-SALOME_MED::double_array * SMESH_MEDMesh_i::getCoordinates(
-       SALOME_MED::medModeSwitch typeSwitch) throw(SALOME::SALOME_Exception)
+SALOME_MED::double_array * SMESH_MEDMesh_i::getCoordinates
+(SALOME_MED::medModeSwitch typeSwitch) throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       SALOME_MED::double_array_var myseq = new SALOME_MED::double_array;
-       try
-       {
-               // PN  : En dur
-               int spaceDimension = 3;
-               int nbNodes = _meshDS->NbNodes();
-               SCRUTE(nbNodes);
-               myseq->length(nbNodes * spaceDimension);
-               int i = 0;
-
-               SMDS_NodeIteratorPtr itNodes=_meshDS->nodesIterator();
-               while(itNodes->more())
-               {
-                       const SMDS_MeshNode* node = itNodes->next();
-
-                       if (typeSwitch == SALOME_MED::MED_FULL_INTERLACE)
-                       {
-                               myseq[i * 3] = node->X();
-                               myseq[i * 3 + 1] = node->Y();
-                               myseq[i * 3 + 2] = node->Z();
-                               SCRUTE(myseq[i * 3]);
-                               SCRUTE(myseq[i * 3 + 1]);
-                               SCRUTE(myseq[i * 3 + 2]);
-                       }
-                       else
-                       {
-                               ASSERT(typeSwitch == SALOME_MED::MED_NO_INTERLACE);
-                               myseq[i] = node->X();
-                               myseq[i + nbNodes] = node->Y();
-                               myseq[i + (nbNodes * 2)] = node->Z();
-                               SCRUTE(myseq[i]);
-                               SCRUTE(myseq[i + nbNodes]);
-                               SCRUTE(myseq[i + (nbNodes * 2)]);
-                       }
-                       i++;
-               }
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant aux coordonnees");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
-       return myseq._retn();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  SALOME_MED::double_array_var myseq = new SALOME_MED::double_array;
+  try
+  {
+    // PN  : En dur
+    int spaceDimension = 3;
+    int nbNodes = _meshDS->NbNodes();
+    SCRUTE(nbNodes);
+    myseq->length(nbNodes * spaceDimension);
+    int i = 0;
+
+    SMDS_NodeIteratorPtr itNodes=_meshDS->nodesIterator();
+    while(itNodes->more())
+    {
+      const SMDS_MeshNode* node = itNodes->next();
+
+      if (typeSwitch == SALOME_MED::MED_FULL_INTERLACE)
+      {
+        myseq[i * 3] = node->X();
+        myseq[i * 3 + 1] = node->Y();
+        myseq[i * 3 + 2] = node->Z();
+        SCRUTE(myseq[i * 3]);
+        SCRUTE(myseq[i * 3 + 1]);
+        SCRUTE(myseq[i * 3 + 2]);
+      }
+      else
+      {
+        ASSERT(typeSwitch == SALOME_MED::MED_NO_INTERLACE);
+        myseq[i] = node->X();
+        myseq[i + nbNodes] = node->Y();
+        myseq[i + (nbNodes * 2)] = node->Z();
+        SCRUTE(myseq[i]);
+        SCRUTE(myseq[i + nbNodes]);
+        SCRUTE(myseq[i + (nbNodes * 2)]);
+      }
+      i++;
+    }
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant aux coordonnees");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
+  return myseq._retn();
 }
 
 //=============================================================================
@@ -298,28 +305,28 @@ SALOME_MED::double_array * SMESH_MEDMesh_i::getCoordinates(
  */
 //=============================================================================
 SALOME_MED::string_array *
-       SMESH_MEDMesh_i::getCoordinatesNames()throw(SALOME::SALOME_Exception)
+SMESH_MEDMesh_i::getCoordinatesNames()throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       SALOME_MED::string_array_var myseq = new SALOME_MED::string_array;
-       try
-       {
-               // PN : en dur
-               int spaceDimension = 3;
-               myseq->length(spaceDimension);
-               myseq[0] = CORBA::string_dup("x");
-               myseq[1] = CORBA::string_dup("y");
-               myseq[2] = CORBA::string_dup("z");
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant aux noms des coordonnees");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
-       return myseq._retn();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  SALOME_MED::string_array_var myseq = new SALOME_MED::string_array;
+  try
+  {
+    // PN : en dur
+    int spaceDimension = 3;
+    myseq->length(spaceDimension);
+    myseq[0] = CORBA::string_dup("x");
+    myseq[1] = CORBA::string_dup("y");
+    myseq[2] = CORBA::string_dup("z");
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant aux noms des coordonnees");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
+  return myseq._retn();
 
 }
 
@@ -329,28 +336,28 @@ SALOME_MED::string_array *
  */
 //=============================================================================
 SALOME_MED::string_array *
-       SMESH_MEDMesh_i::getCoordinatesUnits()throw(SALOME::SALOME_Exception)
+SMESH_MEDMesh_i::getCoordinatesUnits()throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       SALOME_MED::string_array_var myseq = new SALOME_MED::string_array;
-       try
-       {
-               // PN : en dur
-               int spaceDimension = 3;
-               myseq->length(spaceDimension);
-               myseq[0] = CORBA::string_dup("m");
-               myseq[1] = CORBA::string_dup("m");
-               myseq[2] = CORBA::string_dup("m");
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant aux unites des coordonnees");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
-       return myseq._retn();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  SALOME_MED::string_array_var myseq = new SALOME_MED::string_array;
+  try
+  {
+    // PN : en dur
+    int spaceDimension = 3;
+    myseq->length(spaceDimension);
+    myseq[0] = CORBA::string_dup("m");
+    myseq[1] = CORBA::string_dup("m");
+    myseq[2] = CORBA::string_dup("m");
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant aux unites des coordonnees");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
+  return myseq._retn();
 }
 
 //=============================================================================
@@ -360,19 +367,19 @@ SALOME_MED::string_array *
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getNumberOfNodes()throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       try
-       {
-               return _meshDS->NbNodes();
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant au nombre de noeuds");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  try
+  {
+    return _meshDS->NbNodes();
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant au nombre de noeuds");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
 }
 
 //=============================================================================
@@ -381,119 +388,119 @@ CORBA::Long SMESH_MEDMesh_i::getNumberOfNodes()throw(SALOME::SALOME_Exception)
  */
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getNumberOfTypes(SALOME_MED::medEntityMesh entity)
-throw(SALOME::SALOME_Exception)
+  throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       try
-       {
-               if (!_compte)
-                       calculeNbElts();
-               int retour = 0;
-               if (_mapNbTypes.find(entity) != _mapNbTypes.end())
-                       retour = _mapNbTypes[entity];
-               return retour;
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant au nombre de Types");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  try
+  {
+    if (!_compte)
+      calculeNbElts();
+    int retour = 0;
+    if (_mapNbTypes.find(entity) != _mapNbTypes.end())
+      retour = _mapNbTypes[entity];
+    return retour;
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant au nombre de Types");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
 }
 
 //=============================================================================
 /*!
  * CORBA: Accessor for existing geometry element types 
- *       Not implemented for MED_ALL_ENTITIES
+ *        Not implemented for MED_ALL_ENTITIES
  */
 //=============================================================================
 SALOME_MED::medGeometryElement_array *
-       SMESH_MEDMesh_i::getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
-       SALOME_Exception)
+SMESH_MEDMesh_i::getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
+                                                                  SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       if (entity == SALOME_MED::MED_ALL_ENTITIES)
-               THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ENTITIES",
-                       SALOME::BAD_PARAM);
-       if (!_compte)
-               calculeNbElts();
-       SALOME_MED::medGeometryElement_array_var myseq =
-               new SALOME_MED::medGeometryElement_array;
-       try
-       {
-               if (_mapNbTypes.find(entity) == _mapNbTypes.end())
-                       THROW_SALOME_CORBA_EXCEPTION("No Such Entity in the mesh",
-                               SALOME::BAD_PARAM);
-               int nbTypes = _mapNbTypes[entity];
-
-               myseq->length(nbTypes);
-
-               if (_mapIndToVectTypes.find(entity) == _mapIndToVectTypes.end())
-                       THROW_SALOME_CORBA_EXCEPTION("No Such Entity in the mesh",
-                               SALOME::INTERNAL_ERROR);
-
-               int index = _mapIndToVectTypes[entity];
-               ASSERT(_TypesId[index].size() != 0);
-               int i = 0;
-               vector < SALOME_MED::medGeometryElement >::iterator it;
-               for (it = _TypesId[index].begin(); it != _TypesId[index].end(); it++)
-               {
-                       myseq[i++] = *it;
-               };
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant aux differents types");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
-       return myseq._retn();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  if (entity == SALOME_MED::MED_ALL_ENTITIES)
+    THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ENTITIES",
+                                 SALOME::BAD_PARAM);
+  if (!_compte)
+    calculeNbElts();
+  SALOME_MED::medGeometryElement_array_var myseq =
+    new SALOME_MED::medGeometryElement_array;
+  try
+  {
+    if (_mapNbTypes.find(entity) == _mapNbTypes.end())
+      THROW_SALOME_CORBA_EXCEPTION("No Such Entity in the mesh",
+                                   SALOME::BAD_PARAM);
+    int nbTypes = _mapNbTypes[entity];
+
+    myseq->length(nbTypes);
+
+    if (_mapIndToVectTypes.find(entity) == _mapIndToVectTypes.end())
+      THROW_SALOME_CORBA_EXCEPTION("No Such Entity in the mesh",
+                                   SALOME::INTERNAL_ERROR);
+
+    int index = _mapIndToVectTypes[entity];
+    ASSERT(_TypesId[index].size() != 0);
+    int i = 0;
+    vector < SALOME_MED::medGeometryElement >::iterator it;
+    for (it = _TypesId[index].begin(); it != _TypesId[index].end(); it++)
+    {
+      myseq[i++] = *it;
+    };
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant aux differents types");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
+  return myseq._retn();
 }
 
 //=============================================================================
 /*!
  * CORBA: Returns number of elements of type medGeometryElement
- *       Not implemented for MED_ALL_ELEMENTS 
- *       implemented for MED_ALL_ENTITIES
+ *        Not implemented for MED_ALL_ELEMENTS 
+ *        implemented for MED_ALL_ENTITIES
  *
  * Dans cette implementation, il n est pas prevu de tenir compte du entity
  * qui ne doit pas pouvoir avoir deux valeurs differentes pour un geomElement 
  */
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getNumberOfElements(SALOME_MED::
-       medEntityMesh entity,
-       SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
+                                                 medEntityMesh entity,
+                                                 SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       if (geomElement == SALOME_MED::MED_ALL_ELEMENTS)
-               THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ELEMENTS",
-                       SALOME::BAD_PARAM);
-       if (!_compte)
-               calculeNbElts();
-
-       try
-       {
-               int retour = 0;
-               if (_mapIndToSeqElts.find(geomElement) != _mapIndToSeqElts.end())
-               {
-                       int index = _mapIndToSeqElts[geomElement];
-
-                       retour = _seq_elemId[index]->length();
-               }
-               return retour;
-       }
-       catch(...)
-       {
-               MESSAGE("Exception en accedant au nombre d élements");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
-                       SALOME::INTERNAL_ERROR);
-       }
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  if (geomElement == SALOME_MED::MED_ALL_ELEMENTS)
+    THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ELEMENTS",
+                                 SALOME::BAD_PARAM);
+  if (!_compte)
+    calculeNbElts();
+
+  try
+  {
+    int retour = 0;
+    if (_mapIndToSeqElts.find(geomElement) != _mapIndToSeqElts.end())
+    {
+      int index = _mapIndToSeqElts[geomElement];
+
+      retour = _seq_elemId[index]->length();
+    }
+    return retour;
+  }
+  catch(...)
+  {
+    MESSAGE("Exception en accedant au nombre d élements");
+    THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object",
+                                 SALOME::INTERNAL_ERROR);
+  }
 }
 
 //=============================================================================
@@ -503,29 +510,29 @@ CORBA::Long SMESH_MEDMesh_i::getNumberOfElements(SALOME_MED::
 //=============================================================================
 SALOME_MED::long_array *
 SMESH_MEDMesh_i::getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
-                                SALOME_MED::medConnectivity mode,
-                                SALOME_MED::medEntityMesh entity,
-                                SALOME_MED::medGeometryElement geomElement)
+                                 SALOME_MED::medConnectivity mode,
+                                 SALOME_MED::medEntityMesh entity,
+                                 SALOME_MED::medGeometryElement geomElement)
   throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       if (mode != SALOME_MED::MED_NODAL)
-               THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
-       if (typeSwitch == SALOME_MED::MED_NO_INTERLACE)
-               THROW_SALOME_CORBA_EXCEPTION("Not Yet Implemented", SALOME::BAD_PARAM);
-       if (!_compte)
-               calculeNbElts();
-
-       // Faut-il renvoyer un pointeur vide ???
-       if (_mapIndToSeqElts.find(geomElement) != _mapIndToSeqElts.end())
-               THROW_SALOME_CORBA_EXCEPTION("No Such Element in the mesh",
-                       SALOME::BAD_PARAM);
-
-       int index = _mapIndToSeqElts[geomElement];
-
-       return _seq_elemId[index]._retn();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  if (mode != SALOME_MED::MED_NODAL)
+    THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
+  if (typeSwitch == SALOME_MED::MED_NO_INTERLACE)
+    THROW_SALOME_CORBA_EXCEPTION("Not Yet Implemented", SALOME::BAD_PARAM);
+  if (!_compte)
+    calculeNbElts();
+
+  // Faut-il renvoyer un pointeur vide ???
+  if (_mapIndToSeqElts.find(geomElement) != _mapIndToSeqElts.end())
+    THROW_SALOME_CORBA_EXCEPTION("No Such Element in the mesh",
+                                 SALOME::BAD_PARAM);
+
+  int index = _mapIndToSeqElts[geomElement];
+
+  return _seq_elemId[index]._retn();
 }
 
 //=============================================================================
@@ -535,12 +542,12 @@ SMESH_MEDMesh_i::getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
 //=============================================================================
 SALOME_MED::long_array *
 SMESH_MEDMesh_i::getConnectivityIndex(SALOME_MED::medConnectivity mode,
-                                     SALOME_MED::medEntityMesh entity)
+                                      SALOME_MED::medEntityMesh entity)
   throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -550,15 +557,15 @@ SMESH_MEDMesh_i::getConnectivityIndex(SALOME_MED::medConnectivity mode,
 //=============================================================================
 CORBA::Long
 SMESH_MEDMesh_i::getElementNumber(SALOME_MED::medConnectivity mode,
-                                 SALOME_MED::medEntityMesh entity,
-                                 SALOME_MED::medGeometryElement type,
-                                 const SALOME_MED::long_array & connectivity)
+                                  SALOME_MED::medEntityMesh entity,
+                                  SALOME_MED::medGeometryElement type,
+                                  const SALOME_MED::long_array & connectivity)
   throw(SALOME::SALOME_Exception)
 {
-       const char *LOC = "getElementNumber ";
-       MESSAGE(LOC << "Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return -1;
+  const char *LOC = "getElementNumber ";
+  MESSAGE(LOC << "Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return -1;
 }
 
 //=============================================================================
@@ -568,12 +575,12 @@ SMESH_MEDMesh_i::getElementNumber(SALOME_MED::medConnectivity mode,
  */
 //=============================================================================
 SALOME_MED::long_array *
-       SMESH_MEDMesh_i::getReverseConnectivity(SALOME_MED::
-       medConnectivity mode) throw(SALOME::SALOME_Exception)
+SMESH_MEDMesh_i::getReverseConnectivity(SALOME_MED::
+                                        medConnectivity mode) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -582,12 +589,12 @@ SALOME_MED::long_array *
  */
 //=============================================================================
 SALOME_MED::long_array *
-       SMESH_MEDMesh_i::getReverseConnectivityIndex(SALOME_MED::
-       medConnectivity mode) throw(SALOME::SALOME_Exception)
+SMESH_MEDMesh_i::getReverseConnectivityIndex(SALOME_MED::
+                                             medConnectivity mode) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -596,14 +603,14 @@ SALOME_MED::long_array *
  */
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getNumberOfFamilies(SALOME_MED::
-       medEntityMesh entity) throw(SALOME::SALOME_Exception)
+                                                 medEntityMesh entity) throw(SALOME::SALOME_Exception)
 {
-       if (_creeFamily == false)
-               createFamilies();
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       return _families.size();
+  if (_creeFamily == false)
+    createFamilies();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  return _families.size();
 }
 
 //=============================================================================
@@ -612,13 +619,13 @@ CORBA::Long SMESH_MEDMesh_i::getNumberOfFamilies(SALOME_MED::
  */
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::getNumberOfGroups(SALOME_MED::medEntityMesh entity)
-throw(SALOME::SALOME_Exception)
+  throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       MESSAGE(" Pas d implementation des groupes dans SMESH");
-       return 0;
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  MESSAGE(" Pas d implementation des groupes dans SMESH");
+  return 0;
 }
 
 //=============================================================================
@@ -627,24 +634,24 @@ throw(SALOME::SALOME_Exception)
  */
 //=============================================================================
 SALOME_MED::Family_array *
-       SMESH_MEDMesh_i::getFamilies(SALOME_MED::
-       medEntityMesh entity) throw(SALOME::SALOME_Exception)
+SMESH_MEDMesh_i::getFamilies(SALOME_MED::
+                             medEntityMesh entity) throw(SALOME::SALOME_Exception)
 {
-       if (_creeFamily == false)
-               createFamilies();
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       SALOME_MED::Family_array_var myseq = new SALOME_MED::Family_array;
-       int nbfam = _families.size();
-       myseq->length(nbfam);
-       int i = 0;
-       vector < SALOME_MED::FAMILY_ptr >::iterator it;
-       for (it = _families.begin(); it != _families.end(); it++)
-       {
-               myseq[i++] = *it;
-       };
-       return myseq._retn();
+  if (_creeFamily == false)
+    createFamilies();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  SALOME_MED::Family_array_var myseq = new SALOME_MED::Family_array;
+  int nbfam = _families.size();
+  myseq->length(nbfam);
+  int i = 0;
+  vector < SALOME_MED::FAMILY_ptr >::iterator it;
+  for (it = _families.begin(); it != _families.end(); it++)
+  {
+    myseq[i++] = *it;
+  };
+  return myseq._retn();
 }
 
 //=============================================================================
@@ -653,16 +660,16 @@ SALOME_MED::Family_array *
  */
 //=============================================================================
 SALOME_MED::FAMILY_ptr SMESH_MEDMesh_i::getFamily(SALOME_MED::
-       medEntityMesh entity, CORBA::Long i) throw(SALOME::SALOME_Exception)
+                                                  medEntityMesh entity, CORBA::Long i) throw(SALOME::SALOME_Exception)
 {
-       if (_creeFamily == false)
-               createFamilies();
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-
-       SCRUTE(_families[i]->getName());
-       MESSAGE(" SMESH_MEDMesh_i::getFamily " << i) return _families[i];
+  if (_creeFamily == false)
+    createFamilies();
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+
+  SCRUTE(_families[i]->getName());
+  MESSAGE(" SMESH_MEDMesh_i::getFamily " << i) return _families[i];
 }
 
 //=============================================================================
@@ -671,14 +678,14 @@ SALOME_MED::FAMILY_ptr SMESH_MEDMesh_i::getFamily(SALOME_MED::
  */
 //=============================================================================
 SALOME_MED::Group_array *
-       SMESH_MEDMesh_i::getGroups(SALOME_MED::medEntityMesh entity) throw(SALOME::
-       SALOME_Exception)
+SMESH_MEDMesh_i::getGroups(SALOME_MED::medEntityMesh entity) throw(SALOME::
+                                                                   SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       MESSAGE(" Pas d implementation des groupes dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("No group implementation", SALOME::BAD_PARAM);
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  MESSAGE(" Pas d implementation des groupes dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("No group implementation", SALOME::BAD_PARAM);
 }
 
 //=============================================================================
@@ -687,13 +694,13 @@ SALOME_MED::Group_array *
  */
 //=============================================================================
 SALOME_MED::GROUP_ptr SMESH_MEDMesh_i::getGroup(SALOME_MED::
-       medEntityMesh entity, CORBA::Long i) throw(SALOME::SALOME_Exception)
+                                                medEntityMesh entity, CORBA::Long i) throw(SALOME::SALOME_Exception)
 {
-       if (_mesh_i == 0)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       MESSAGE(" Pas d implementation des groupes dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("No group implementation", SALOME::BAD_PARAM);
+  if (_mesh_i == 0)
+    THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                                 SALOME::INTERNAL_ERROR);
+  MESSAGE(" Pas d implementation des groupes dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("No group implementation", SALOME::BAD_PARAM);
 }
 //=============================================================================
 /*!
@@ -764,11 +771,11 @@ SMESH_MEDMesh_i::getSkin(SALOME_MED::SUPPORT_ptr mySupport3D)
  */
 //=============================================================================
 SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getVolume(SALOME_MED::
-       SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
+                                                 SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -777,11 +784,11 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getVolume(SALOME_MED::
  */
 //=============================================================================
 SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getArea(SALOME_MED::
-       SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
+                                               SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -790,11 +797,11 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getArea(SALOME_MED::
  */
 //=============================================================================
 SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getLength(SALOME_MED::
-       SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
+                                                 SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -803,11 +810,11 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getLength(SALOME_MED::
  */
 //=============================================================================
 SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNormal(SALOME_MED::
-       SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
+                                                 SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -816,11 +823,11 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNormal(SALOME_MED::
  */
 //=============================================================================
 SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getBarycenter(SALOME_MED::
-       SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
+                                                     SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Pas Implemente dans SMESH");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Pas Implemente dans SMESH");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -829,11 +836,11 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getBarycenter(SALOME_MED::
  */
 //=============================================================================
 SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNeighbourhood(SALOME_MED::
-       SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
+                                                        SUPPORT_ptr mySupport) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Non Implemente");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Non Implemente");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -843,57 +850,57 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNeighbourhood(SALOME_MED::
  */
 //=============================================================================
 void SMESH_MEDMesh_i::addInStudy(SALOMEDS::Study_ptr myStudy,
-       SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception)
+                                 SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception)
 {
-       BEGIN_OF("MED_Mesh_i::addInStudy");
-       if (_meshId != "")
-       {
-               MESSAGE("Mesh already in Study");
-               THROW_SALOME_CORBA_EXCEPTION("Mesh already in Study",
-                       SALOME::BAD_PARAM);
-       };
-
-       /*
-        * SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder();
-        
-        * // Create SComponent labelled 'MED' if it doesn't already exit
-        * SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED");
-        * if ( CORBA::is_nil(medfather) ) 
-        * {
-        * MESSAGE("Add Component MED");
-        * medfather = myBuilder->NewComponent("MED");
-        * //myBuilder->AddAttribute (medfather,SALOMEDS::Name,"MED");
-        * SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(
-        * myBuilder->FindOrCreateAttribute(medfather, "AttributeName"));
-        * aName->SetValue("MED");
-        
-        * myBuilder->DefineComponentInstance(medfather,myIor);
-        
-        * } ;
-        
-        * MESSAGE("Add a mesh Object under MED");
-        * myBuilder->NewCommand();
-        * SALOMEDS::SObject_var newObj = myBuilder->NewObject(medfather);
-        
-        * ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-        * ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
-        * CORBA::ORB_var &orb = init(0,0);
-        * CORBA::String_var iorStr = orb->object_to_string(myIor);
-        * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.in());
-        * SALOMEDS::AttributeIOR_var aIOR = SALOMEDS::AttributeIOR::_narrow(
-        * myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"));
-        * aIOR->SetValue(iorStr.c_str());
-        
-        * //myBuilder->AddAttribute(newObj,SALOMEDS::Name,_mesh_i->getName().c_str());
-        * SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(
-        * myBuilder->FindOrCreateAttribute(newObj, "AttributeName"));
-        * aName->SetValue(_mesh_i->getName().c_str());
-        
-        * _meshId = newObj->GetID();
-        * myBuilder->CommitCommand();
-        
-        */
-       END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
+  BEGIN_OF("MED_Mesh_i::addInStudy");
+  if (_meshId != "")
+  {
+    MESSAGE("Mesh already in Study");
+    THROW_SALOME_CORBA_EXCEPTION("Mesh already in Study",
+                                 SALOME::BAD_PARAM);
+  };
+
+  /*
+   * SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder();
+   * 
+   * // Create SComponent labelled 'MED' if it doesn't already exit
+   * SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED");
+   * if ( CORBA::is_nil(medfather) ) 
+   * {
+   * MESSAGE("Add Component MED");
+   * medfather = myBuilder->NewComponent("MED");
+   * //myBuilder->AddAttribute (medfather,SALOMEDS::Name,"MED");
+   * SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(
+   * myBuilder->FindOrCreateAttribute(medfather, "AttributeName"));
+   * aName->SetValue("MED");
+   * 
+   * myBuilder->DefineComponentInstance(medfather,myIor);
+   * 
+   * } ;
+   * 
+   * MESSAGE("Add a mesh Object under MED");
+   * myBuilder->NewCommand();
+   * SALOMEDS::SObject_var newObj = myBuilder->NewObject(medfather);
+   * 
+   * ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+   * ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
+   * CORBA::ORB_var &orb = init(0,0);
+   * CORBA::String_var iorStr = orb->object_to_string(myIor);
+   * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.in());
+   * SALOMEDS::AttributeIOR_var aIOR = SALOMEDS::AttributeIOR::_narrow(
+   * myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"));
+   * aIOR->SetValue(iorStr.c_str());
+   * 
+   * //myBuilder->AddAttribute(newObj,SALOMEDS::Name,_mesh_i->getName().c_str());
+   * SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(
+   * myBuilder->FindOrCreateAttribute(newObj, "AttributeName"));
+   * aName->SetValue(_mesh_i->getName().c_str());
+   * 
+   * _meshId = newObj->GetID();
+   * myBuilder->CommitCommand();
+   * 
+   */
+  END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
 }
 
 //=============================================================================
@@ -902,10 +909,10 @@ void SMESH_MEDMesh_i::addInStudy(SALOMEDS::Study_ptr myStudy,
  */
 //=============================================================================
 void SMESH_MEDMesh_i::write(CORBA::Long i, const char *driverMeshName)
-throw(SALOME::SALOME_Exception)
+  throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Non Implemente");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  MESSAGE("Non Implemente");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
 }
 
 //=============================================================================
@@ -915,8 +922,8 @@ throw(SALOME::SALOME_Exception)
 //=============================================================================
 void SMESH_MEDMesh_i::read(CORBA::Long i) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Non Implemente");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  MESSAGE("Non Implemente");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
 }
 
 //=============================================================================
@@ -926,8 +933,8 @@ void SMESH_MEDMesh_i::read(CORBA::Long i) throw(SALOME::SALOME_Exception)
 //=============================================================================
 void SMESH_MEDMesh_i::rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Non Implemente");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  MESSAGE("Non Implemente");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
 }
 
 //=============================================================================
@@ -936,11 +943,11 @@ void SMESH_MEDMesh_i::rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception)
  */
 //=============================================================================
 CORBA::Long SMESH_MEDMesh_i::addDriver(SALOME_MED::medDriverTypes driverType,
-       const char *fileName, const char *meshName) throw(SALOME::SALOME_Exception)
+                                       const char *fileName, const char *meshName) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Non Implemente");
-       THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
-       return 0;
+  MESSAGE("Non Implemente");
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+  return 0;
 }
 
 //=============================================================================
@@ -950,174 +957,174 @@ CORBA::Long SMESH_MEDMesh_i::addDriver(SALOME_MED::medDriverTypes driverType,
 //=============================================================================
 void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
 {
-       if (!_compte)
-       {
-               _compte = true;
-
-               _mapNbTypes[SALOME_MED::MED_NODE] = 1;
-               // On compte les aretes MED_SEG2 ou MED_SEG3
-               // On range les elements dans  les vecteurs correspondants 
-
-               _mapIndToSeqElts[SALOME_MED::MED_SEG2] = _indexElts++;
-               _mapIndToSeqElts[SALOME_MED::MED_SEG3] = _indexElts++;
-               _mapIndToVectTypes[SALOME_MED::MED_EDGE] = _indexEnts++;
-
-               int trouveSeg2 = 0;
-               int trouveSeg3 = 0;
-               SALOME_MED::medGeometryElement medElement;
-
-               SMDS_EdgeIteratorPtr itEdges=_meshDS->edgesIterator();
-               while(itEdges->more())
-               {
-                       const SMDS_MeshEdge* elem = itEdges->next();
-                       int nb_of_nodes = elem->NbNodes();
-
-                       switch (nb_of_nodes)
-                       {
-                       case 2:
-                       {
-                               medElement = SALOME_MED::MED_SEG2;
-                               if (trouveSeg2 == 0)
-                               {
-                                       trouveSeg2 = 1;
-                                       _TypesId[SALOME_MED::MED_EDGE].
-                                               push_back(SALOME_MED::MED_SEG2);
-                               }
-                               break;
-                       }
-                       case 3:
-                       {
-                               medElement = SALOME_MED::MED_SEG3;
-                               if (trouveSeg3 == 0)
-                               {
-                                       trouveSeg3 = 1;
-                                       _TypesId[SALOME_MED::MED_EDGE].
-                                               push_back(SALOME_MED::MED_SEG3);
-                               }
-                               break;
-                       }
-                       }
-                       int index = _mapIndToSeqElts[medElement];
-                       SCRUTE(index);
-                       // Traitement de l arete
-
-                       int longueur = _seq_elemId[index]->length();
-                       _seq_elemId[index]->length(longueur + nb_of_nodes);
-
-                       SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
-
-                       for(int k=0; itn->more(); k++)
-                               _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
-               }
-
-               _mapNbTypes[SALOME_MED::MED_EDGE] = trouveSeg2 + trouveSeg3;
-
-               // On compte les faces MED_TRIA3, MED_HEXA8, MED_TRIA6
-               // On range les elements dans  les vecteurs correspondants 
-               int trouveTria3 = 0;
-               int trouveTria6 = 0;
-               int trouveQuad4 = 0;
-
-               _mapIndToSeqElts[SALOME_MED::MED_TRIA3] = _indexElts++;
-               _mapIndToSeqElts[SALOME_MED::MED_TRIA6] = _indexElts++;
-               _mapIndToSeqElts[SALOME_MED::MED_QUAD4] = _indexElts++;
-               _mapIndToVectTypes[SALOME_MED::MED_FACE] = _indexEnts++;
-
-               SMDS_FaceIteratorPtr itFaces=_meshDS->facesIterator();
-               while(itFaces->more())
-               {
-                       const SMDS_MeshFace * elem = itFaces->next();
-                       int nb_of_nodes = elem->NbNodes();
-
-                       switch (nb_of_nodes)
-                       {
-                       case 3:
-                       {
-                               medElement = SALOME_MED::MED_TRIA3;
-                               if (trouveTria3 == 0)
-                               {
-                                       trouveTria3 = 1;
-                                       _TypesId[SALOME_MED::MED_FACE].
-                                               push_back(SALOME_MED::MED_TRIA3);
-                               }
-                               break;
-                       }
-                       case 4:
-                       {
-                               medElement = SALOME_MED::MED_QUAD4;
-                               if (trouveQuad4 == 0)
-                               {
-                                       trouveQuad4 = 1;
-                                       _TypesId[SALOME_MED::MED_FACE].
-                                               push_back(SALOME_MED::MED_QUAD4);
-                               }
-                               break;
-                       }
-                       case 6:
-                       {
-                               medElement = SALOME_MED::MED_TRIA6;
-                               if (trouveTria6 == 0)
-                               {
-                                       trouveTria6 = 1;
-                                       _TypesId[SALOME_MED::MED_FACE].
-                                               push_back(SALOME_MED::MED_TRIA6);
-                               }
-                               break;
-                       }
-                       }
-                       int index = _mapIndToSeqElts[medElement];
-                       SCRUTE(index);
-
-                       // Traitement de la face
-                       // Attention La numérotation des noeuds Med commence a 1
-
-                       int longueur = _seq_elemId[index]->length();
-                       _seq_elemId[index]->length(longueur + nb_of_nodes);
-
-                       SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
-
-                       for(int k=0; itn->more(); k++)
-                               _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
-               } //itFaces
-
-               _mapNbTypes[SALOME_MED::MED_FACE] =
-                       trouveTria3 + trouveTria6 + trouveQuad4;
-
-               _mapIndToSeqElts[SALOME_MED::MED_HEXA8] = _indexElts++;
-               _mapIndToVectTypes[SALOME_MED::MED_CELL] = _indexEnts++;
-               int index = _mapIndToSeqElts[medElement];
-
-               int trouveHexa8 = 0;
-
-               SMDS_VolumeIteratorPtr itVolumes=_meshDS->volumesIterator();
-               while(itVolumes->more())
-               {
-                       const SMDS_MeshVolume * elem = itVolumes->next();
-
-                       int nb_of_nodes = elem->NbNodes();
-                       medElement = SALOME_MED::MED_HEXA8;
-                       ASSERT(nb_of_nodes == 8);
-
-                       if (trouveHexa8 == 0)
-                       {
-                               trouveHexa8 = 1;
-                               _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MED_HEXA8);
-                       };
-                       // Traitement de la maille
-                       int longueur = _seq_elemId[index]->length();
-                       _seq_elemId[index]->length(longueur + nb_of_nodes);
-
-                       SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
-                       for(int k=0; itn->more(); k++)
-                               _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
-               }
-
-               _mapNbTypes[SALOME_MED::MED_CELL] = trouveHexa8;
-               _mapNbTypes[SALOME_MED::MED_ALL_ENTITIES]
-                       =
-                       trouveHexa8 + trouveTria3 + trouveTria6 + trouveQuad4 + trouveSeg2 +
-                       trouveSeg3;
-       }// fin du _compte
+  if (!_compte)
+  {
+    _compte = true;
+
+    _mapNbTypes[SALOME_MED::MED_NODE] = 1;
+    // On compte les aretes MED_SEG2 ou MED_SEG3
+    // On range les elements dans  les vecteurs correspondants 
+
+    _mapIndToSeqElts[SALOME_MED::MED_SEG2] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MED_SEG3] = _indexElts++;
+    _mapIndToVectTypes[SALOME_MED::MED_EDGE] = _indexEnts++;
+
+    int trouveSeg2 = 0;
+    int trouveSeg3 = 0;
+    SALOME_MED::medGeometryElement medElement;
+
+    SMDS_EdgeIteratorPtr itEdges=_meshDS->edgesIterator();
+    while(itEdges->more())
+    {
+      const SMDS_MeshEdge* elem = itEdges->next();
+      int nb_of_nodes = elem->NbNodes();
+
+      switch (nb_of_nodes)
+      {
+      case 2:
+        {
+          medElement = SALOME_MED::MED_SEG2;
+          if (trouveSeg2 == 0)
+          {
+            trouveSeg2 = 1;
+            _TypesId[SALOME_MED::MED_EDGE].
+              push_back(SALOME_MED::MED_SEG2);
+          }
+          break;
+        }
+      case 3:
+        {
+          medElement = SALOME_MED::MED_SEG3;
+          if (trouveSeg3 == 0)
+          {
+            trouveSeg3 = 1;
+            _TypesId[SALOME_MED::MED_EDGE].
+              push_back(SALOME_MED::MED_SEG3);
+          }
+          break;
+        }
+      }
+      int index = _mapIndToSeqElts[medElement];
+      SCRUTE(index);
+      // Traitement de l arete
+
+      int longueur = _seq_elemId[index]->length();
+      _seq_elemId[index]->length(longueur + nb_of_nodes);
+
+      SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
+
+      for(int k=0; itn->more(); k++)
+        _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
+    }
+
+    _mapNbTypes[SALOME_MED::MED_EDGE] = trouveSeg2 + trouveSeg3;
+
+    // On compte les faces MED_TRIA3, MED_HEXA8, MED_TRIA6
+    // On range les elements dans  les vecteurs correspondants 
+    int trouveTria3 = 0;
+    int trouveTria6 = 0;
+    int trouveQuad4 = 0;
+
+    _mapIndToSeqElts[SALOME_MED::MED_TRIA3] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MED_TRIA6] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MED_QUAD4] = _indexElts++;
+    _mapIndToVectTypes[SALOME_MED::MED_FACE] = _indexEnts++;
+
+    SMDS_FaceIteratorPtr itFaces=_meshDS->facesIterator();
+    while(itFaces->more())
+    {
+      const SMDS_MeshFace * elem = itFaces->next();
+      int nb_of_nodes = elem->NbNodes();
+
+      switch (nb_of_nodes)
+      {
+      case 3:
+        {
+          medElement = SALOME_MED::MED_TRIA3;
+          if (trouveTria3 == 0)
+          {
+            trouveTria3 = 1;
+            _TypesId[SALOME_MED::MED_FACE].
+              push_back(SALOME_MED::MED_TRIA3);
+          }
+          break;
+        }
+      case 4:
+        {
+          medElement = SALOME_MED::MED_QUAD4;
+          if (trouveQuad4 == 0)
+          {
+            trouveQuad4 = 1;
+            _TypesId[SALOME_MED::MED_FACE].
+              push_back(SALOME_MED::MED_QUAD4);
+          }
+          break;
+        }
+      case 6:
+        {
+          medElement = SALOME_MED::MED_TRIA6;
+          if (trouveTria6 == 0)
+          {
+            trouveTria6 = 1;
+            _TypesId[SALOME_MED::MED_FACE].
+              push_back(SALOME_MED::MED_TRIA6);
+          }
+          break;
+        }
+      }
+      int index = _mapIndToSeqElts[medElement];
+      SCRUTE(index);
+
+      // Traitement de la face
+      // Attention La numérotation des noeuds Med commence a 1
+
+      int longueur = _seq_elemId[index]->length();
+      _seq_elemId[index]->length(longueur + nb_of_nodes);
+
+      SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
+
+      for(int k=0; itn->more(); k++)
+        _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
+    } //itFaces
+
+    _mapNbTypes[SALOME_MED::MED_FACE] =
+      trouveTria3 + trouveTria6 + trouveQuad4;
+
+    _mapIndToSeqElts[SALOME_MED::MED_HEXA8] = _indexElts++;
+    _mapIndToVectTypes[SALOME_MED::MED_CELL] = _indexEnts++;
+    int index = _mapIndToSeqElts[medElement];
+
+    int trouveHexa8 = 0;
+
+    SMDS_VolumeIteratorPtr itVolumes=_meshDS->volumesIterator();
+    while(itVolumes->more())
+    {
+      const SMDS_MeshVolume * elem = itVolumes->next();
+
+      int nb_of_nodes = elem->NbNodes();
+      medElement = SALOME_MED::MED_HEXA8;
+      ASSERT(nb_of_nodes == 8);
+
+      if (trouveHexa8 == 0)
+      {
+        trouveHexa8 = 1;
+        _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MED_HEXA8);
+      };
+      // Traitement de la maille
+      int longueur = _seq_elemId[index]->length();
+      _seq_elemId[index]->length(longueur + nb_of_nodes);
+
+      SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
+      for(int k=0; itn->more(); k++)
+        _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
+    }
+
+    _mapNbTypes[SALOME_MED::MED_CELL] = trouveHexa8;
+    _mapNbTypes[SALOME_MED::MED_ALL_ENTITIES]
+      =
+      trouveHexa8 + trouveTria3 + trouveTria6 + trouveQuad4 + trouveSeg2 +
+      trouveSeg3;
+  }// fin du _compte
 };
 
 //=============================================================================
@@ -1128,42 +1135,42 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
 void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
-       string famDes = ("Je ne sais pas");
-       string famName0 = "Famille_";
-       string famName;
-       char numero[10];
-
-       if (_creeFamily == false)
-       {
-               _creeFamily = true;
-               //SMESH_subMesh_i *subMeshServant;
-
-               map < int, SMESH_subMesh_i * >::iterator it;
-               for (it = _mesh_i->_mapSubMesh_i.begin();
-                       it != _mesh_i->_mapSubMesh_i.end(); it++)
-               {
-                       SMESH_subMesh_i *submesh_i = (*it).second;
-                       int famIdent = (*it).first;
-
-                       ASSERT(famIdent < 999999999);
-                       sprintf(numero, "%d\n", famIdent);
-                       famName = famName0 + numero;
-
-                       SMESH_MEDFamily_i *famservant =
-                               new SMESH_MEDFamily_i(famIdent, submesh_i,
-                               famName, famDes, SALOME_MED::MED_NODE);
+  string famDes = ("Je ne sais pas");
+  string famName0 = "Famille_";
+  string famName;
+  char numero[10];
+
+  if (_creeFamily == false)
+  {
+    _creeFamily = true;
+    //SMESH_subMesh_i *subMeshServant;
+
+    map < int, SMESH_subMesh_i * >::iterator it;
+    for (it = _mesh_i->_mapSubMesh_i.begin();
+         it != _mesh_i->_mapSubMesh_i.end(); it++)
+    {
+      SMESH_subMesh_i *submesh_i = (*it).second;
+      int famIdent = (*it).first;
+
+      ASSERT(famIdent < 999999999);
+      sprintf(numero, "%d\n", famIdent);
+      famName = famName0 + numero;
+
+      SMESH_MEDFamily_i *famservant =
+        new SMESH_MEDFamily_i(famIdent, submesh_i,
+                              famName, famDes, SALOME_MED::MED_NODE);
 #ifdef WNT
       SALOME_MED::FAMILY_ptr famille = SALOME_MED::FAMILY::_nil();
       POA_SALOME_MED::FAMILY* servantbase = dynamic_cast<POA_SALOME_MED::FAMILY*>(famservant);
       if ( servantbase )
         famille = SALOME_MED::FAMILY::_narrow( servantbase->_this() );
 #else 
-               SALOME_MED::FAMILY_ptr famille = 
+      SALOME_MED::FAMILY_ptr famille = 
         SALOME_MED::FAMILY::_narrow( famservant->POA_SALOME_MED::FAMILY::_this() );
 #endif
-                       _families.push_back(famille);
-               }
-       }
+      _families.push_back(famille);
+    }
+  }
 };
 //=============================================================================
 /*!
@@ -1216,7 +1223,7 @@ SMESH_MEDMesh_i::getConnectGlobal(SALOME_MED::medEntityMesh entity)
 //=============================================================================
 SALOME_MED::medGeometryElement
 SMESH_MEDMesh_i::getElementType(SALOME_MED::medEntityMesh entity,
-                               CORBA::Long number)
+                                CORBA::Long number)
   throw (SALOME::SALOME_Exception)
 {
   MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!");
index 8e56e0e796f41b9ecabf9cc5b883268e1d10ca40..72b31032e81f37d8c13b9c98ac7024395f546be9 100644 (file)
@@ -82,9 +82,9 @@ public:
   void release() {}
   SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch) {return SALOME::SenderDouble::_nil();}
   SALOME::SenderInt_ptr getSenderForConnectivity(SALOME_MED::medModeSwitch, 
-                                                SALOME_MED::medConnectivity, 
-                                                SALOME_MED::medEntityMesh, 
-                                                SALOME_MED::medGeometryElement) 
+                                                 SALOME_MED::medConnectivity, 
+                                                 SALOME_MED::medEntityMesh, 
+                                                 SALOME_MED::medGeometryElement) 
   {
     return SALOME::SenderInt::_nil();
   }
@@ -103,7 +103,7 @@ public:
   
   CORBA::Boolean
   existConnectivity(SALOME_MED::medConnectivity connectivityType,
-                   SALOME_MED::medEntityMesh entity)
+                    SALOME_MED::medEntityMesh entity)
     throw (SALOME::SALOME_Exception);
   
   char *getCoordinatesSystem() throw(SALOME::SALOME_Exception);
@@ -127,27 +127,27 @@ public:
   
   SALOME_MED::medGeometryElement_array *
   getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
-                                                  SALOME_Exception);
+                                                   SALOME_Exception);
   
   SALOME_MED::medGeometryElement
   getElementType(SALOME_MED::medEntityMesh entity,
-                CORBA::Long number)
+                 CORBA::Long number)
     throw   (SALOME::SALOME_Exception);
   
   CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity,
-                                 SALOME_MED::medGeometryElement geomElement)
+                                  SALOME_MED::medGeometryElement geomElement)
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::long_array *
   getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
-                 SALOME_MED::medConnectivity mode,
-                 SALOME_MED::medEntityMesh entity,
-                 SALOME_MED::medGeometryElement geomElement)
+                  SALOME_MED::medConnectivity mode,
+                  SALOME_MED::medEntityMesh entity,
+                  SALOME_MED::medGeometryElement geomElement)
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::long_array *
   getConnectivityIndex(SALOME_MED::medConnectivity mode,
-                      SALOME_MED::medEntityMesh entity)
+                       SALOME_MED::medEntityMesh entity)
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::long_array*
@@ -155,9 +155,9 @@ public:
     throw (SALOME::SALOME_Exception);
   
   CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode,
-                              SALOME_MED::medEntityMesh entity,
-                              SALOME_MED::medGeometryElement type,
-                              const SALOME_MED::long_array & connectivity)
+                               SALOME_MED::medEntityMesh entity,
+                               SALOME_MED::medGeometryElement type,
+                               const SALOME_MED::long_array & connectivity)
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::long_array *
@@ -180,14 +180,14 @@ public:
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity,
-                                  CORBA::Long i) 
+                                   CORBA::Long i) 
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity)
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity,
-                                CORBA::Long i) 
+                                 CORBA::Long i) 
     throw(SALOME::SALOME_Exception);
   
   SALOME_MED::SUPPORT_ptr
@@ -221,10 +221,10 @@ public:
   
   // Others
   void addInStudy(SALOMEDS::Study_ptr myStudy,
-                 SALOME_MED::MESH_ptr myIor) 
+                  SALOME_MED::MESH_ptr myIor) 
     throw(SALOME::SALOME_Exception);
   CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType,
-                       const char *fileName, const char *meshName)
+                        const char *fileName, const char *meshName)
     throw(SALOME::SALOME_Exception);
   void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception);
   void read(CORBA::Long i) throw(SALOME::SALOME_Exception);
index 56f3b73ebeec67e8f97815a7594bdc38580703bc..4b1e66ddf0fb8444b67a6493dbe461de1ee65088 100644 (file)
@@ -45,8 +45,8 @@ using namespace std;
 //=============================================================================
 SMESH_MEDSupport_i::SMESH_MEDSupport_i()
 {
-       BEGIN_OF("Default Constructor SMESH_MEDSupport_i");
-       END_OF("Default Constructor SMESH_MEDSupport_i");
+        BEGIN_OF("Default Constructor SMESH_MEDSupport_i");
+        END_OF("Default Constructor SMESH_MEDSupport_i");
 }
 
 //=============================================================================
@@ -55,40 +55,40 @@ SMESH_MEDSupport_i::SMESH_MEDSupport_i()
  */
 //=============================================================================
 SMESH_MEDSupport_i::SMESH_MEDSupport_i(SMESH_subMesh_i * sm, string name,
-       string description, SALOME_MED::medEntityMesh entity)
-       :_subMesh_i(sm), _name(name), _description(description), _entity(entity),
-       _seqNumber(false), _seqLength(0)
+        string description, SALOME_MED::medEntityMesh entity)
+        :_subMesh_i(sm), _name(name), _description(description), _entity(entity),
+        _seqNumber(false), _seqLength(0)
 {
-       BEGIN_OF("Constructor SMESH_MEDSupport_i");
-
-       _meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
-
-       int subMeshId = _subMesh_i->GetId();
-
-       MESSAGE(" subMeshId " << subMeshId)
-
-       if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) !=
-               _subMesh_i->_mesh_i->_mapSubMesh.end())
-       {
-               ::SMESH_subMesh * subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
-               _subMeshDS = subMesh->GetSubMeshDS();
-       }
-
-       if (_entity == SALOME_MED::MED_NODE)
-       {
-               _numberOfGeometricType = 1;
-               _geometricType = new SALOME_MED::medGeometryElement[1];
-               _geometricType[0] = SALOME_MED::MED_NONE;
-       }
-       else
-       {
-               MESSAGE("Pas implemente dans cette version");
-               THROW_SALOME_CORBA_EXCEPTION
-                       ("Seules les familles de noeuds sont implementees ",
-                       SALOME::BAD_PARAM);
-       }
-
-       END_OF("Constructor SMESH_MEDSupport_i");
+        BEGIN_OF("Constructor SMESH_MEDSupport_i");
+
+        _meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
+
+        int subMeshId = _subMesh_i->GetId();
+
+        MESSAGE(" subMeshId " << subMeshId)
+
+        if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) !=
+                _subMesh_i->_mesh_i->_mapSubMesh.end())
+        {
+                ::SMESH_subMesh * subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
+                _subMeshDS = subMesh->GetSubMeshDS();
+        }
+
+        if (_entity == SALOME_MED::MED_NODE)
+        {
+                _numberOfGeometricType = 1;
+                _geometricType = new SALOME_MED::medGeometryElement[1];
+                _geometricType[0] = SALOME_MED::MED_NONE;
+        }
+        else
+        {
+                MESSAGE("Pas implemente dans cette version");
+                THROW_SALOME_CORBA_EXCEPTION
+                        ("Seules les familles de noeuds sont implementees ",
+                        SALOME::BAD_PARAM);
+        }
+
+        END_OF("Constructor SMESH_MEDSupport_i");
 }
 
 //=============================================================================
@@ -101,19 +101,19 @@ SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s):_subMesh_i(s._subMesh_i),
 _name(s._name), _description(s._description), _entity(s._entity),
 _seqNumber(false), _seqLength(0)
 {
-       BEGIN_OF("Constructor SMESH_MEDSupport_i");
+        BEGIN_OF("Constructor SMESH_MEDSupport_i");
 
-       _meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
+        _meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
 
-       int subMeshId = _subMesh_i->GetId();
-       if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) !=
-               _subMesh_i->_mesh_i->_mapSubMesh.end())
-       {
-               ::SMESH_subMesh * subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
-               _subMeshDS = subMesh->GetSubMeshDS();
-       }
+        int subMeshId = _subMesh_i->GetId();
+        if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) !=
+                _subMesh_i->_mesh_i->_mapSubMesh.end())
+        {
+                ::SMESH_subMesh * subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
+                _subMeshDS = subMesh->GetSubMeshDS();
+        }
 
-       END_OF("Constructor SMESH_MEDSupport_i");
+        END_OF("Constructor SMESH_MEDSupport_i");
 }
 
 //=============================================================================
@@ -134,11 +134,11 @@ SMESH_MEDSupport_i::~SMESH_MEDSupport_i()
 
 CORBA::Long SMESH_MEDSupport_i::getCorbaIndex()throw(SALOME::SALOME_Exception)
 {
-       if (_subMeshDS == NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       MESSAGE("Not implemented for SMESH_i");
-       THROW_SALOME_CORBA_EXCEPTION("Not Implemented ", SALOME::BAD_PARAM);
+        if (_subMeshDS == NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        MESSAGE("Not implemented for SMESH_i");
+        THROW_SALOME_CORBA_EXCEPTION("Not Implemented ", SALOME::BAD_PARAM);
 
 }
 
@@ -150,10 +150,10 @@ CORBA::Long SMESH_MEDSupport_i::getCorbaIndex()throw(SALOME::SALOME_Exception)
 
 char *SMESH_MEDSupport_i::getName() throw(SALOME::SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       return CORBA::string_dup(_name.c_str());
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        return CORBA::string_dup(_name.c_str());
 
 }
 
@@ -165,10 +165,10 @@ char *SMESH_MEDSupport_i::getName() throw(SALOME::SALOME_Exception)
 
 char *SMESH_MEDSupport_i::getDescription() throw(SALOME::SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       return CORBA::string_dup(_description.c_str());
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        return CORBA::string_dup(_description.c_str());
 }
 
 //=============================================================================
@@ -178,13 +178,13 @@ char *SMESH_MEDSupport_i::getDescription() throw(SALOME::SALOME_Exception)
 //=============================================================================
 
 SALOME_MED::MESH_ptr SMESH_MEDSupport_i::getMesh()throw(SALOME::
-       SALOME_Exception)
+        SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
 
-       return _subMesh_i->_mesh_i->GetMEDMesh();
+        return _subMesh_i->_mesh_i->GetMEDMesh();
 }
 
 //=============================================================================
@@ -194,36 +194,36 @@ SALOME_MED::MESH_ptr SMESH_MEDSupport_i::getMesh()throw(SALOME::
 //=============================================================================
 
 CORBA::Boolean SMESH_MEDSupport_i::isOnAllElements()throw(SALOME::
-       SALOME_Exception)
+        SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       if (_seqNumber == false)
-       {
-               if (_entity != SALOME_MED::MED_NONE)
-               {
-                       _seqLength = _subMeshDS->NbNodes();
-                       _seqNumber = true;
-               }
-               else
-               {
-                       MESSAGE("Only Node Families are implemented ");
-                       THROW_SALOME_CORBA_EXCEPTION("Not implemented Yet ",
-                               SALOME::BAD_PARAM);
-               }
-       }
-       try
-       {
-               _isOnAllElements = (_seqLength == _meshDS->NbNodes());
-       }
-       catch(...)
-       {
-               MESSAGE("unable to acces related Mesh");
-               THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
-                       SALOME::INTERNAL_ERROR);
-       };
-       return _isOnAllElements;
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        if (_seqNumber == false)
+        {
+                if (_entity != SALOME_MED::MED_NONE)
+                {
+                        _seqLength = _subMeshDS->NbNodes();
+                        _seqNumber = true;
+                }
+                else
+                {
+                        MESSAGE("Only Node Families are implemented ");
+                        THROW_SALOME_CORBA_EXCEPTION("Not implemented Yet ",
+                                SALOME::BAD_PARAM);
+                }
+        }
+        try
+        {
+                _isOnAllElements = (_seqLength == _meshDS->NbNodes());
+        }
+        catch(...)
+        {
+                MESSAGE("unable to acces related Mesh");
+                THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
+                        SALOME::INTERNAL_ERROR);
+        };
+        return _isOnAllElements;
 }
 
 //=============================================================================
@@ -233,12 +233,12 @@ CORBA::Boolean SMESH_MEDSupport_i::isOnAllElements()throw(SALOME::
 //=============================================================================
 
 SALOME_MED::medEntityMesh SMESH_MEDSupport_i::getEntity()throw(SALOME::
-       SALOME_Exception)
+        SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       return _entity;
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        return _entity;
 }
 
 //=============================================================================
@@ -248,29 +248,29 @@ SALOME_MED::medEntityMesh SMESH_MEDSupport_i::getEntity()throw(SALOME::
 //=============================================================================
 
 SALOME_MED::medGeometryElement_array *
-       SMESH_MEDSupport_i::getTypes()throw(SALOME::SALOME_Exception)
+        SMESH_MEDSupport_i::getTypes()throw(SALOME::SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       SALOME_MED::medGeometryElement_array_var myseq =
-               new SALOME_MED::medGeometryElement_array;
-       try
-       {
-               int mySeqLength = _numberOfGeometricType;
-               myseq->length(mySeqLength);
-               for (int i = 0; i < mySeqLength; i++)
-               {
-                       myseq[i] = _geometricType[i];
-               }
-       }
-       catch(...)
-       {
-               MESSAGE("Exception lors de la recherche des differents types");
-               THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support Types",
-                       SALOME::INTERNAL_ERROR);
-       }
-       return myseq._retn();
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        SALOME_MED::medGeometryElement_array_var myseq =
+                new SALOME_MED::medGeometryElement_array;
+        try
+        {
+                int mySeqLength = _numberOfGeometricType;
+                myseq->length(mySeqLength);
+                for (int i = 0; i < mySeqLength; i++)
+                {
+                        myseq[i] = _geometricType[i];
+                }
+        }
+        catch(...)
+        {
+                MESSAGE("Exception lors de la recherche des differents types");
+                THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support Types",
+                        SALOME::INTERNAL_ERROR);
+        }
+        return myseq._retn();
 }
 
 //=============================================================================
@@ -280,12 +280,12 @@ SALOME_MED::medGeometryElement_array *
  */
 //=============================================================================
 CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED::
-       medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
+        medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
 {
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
-       return _numberOfGeometricType;
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
+        return _numberOfGeometricType;
 
 }
 
@@ -296,32 +296,32 @@ CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED::
 //=============================================================================
 
 SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber(
-       SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
+        SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
-       if (_subMeshDS==NULL)
-               THROW_SALOME_CORBA_EXCEPTION("No associated Support",
-                       SALOME::INTERNAL_ERROR);
+        if (_subMeshDS==NULL)
+                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
+                        SALOME::INTERNAL_ERROR);
 
-       // A changer s'il ne s agit plus seulement de famille de noeuds
-       if (geomElement != SALOME_MED::MED_NONE)
-               THROW_SALOME_CORBA_EXCEPTION("Not implemented", SALOME::BAD_PARAM);
+        // A changer s'il ne s agit plus seulement de famille de noeuds
+        if (geomElement != SALOME_MED::MED_NONE)
+                THROW_SALOME_CORBA_EXCEPTION("Not implemented", SALOME::BAD_PARAM);
 
-       SALOME_MED::long_array_var myseq = new SALOME_MED::long_array;
+        SALOME_MED::long_array_var myseq = new SALOME_MED::long_array;
 
-       int i = 0;
-       myseq->length(_subMeshDS->NbNodes());
+        int i = 0;
+        myseq->length(_subMeshDS->NbNodes());
 
-       SMDS_NodeIteratorPtr it = _subMeshDS->GetNodes();
-       while(it->more())
-       {
-               myseq[i] = it->next()->GetID();
-               i++;
-       };
+        SMDS_NodeIteratorPtr it = _subMeshDS->GetNodes();
+        while(it->more())
+        {
+                myseq[i] = it->next()->GetID();
+                i++;
+        };
 
-       SCRUTE(myseq->length());
-       MESSAGE("End of SMESH_MEDSupport_i::getNumber");
-       return myseq._retn();
+        SCRUTE(myseq->length());
+        MESSAGE("End of SMESH_MEDSupport_i::getNumber");
+        return myseq._retn();
 
 }
 
@@ -332,7 +332,7 @@ SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber(
 //=============================================================================
 
 SALOME_MED::long_array * SMESH_MEDSupport_i::getNumberFromFile(
-       SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
+        SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
 {
   return getNumber(geomElement);
 }
@@ -345,11 +345,11 @@ SALOME_MED::long_array * SMESH_MEDSupport_i::getNumberFromFile(
 //=============================================================================
 
 SALOME_MED::long_array *
-       SMESH_MEDSupport_i::getNumberIndex()throw(SALOME::SALOME_Exception)
+        SMESH_MEDSupport_i::getNumberIndex()throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Not implemented for SMESH_i");
-       THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
-       return NULL;
+        MESSAGE("Not implemented for SMESH_i");
+        THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
+        return NULL;
 }
 //=============================================================================
 /*!
@@ -358,10 +358,10 @@ SALOME_MED::long_array *
 //=============================================================================
 
 CORBA::Long SMESH_MEDSupport_i::getNumberOfGaussPoint(SALOME_MED::
-       medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
+        medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
 {
-       MESSAGE("Not implemented for SMESH_i");
-       return 0;
+        MESSAGE("Not implemented for SMESH_i");
+        return 0;
 }
 //=============================================================================
 /*!
index 15cf3b8f4fa8ce0e021d98ccb22aae14114c4ed6..56c36a881466bebb9707bb31191f539d2deb8fbe 100644 (file)
 class SMESH_subMesh_i;
 
 class SMESH_I_EXPORT SMESH_MEDSupport_i:
-       public virtual POA_SALOME_MED::SUPPORT, public virtual SALOME::GenericObj_i
+        public virtual POA_SALOME_MED::SUPPORT, public virtual SALOME::GenericObj_i
 {
   public:
 
 // Constructors and associated internal methods
-       SMESH_MEDSupport_i(SMESH_subMesh_i * sm,
-               std::string name, std::string description, SALOME_MED::medEntityMesh entity);
-       SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s);
+        SMESH_MEDSupport_i(SMESH_subMesh_i * sm,
+                std::string name, std::string description, SALOME_MED::medEntityMesh entity);
+        SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s);
 
 // IDL Methods
-       char *getName() throw(SALOME::SALOME_Exception);
-       char *getDescription() throw(SALOME::SALOME_Exception);
-       SALOME_MED::MESH_ptr getMesh() throw(SALOME::SALOME_Exception);
-       CORBA::Boolean isOnAllElements() throw(SALOME::SALOME_Exception);
-       SALOME_MED::medEntityMesh getEntity() throw(SALOME::SALOME_Exception);
+        char *getName() throw(SALOME::SALOME_Exception);
+        char *getDescription() throw(SALOME::SALOME_Exception);
+        SALOME_MED::MESH_ptr getMesh() throw(SALOME::SALOME_Exception);
+        CORBA::Boolean isOnAllElements() throw(SALOME::SALOME_Exception);
+        SALOME_MED::medEntityMesh getEntity() throw(SALOME::SALOME_Exception);
         CORBA::Long
-       getNumberOfElements(SALOME_MED::medGeometryElement geomElement)
-         throw(SALOME::SALOME_Exception);
+        getNumberOfElements(SALOME_MED::medGeometryElement geomElement)
+          throw(SALOME::SALOME_Exception);
 
         CORBA::Long getNumberOfTypes() throw (SALOME::SALOME_Exception);
 
-       SALOME_MED::long_array *
-       getNumber(SALOME_MED::medGeometryElement geomElement)
-         throw(SALOME::SALOME_Exception);
+        SALOME_MED::long_array *
+        getNumber(SALOME_MED::medGeometryElement geomElement)
+          throw(SALOME::SALOME_Exception);
 
   /*!
    * Same function as getNumber.
    */
-       SALOME_MED::long_array *
-       getNumberFromFile(SALOME_MED::medGeometryElement geomElement)
-         throw(SALOME::SALOME_Exception);
+        SALOME_MED::long_array *
+        getNumberFromFile(SALOME_MED::medGeometryElement geomElement)
+          throw(SALOME::SALOME_Exception);
 
-       SALOME_MED::long_array * getNumberIndex()
-         throw(SALOME::SALOME_Exception);
+        SALOME_MED::long_array * getNumberIndex()
+          throw(SALOME::SALOME_Exception);
 
         CORBA::Long
-       getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement)
-         throw(SALOME::SALOME_Exception);
+        getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement)
+          throw(SALOME::SALOME_Exception);
 
         SALOME_MED::long_array* getNumbersOfGaussPoint()
-         throw (SALOME::SALOME_Exception);
+          throw (SALOME::SALOME_Exception);
 
-       SALOME_MED::medGeometryElement_array *getTypes()
-         throw(SALOME::SALOME_Exception);
+        SALOME_MED::medGeometryElement_array *getTypes()
+          throw(SALOME::SALOME_Exception);
 
         void getBoundaryElements() throw (SALOME::SALOME_Exception);
 
-       CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception);
+        CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception);
 
         SALOME_MED::SUPPORT::supportInfos * getSupportGlobal()
-         throw (SALOME::SALOME_Exception);
+          throw (SALOME::SALOME_Exception);
 
-       void createSeq() throw(SALOME::SALOME_Exception);
+        void createSeq() throw(SALOME::SALOME_Exception);
 
   public: //public field
-       const SMESHDS_SubMesh * _subMeshDS;
-       ::SMESH_subMesh_i * _subMesh_i;
+        const SMESHDS_SubMesh * _subMeshDS;
+        ::SMESH_subMesh_i * _subMesh_i;
 
-       SMESHDS_Mesh * _meshDS;
-       std::string _name;
+        SMESHDS_Mesh * _meshDS;
+        std::string _name;
         std::string _description;
-       bool _isOnAllElements;
-       bool _seqNumber;
-       int _seqLength;
+        bool _isOnAllElements;
+        bool _seqNumber;
+        int _seqLength;
 
-       SALOME_MED::medEntityMesh _entity;
-       SALOME_MED::medGeometryElement * _geometricType;
-       int _numberOfGeometricType;
+        SALOME_MED::medEntityMesh _entity;
+        SALOME_MED::medGeometryElement * _geometricType;
+        int _numberOfGeometricType;
 
   protected:
-       SMESH_MEDSupport_i();
-       ~SMESH_MEDSupport_i();
+        SMESH_MEDSupport_i();
+        ~SMESH_MEDSupport_i();
 };
 
 #endif /* _MED_MEDSUPPORT_I_HXX_ */
index 6d0002396ab08465cbe86b69457e99bcb63825a3..000bc95e84c79b38ceecd757025d65c5e847562e 100644 (file)
@@ -149,24 +149,26 @@ namespace {
     }
   };// struct TPreviewMesh
 
-  static SMESH_NodeSearcher * myNodeSearcher = 0;
+  static SMESH_NodeSearcher *    theNodeSearcher    = 0;
+  static SMESH_ElementSearcher * theElementSearcher = 0;
 
   //=============================================================================
   /*!
-   * \brief Deleter of myNodeSearcher at any compute event occured
+   * \brief Deleter of theNodeSearcher at any compute event occured
    */
   //=============================================================================
 
-  struct TNodeSearcherDeleter : public SMESH_subMeshEventListener
+  struct TSearchersDeleter : public SMESH_subMeshEventListener
   {
     SMESH_Mesh* myMesh;
     //!< Constructor
-    TNodeSearcherDeleter(): SMESH_subMeshEventListener( false ), // won't be deleted by submesh
-    myMesh(0) {}
-    //!< Delete myNodeSearcher
+    TSearchersDeleter(): SMESH_subMeshEventListener( false ), // won't be deleted by submesh
+                         myMesh(0) {}
+    //!< Delete theNodeSearcher
     static void Delete()
     {
-      if ( myNodeSearcher ) { delete myNodeSearcher; myNodeSearcher = 0; }
+      if ( theNodeSearcher )    delete theNodeSearcher;    theNodeSearcher    = 0;
+      if ( theElementSearcher ) delete theElementSearcher; theElementSearcher = 0;
     }
     typedef map < int, SMESH_subMesh * > TDependsOnMap;
     //!< The meshod called by submesh: do my main job
@@ -178,19 +180,22 @@ namespace {
         Unset( sm->GetFather() );
       }
     }
-    //!< set self on all submeshes and delete myNodeSearcher if other mesh is set
+    //!< set self on all submeshes and delete theNodeSearcher if other mesh is set
     void Set(SMESH_Mesh* mesh)
     {
-      if ( myMesh && myMesh != mesh ) {
-        Delete();
-        Unset( myMesh );
-      }
-      myMesh = mesh;
-      if ( SMESH_subMesh* myMainSubMesh = mesh->GetSubMeshContaining(1) ) {
-        const TDependsOnMap & subMeshes = myMainSubMesh->DependsOn();
-        TDependsOnMap::const_iterator sm;
-        for (sm = subMeshes.begin(); sm != subMeshes.end(); sm++)
-          sm->second->SetEventListener( this, 0, sm->second );
+      if ( myMesh != mesh )
+      {
+        if ( myMesh ) {
+          Delete();
+          Unset( myMesh );
+        }
+        myMesh = mesh;
+        if ( SMESH_subMesh* myMainSubMesh = mesh->GetSubMeshContaining(1) ) {
+          const TDependsOnMap & subMeshes = myMainSubMesh->DependsOn();
+          TDependsOnMap::const_iterator sm;
+          for (sm = subMeshes.begin(); sm != subMeshes.end(); sm++)
+            sm->second->SetEventListener( this, 0, sm->second );
+        }
       }
     }
     //!<  delete self from all submeshes
@@ -204,7 +209,8 @@ namespace {
       }
       myMesh = 0;
     }
-  };
+
+  } theSearchersDeleter;
 
   TCollection_AsciiString mirrorTypeName( SMESH::SMESH_MeshEditor::MirrorType theMirrorType )
   {
@@ -252,7 +258,7 @@ SMESH_MeshEditor_i::~SMESH_MeshEditor_i()
  */
 //================================================================================
 
-void SMESH_MeshEditor_i::initData()
+void SMESH_MeshEditor_i::initData(bool deleteSearchers)
 {
   if ( myPreviewMode ) {
     myPreviewData = new SMESH::MeshPreviewStruct();
@@ -260,7 +266,8 @@ void SMESH_MeshEditor_i::initData()
   else {
     myLastCreatedElems = new SMESH::long_array();
     myLastCreatedNodes = new SMESH::long_array();
-    TNodeSearcherDeleter::Delete();
+    if ( deleteSearchers )
+      TSearchersDeleter::Delete();
   }
 }
 
@@ -271,7 +278,7 @@ void SMESH_MeshEditor_i::initData()
 //=============================================================================
 
 CORBA::Boolean
-  SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
+SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
 {
   initData();
 
@@ -430,6 +437,9 @@ CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
     elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
                                 nodes[4], nodes[5], nodes[6], nodes[7]);
   }
+  else if (NbNodes > 2) {
+    elem = GetMeshDS()->AddPolygonalFace(nodes);
+  }
 
   // Update Python script
   TPythonDump() << "faceID = " << this << ".AddFace( " << IDsOfNodes << " )";
@@ -445,8 +455,7 @@ CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
  *  AddPolygonalFace
  */
 //=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace
-                                   (const SMESH::long_array & IDsOfNodes)
+CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsOfNodes)
 {
   initData();
 
@@ -456,7 +465,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace
     nodes[i] = GetMeshDS()->FindNode(IDsOfNodes[i]);
 
   const SMDS_MeshElement* elem = GetMeshDS()->AddPolygonalFace(nodes);
-  
+
   // Update Python script
   TPythonDump() <<"faceID = "<<this<<".AddPolygonalFace( "<<IDsOfNodes<<" )";
 #ifdef _DEBUG_
@@ -523,9 +532,8 @@ CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
  *  AddPolyhedralVolume
  */
 //=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume
-                                   (const SMESH::long_array & IDsOfNodes,
-                                    const SMESH::long_array & Quantities)
+CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & IDsOfNodes,
+                                                     const SMESH::long_array & Quantities)
 {
   initData();
 
@@ -559,8 +567,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume
  *  AddPolyhedralVolumeByFaces
  */
 //=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces
-                                   (const SMESH::long_array & IdsOfFaces)
+CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::long_array & IdsOfFaces)
 {
   initData();
 
@@ -696,10 +703,10 @@ void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
   if ( isOut ) {
 #ifdef _DEBUG_
     MESSAGE ( "FACE " << FaceID << " (" << u << "," << v << ") out of "
-           << " u( " <<  surf.FirstUParameter() 
-           << "," <<  surf.LastUParameter()  
-           << ") v( " <<  surf.FirstVParameter() 
-           << "," <<  surf.LastVParameter() << ")" );
+              << " u( " <<  surf.FirstUParameter() 
+              << "," <<  surf.LastUParameter()  
+              << ") v( " <<  surf.FirstVParameter() 
+              << "," <<  surf.LastVParameter() << ")" );
 #endif    
     THROW_SALOME_CORBA_EXCEPTION("Invalid UV", SALOME::BAD_PARAM);
   }
@@ -770,33 +777,6 @@ void SMESH_MeshEditor_i::SetMeshElementOnShape(CORBA::Long ElementID,
   mesh->SetMeshElementOnShape( elem, ShapeID );
 }
 
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long   NodeID,
-                                            CORBA::Double x,
-                                            CORBA::Double y,
-                                            CORBA::Double z)
-{
-  initData();
-
-  const SMDS_MeshNode * node = GetMeshDS()->FindNode( NodeID );
-  if ( !node )
-    return false;
-
-  GetMeshDS()->MoveNode(node, x, y, z);
-
-  // Update Python script
-  TPythonDump() << "isDone = " << this << ".MoveNode( "
-                << NodeID << ", " << x << ", " << y << ", " << z << " )";
-
-  return true;
-}
-
 //=============================================================================
 /*!
  *
@@ -903,10 +883,10 @@ namespace
   //================================================================================
   /*!
    * \brief function for conversion long_array to TIDSortedElemSet
-    * \param IDs - array of IDs
-    * \param aMesh - mesh
-    * \param aMap - collection to fill
-    * \param aType - element type
+   * \param IDs - array of IDs
+   * \param aMesh - mesh
+   * \param aMap - collection to fill
+   * \param aType - element type
    */
   //================================================================================
 
@@ -919,7 +899,7 @@ namespace
       CORBA::Long ind = IDs[i];
       const SMDS_MeshElement * elem =
         (aType == SMDSAbs_Node ? aMesh->FindNode(ind)
-                             : aMesh->FindElement(ind));
+         : aMesh->FindElement(ind));
       if ( elem && ( aType == SMDSAbs_All || elem->GetType() == aType ))
         aMap.insert( elem );
     }
@@ -1165,14 +1145,14 @@ CORBA::Long SMESH_MeshEditor_i::BestSplit (CORBA::Long                 IDOfQuad,
 //=======================================================================
 
 CORBA::Boolean
-  SMESH_MeshEditor_i::Smooth(const SMESH::long_array &              IDsOfElements,
-                             const SMESH::long_array &              IDsOfFixedNodes,
-                             CORBA::Long                            MaxNbOfIterations,
-                             CORBA::Double                          MaxAspectRatio,
-                             SMESH::SMESH_MeshEditor::Smooth_Method Method)
+SMESH_MeshEditor_i::Smooth(const SMESH::long_array &              IDsOfElements,
+                           const SMESH::long_array &              IDsOfFixedNodes,
+                           CORBA::Long                            MaxNbOfIterations,
+                           CORBA::Double                          MaxAspectRatio,
+                           SMESH::SMESH_MeshEditor::Smooth_Method Method)
 {
   return smooth( IDsOfElements, IDsOfFixedNodes, MaxNbOfIterations,
-                MaxAspectRatio, Method, false );
+                 MaxAspectRatio, Method, false );
 }
 
 
@@ -1182,14 +1162,14 @@ CORBA::Boolean
 //=======================================================================
 
 CORBA::Boolean
-  SMESH_MeshEditor_i::SmoothParametric(const SMESH::long_array &              IDsOfElements,
-                                       const SMESH::long_array &              IDsOfFixedNodes,
-                                       CORBA::Long                            MaxNbOfIterations,
-                                       CORBA::Double                          MaxAspectRatio,
-                                       SMESH::SMESH_MeshEditor::Smooth_Method Method)
+SMESH_MeshEditor_i::SmoothParametric(const SMESH::long_array &              IDsOfElements,
+                                     const SMESH::long_array &              IDsOfFixedNodes,
+                                     CORBA::Long                            MaxNbOfIterations,
+                                     CORBA::Double                          MaxAspectRatio,
+                                     SMESH::SMESH_MeshEditor::Smooth_Method Method)
 {
   return smooth( IDsOfElements, IDsOfFixedNodes, MaxNbOfIterations,
-                MaxAspectRatio, Method, true );
+                 MaxAspectRatio, Method, true );
 }
 
 
@@ -1199,11 +1179,11 @@ CORBA::Boolean
 //=======================================================================
 
 CORBA::Boolean
-  SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
-                                  const SMESH::long_array &              IDsOfFixedNodes,
-                                  CORBA::Long                            MaxNbOfIterations,
-                                  CORBA::Double                          MaxAspectRatio,
-                                  SMESH::SMESH_MeshEditor::Smooth_Method Method)
+SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
+                                 const SMESH::long_array &              IDsOfFixedNodes,
+                                 CORBA::Long                            MaxNbOfIterations,
+                                 CORBA::Double                          MaxAspectRatio,
+                                 SMESH::SMESH_MeshEditor::Smooth_Method Method)
 {
   return smoothObject (theObject, IDsOfFixedNodes, MaxNbOfIterations,
                        MaxAspectRatio, Method, false);
@@ -1216,11 +1196,11 @@ CORBA::Boolean
 //=======================================================================
 
 CORBA::Boolean
-  SMESH_MeshEditor_i::SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
-                                  const SMESH::long_array &              IDsOfFixedNodes,
-                                  CORBA::Long                            MaxNbOfIterations,
-                                  CORBA::Double                          MaxAspectRatio,
-                                  SMESH::SMESH_MeshEditor::Smooth_Method Method)
+SMESH_MeshEditor_i::SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
+                                           const SMESH::long_array &              IDsOfFixedNodes,
+                                           CORBA::Long                            MaxNbOfIterations,
+                                           CORBA::Double                          MaxAspectRatio,
+                                           SMESH::SMESH_MeshEditor::Smooth_Method Method)
 {
   return smoothObject (theObject, IDsOfFixedNodes, MaxNbOfIterations,
                        MaxAspectRatio, Method, true);
@@ -1234,12 +1214,12 @@ CORBA::Boolean
 //=============================================================================
 
 CORBA::Boolean
-  SMESH_MeshEditor_i::smooth(const SMESH::long_array &              IDsOfElements,
-                             const SMESH::long_array &              IDsOfFixedNodes,
-                             CORBA::Long                            MaxNbOfIterations,
-                             CORBA::Double                          MaxAspectRatio,
-                             SMESH::SMESH_MeshEditor::Smooth_Method Method,
-                             bool                                   IsParametric)
+SMESH_MeshEditor_i::smooth(const SMESH::long_array &              IDsOfElements,
+                           const SMESH::long_array &              IDsOfFixedNodes,
+                           CORBA::Long                            MaxNbOfIterations,
+                           CORBA::Double                          MaxAspectRatio,
+                           SMESH::SMESH_MeshEditor::Smooth_Method Method,
+                           bool                                   IsParametric)
 {
   initData();
 
@@ -1354,9 +1334,9 @@ void SMESH_MeshEditor_i::RenumberElements()
 }
 
 //=======================================================================
-  /*!
  * \brief Return groups by their IDs
  */
+/*!
+ * \brief Return groups by their IDs
+ */
 //=======================================================================
 
 SMESH::ListOfGroups* SMESH_MeshEditor_i::getGroups(const std::list<int>* groupIDs)
@@ -1379,7 +1359,7 @@ SMESH_MeshEditor_i::rotationSweep(const SMESH::long_array & theIDsOfElements,
                                   CORBA::Long               theNbOfSteps,
                                   CORBA::Double             theTolerance,
                                   const bool                theMakeGroups,
-                                 const SMDSAbs_ElementType theElementType)
+                                  const SMDSAbs_ElementType theElementType)
 {
   initData();
 
@@ -1408,8 +1388,8 @@ SMESH_MeshEditor_i::rotationSweep(const SMESH::long_array & theIDsOfElements,
 
   ::SMESH_MeshEditor anEditor( mesh );
   ::SMESH_MeshEditor::PGroupIDs groupIds =
-    anEditor.RotationSweep (*workElements, Ax1, theAngleInRadians,
-                            theNbOfSteps, theTolerance, theMakeGroups, makeWalls);
+      anEditor.RotationSweep (*workElements, Ax1, theAngleInRadians,
+                              theNbOfSteps, theTolerance, theMakeGroups, makeWalls);
   storeResult(anEditor);
 
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
@@ -1479,10 +1459,10 @@ SMESH_MeshEditor_i::RotationSweepMakeGroups(const SMESH::long_array& theIDsOfEle
 //=======================================================================
 
 void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
-                                            const SMESH::AxisStruct & theAxis,
-                                            CORBA::Double             theAngleInRadians,
-                                            CORBA::Long               theNbOfSteps,
-                                            CORBA::Double             theTolerance)
+                                             const SMESH::AxisStruct & theAxis,
+                                             CORBA::Double             theAngleInRadians,
+                                             CORBA::Long               theNbOfSteps,
+                                             CORBA::Double             theTolerance)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".RotationSweepObject( "
@@ -1507,10 +1487,10 @@ void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject
 //=======================================================================
 
 void SMESH_MeshEditor_i::RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
-                                              const SMESH::AxisStruct & theAxis,
-                                              CORBA::Double             theAngleInRadians,
-                                              CORBA::Long               theNbOfSteps,
-                                              CORBA::Double             theTolerance)
+                                               const SMESH::AxisStruct & theAxis,
+                                               CORBA::Double             theAngleInRadians,
+                                               CORBA::Long               theNbOfSteps,
+                                               CORBA::Double             theTolerance)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".RotationSweepObject1D( "
@@ -1527,7 +1507,7 @@ void SMESH_MeshEditor_i::RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObje
                 theNbOfSteps,
                 theTolerance,
                 false,
-               SMDSAbs_Edge);
+                SMDSAbs_Edge);
 }
 
 //=======================================================================
@@ -1536,10 +1516,10 @@ void SMESH_MeshEditor_i::RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObje
 //=======================================================================
 
 void SMESH_MeshEditor_i::RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
-                                              const SMESH::AxisStruct & theAxis,
-                                              CORBA::Double             theAngleInRadians,
-                                              CORBA::Long               theNbOfSteps,
-                                              CORBA::Double             theTolerance)
+                                               const SMESH::AxisStruct & theAxis,
+                                               CORBA::Double             theAngleInRadians,
+                                               CORBA::Long               theNbOfSteps,
+                                               CORBA::Double             theTolerance)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".RotationSweepObject2D( "
@@ -1556,7 +1536,7 @@ void SMESH_MeshEditor_i::RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObje
                 theNbOfSteps,
                 theTolerance,
                 false,
-               SMDSAbs_Face);
+                SMDSAbs_Face);
 }
 
 //=======================================================================
@@ -1583,7 +1563,7 @@ SMESH_MeshEditor_i::RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr theO
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
                << theObject << ", "
-              << theAxis << ", "
+               << theAxis << ", "
                << theAngleInRadians << ", "
                << theNbOfSteps << ", "
                << theTolerance << " )";
@@ -1598,10 +1578,10 @@ SMESH_MeshEditor_i::RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr theO
 
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
-                                                   const SMESH::AxisStruct&  theAxis,
-                                                   CORBA::Double             theAngleInRadians,
-                                                   CORBA::Long               theNbOfSteps,
-                                                   CORBA::Double             theTolerance)
+                                                    const SMESH::AxisStruct&  theAxis,
+                                                    CORBA::Double             theAngleInRadians,
+                                                    CORBA::Long               theNbOfSteps,
+                                                    CORBA::Double             theTolerance)
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
@@ -1610,13 +1590,13 @@ SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr th
                                                theNbOfSteps,
                                                theTolerance,
                                                true,
-                                              SMDSAbs_Edge);
+                                               SMDSAbs_Edge);
   if ( !myPreviewMode ) {
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump<< this << ".RotationSweepObject1DMakeGroups( "
                << theObject << ", "
-              << theAxis << ", "
+               << theAxis << ", "
                << theAngleInRadians << ", "
                << theNbOfSteps << ", "
                << theTolerance << " )";
@@ -1631,10 +1611,10 @@ SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr th
 
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
-                                                   const SMESH::AxisStruct&  theAxis,
-                                                   CORBA::Double             theAngleInRadians,
-                                                   CORBA::Long               theNbOfSteps,
-                                                   CORBA::Double             theTolerance)
+                                                    const SMESH::AxisStruct&  theAxis,
+                                                    CORBA::Double             theAngleInRadians,
+                                                    CORBA::Long               theNbOfSteps,
+                                                    CORBA::Double             theTolerance)
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
@@ -1643,13 +1623,13 @@ SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr th
                                                theNbOfSteps,
                                                theTolerance,
                                                true,
-                                              SMDSAbs_Face);
+                                               SMDSAbs_Face);
   if ( !myPreviewMode ) {
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump<< this << ".RotationSweepObject2DMakeGroups( "
                << theObject << ", "
-              << theAxis << ", "
+               << theAxis << ", "
                << theAngleInRadians << ", "
                << theNbOfSteps << ", "
                << theTolerance << " )";
@@ -1721,8 +1701,8 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
 //=======================================================================
 
 void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
-                                             const SMESH::DirStruct &  theStepVector,
-                                             CORBA::Long               theNbOfSteps)
+                                              const SMESH::DirStruct &  theStepVector,
+                                              CORBA::Long               theNbOfSteps)
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false );
@@ -1777,7 +1757,7 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups(const SMESH::long_array& theIDsOfEl
                                              CORBA::Long              theNbOfSteps)
 {
   SMESH::ListOfGroups* aGroups = extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, true );
-    
+
   if ( !myPreviewMode ) {
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
@@ -1798,7 +1778,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr the
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
-  
+
   if ( !myPreviewMode ) {
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
@@ -1824,7 +1804,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr t
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
-               << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+                << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1845,7 +1825,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr t
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
-               << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+                << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1888,10 +1868,10 @@ SMESH_MeshEditor_i::advancedExtrusion(const SMESH::long_array & theIDsOfElements
 //=======================================================================
 
 void SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
-                                          const SMESH::DirStruct &  theStepVector,
-                                          CORBA::Long               theNbOfSteps,
-                                          CORBA::Long               theExtrFlags,
-                                          CORBA::Double             theSewTolerance)
+                                           const SMESH::DirStruct &  theStepVector,
+                                           CORBA::Long               theNbOfSteps,
+                                           CORBA::Long               theExtrFlags,
+                                           CORBA::Double             theSewTolerance)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << "stepVector = " << theStepVector;
@@ -1923,12 +1903,12 @@ SMESH_MeshEditor_i::AdvancedExtrusionMakeGroups(const SMESH::long_array& theIDsO
                                                 CORBA::Double            theSewTolerance)
 {
   SMESH::ListOfGroups * aGroups = advancedExtrusion( theIDsOfElements,
-                                                    theStepVector,
-                                                    theNbOfSteps,
-                                                    theExtrFlags,
-                                                    theSewTolerance,
-                                                    true);
-  
+                                                     theStepVector,
+                                                     theNbOfSteps,
+                                                     theExtrFlags,
+                                                     theSewTolerance,
+                                                     true);
+
   if ( !myPreviewMode ) {
     TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump aPythonDump;
@@ -1955,13 +1935,13 @@ SMESH_MeshEditor_i::AdvancedExtrusionMakeGroups(const SMESH::long_array& theIDsO
 static SMESH::SMESH_MeshEditor::Extrusion_Error convExtrError( const::SMESH_MeshEditor::Extrusion_Error e )
 {
   switch ( e ) {
-  RETCASE( EXTR_OK );
-  RETCASE( EXTR_NO_ELEMENTS );
-  RETCASE( EXTR_PATH_NOT_EDGE );
-  RETCASE( EXTR_BAD_PATH_SHAPE );
-  RETCASE( EXTR_BAD_STARTING_NODE );
-  RETCASE( EXTR_BAD_ANGLES_NUMBER );
-  RETCASE( EXTR_CANT_GET_TANGENT );
+    RETCASE( EXTR_OK );
+    RETCASE( EXTR_NO_ELEMENTS );
+    RETCASE( EXTR_PATH_NOT_EDGE );
+    RETCASE( EXTR_BAD_PATH_SHAPE );
+    RETCASE( EXTR_BAD_STARTING_NODE );
+    RETCASE( EXTR_BAD_ANGLES_NUMBER );
+    RETCASE( EXTR_CANT_GET_TANGENT );
   }
   return SMESH::SMESH_MeshEditor::EXTR_OK;
 }
@@ -1983,7 +1963,7 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
                                        const SMESH::PointStruct &  theRefPoint,
                                        const bool                  theMakeGroups,
                                        SMESH::SMESH_MeshEditor::Extrusion_Error & theError,
-                                      const SMDSAbs_ElementType   theElementType)
+                                       const SMDSAbs_ElementType   theElementType)
 {
   initData();
 
@@ -2045,16 +2025,16 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
 
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
-                                       SMESH::SMESH_IDSource_ptr  Path,
-                                       CORBA::Long                NodeStart,
-                                       CORBA::Boolean             HasAngles,
-                                       const SMESH::double_array& Angles,
-                                       CORBA::Boolean             LinearVariation,
-                                       CORBA::Boolean             HasRefPoint,
-                                       const SMESH::PointStruct&  RefPoint,
-                                       const bool                 MakeGroups,
-                                       const SMDSAbs_ElementType  ElementType,
-                                       SMESH::SMESH_MeshEditor::Extrusion_Error & Error)
+                                        SMESH::SMESH_IDSource_ptr  Path,
+                                        CORBA::Long                NodeStart,
+                                        CORBA::Boolean             HasAngles,
+                                        const SMESH::double_array& Angles,
+                                        CORBA::Boolean             LinearVariation,
+                                        CORBA::Boolean             HasRefPoint,
+                                        const SMESH::PointStruct&  RefPoint,
+                                        const bool                 MakeGroups,
+                                        const SMDSAbs_ElementType  ElementType,
+                                        SMESH::SMESH_MeshEditor::Extrusion_Error & Error)
 {
   SMESH::ListOfGroups* EmptyGr = new SMESH::ListOfGroups;
 
@@ -2088,8 +2068,8 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
       return EmptyGr;
     }
     error = anEditor.ExtrusionAlongTrack( elements, &(aMeshImp->GetImpl()), aNodeStart,
-                                         HasAngles, angles, LinearVariation,
-                                         HasRefPoint, refPnt, MakeGroups );
+                                          HasAngles, angles, LinearVariation,
+                                          HasRefPoint, refPnt, MakeGroups );
   }
   else {
     SMESH_subMesh_i* aSubMeshImp = SMESH::DownCast<SMESH_subMesh_i*>( Path );
@@ -2098,26 +2078,26 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
       SMESH::SMESH_Mesh_ptr aPathMesh = aSubMeshImp->GetFather();
       aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( aPathMesh );
       SMDS_MeshNode* aNodeStart = 
-       (SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
+        (SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
       if ( !aNodeStart ) {
-       Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
-       return EmptyGr;
+        Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
+        return EmptyGr;
       }
       SMESH_subMesh* aSubMesh = 
-       aMeshImp->GetImpl().GetSubMeshContaining(aSubMeshImp->GetId());
+        aMeshImp->GetImpl().GetSubMeshContaining(aSubMeshImp->GetId());
       error = anEditor.ExtrusionAlongTrack( elements, aSubMesh, aNodeStart,
-                                           HasAngles, angles, LinearVariation,
-                                           HasRefPoint, refPnt, MakeGroups );
+                                            HasAngles, angles, LinearVariation,
+                                            HasRefPoint, refPnt, MakeGroups );
     }
     else {
       SMESH_Group_i* aGroupImp = SMESH::DownCast<SMESH_Group_i*>( Path );
       if(aGroupImp) {
-       // path as group of 1D elements
+        // path as group of 1D elements
       }
       else {
-       // invalid path
-       Error = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
-       return EmptyGr;
+        // invalid path
+        Error = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
+        return EmptyGr;
       }
     }
   }
@@ -2142,14 +2122,14 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
 //=======================================================================
 
 SMESH::SMESH_MeshEditor::Extrusion_Error
-  SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array &   theIDsOfElements,
-                                        SMESH::SMESH_Mesh_ptr       thePathMesh,
-                                        GEOM::GEOM_Object_ptr       thePathShape,
-                                        CORBA::Long                 theNodeStart,
-                                        CORBA::Boolean              theHasAngles,
-                                        const SMESH::double_array & theAngles,
-                                        CORBA::Boolean              theHasRefPoint,
-                                        const SMESH::PointStruct &  theRefPoint)
+SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array &   theIDsOfElements,
+                                       SMESH::SMESH_Mesh_ptr       thePathMesh,
+                                       GEOM::GEOM_Object_ptr       thePathShape,
+                                       CORBA::Long                 theNodeStart,
+                                       CORBA::Boolean              theHasAngles,
+                                       const SMESH::double_array & theAngles,
+                                       CORBA::Boolean              theHasRefPoint,
+                                       const SMESH::PointStruct &  theRefPoint)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
@@ -2230,13 +2210,13 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObje
 
 SMESH::SMESH_MeshEditor::Extrusion_Error
 SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
-                                              SMESH::SMESH_Mesh_ptr       thePathMesh,
-                                              GEOM::GEOM_Object_ptr       thePathShape,
-                                              CORBA::Long                 theNodeStart,
-                                              CORBA::Boolean              theHasAngles,
-                                              const SMESH::double_array & theAngles,
-                                              CORBA::Boolean              theHasRefPoint,
-                                              const SMESH::PointStruct &  theRefPoint)
+                                               SMESH::SMESH_Mesh_ptr       thePathMesh,
+                                               GEOM::GEOM_Object_ptr       thePathShape,
+                                               CORBA::Long                 theNodeStart,
+                                               CORBA::Boolean              theHasAngles,
+                                               const SMESH::double_array & theAngles,
+                                               CORBA::Boolean              theHasRefPoint,
+                                               const SMESH::PointStruct &  theRefPoint)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject1D( "
@@ -2264,7 +2244,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theOb
                       theRefPoint,
                       false,
                       anError,
-                     SMDSAbs_Edge);
+                      SMDSAbs_Edge);
   return anError;
 }
 
@@ -2275,13 +2255,13 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theOb
 
 SMESH::SMESH_MeshEditor::Extrusion_Error
 SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
-                                              SMESH::SMESH_Mesh_ptr       thePathMesh,
-                                              GEOM::GEOM_Object_ptr       thePathShape,
-                                              CORBA::Long                 theNodeStart,
-                                              CORBA::Boolean              theHasAngles,
-                                              const SMESH::double_array & theAngles,
-                                              CORBA::Boolean              theHasRefPoint,
-                                              const SMESH::PointStruct &  theRefPoint)
+                                               SMESH::SMESH_Mesh_ptr       thePathMesh,
+                                               GEOM::GEOM_Object_ptr       thePathShape,
+                                               CORBA::Long                 theNodeStart,
+                                               CORBA::Boolean              theHasAngles,
+                                               const SMESH::double_array & theAngles,
+                                               CORBA::Boolean              theHasRefPoint,
+                                               const SMESH::PointStruct &  theRefPoint)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject2D( "
@@ -2309,7 +2289,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theOb
                       theRefPoint,
                       false,
                       anError,
-                     SMDSAbs_Face);
+                      SMDSAbs_Face);
   return anError;
 }
 
@@ -2330,16 +2310,16 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
                                                  const SMESH::PointStruct&  theRefPoint,
                                                  SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
-    SMESH::ListOfGroups * aGroups =  extrusionAlongPath( theIDsOfElements,
-                                                         thePathMesh,
-                                                         thePathShape,
-                                                         theNodeStart,
-                                                         theHasAngles,
-                                                         theAngles,
-                                                         theHasRefPoint,
-                                                         theRefPoint,
-                                                         true,
-                                                         Error);
+  SMESH::ListOfGroups * aGroups =  extrusionAlongPath( theIDsOfElements,
+                                                       thePathMesh,
+                                                       thePathShape,
+                                                       theNodeStart,
+                                                       theHasAngles,
+                                                       theAngles,
+                                                       theHasRefPoint,
+                                                       theRefPoint,
+                                                       true,
+                                                       Error);
   if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
@@ -2350,7 +2330,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
       aPythonDump << ", error)";
     else
       aPythonDump <<"error";
-    
+
     aPythonDump<<" = "<< this << ".ExtrusionAlongPathMakeGroups( "
                << theIDsOfElements << ", "
                << thePathMesh      << ", "
@@ -2394,7 +2374,7 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       theRefPoint,
                                                       true,
                                                       Error);
-  
+
   if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
@@ -2413,11 +2393,11 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                 << theNodeStart     << ", "
                 << theHasAngles     << ", "
                 << theAngles        << ", "
-               << theHasRefPoint   << ", "
-               << "SMESH.PointStruct( "
-               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
-               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
-               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+                << theHasRefPoint   << ", "
+                << "SMESH.PointStruct( "
+                << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   return aGroups;
 }
@@ -2429,14 +2409,14 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
-                                    SMESH::SMESH_Mesh_ptr      thePathMesh,
-                                    GEOM::GEOM_Object_ptr      thePathShape,
-                                    CORBA::Long                theNodeStart,
-                                    CORBA::Boolean             theHasAngles,
-                                    const SMESH::double_array& theAngles,
-                                    CORBA::Boolean             theHasRefPoint,
-                                    const SMESH::PointStruct&  theRefPoint,
-                                    SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
+                                     SMESH::SMESH_Mesh_ptr      thePathMesh,
+                                     GEOM::GEOM_Object_ptr      thePathShape,
+                                     CORBA::Long                theNodeStart,
+                                     CORBA::Boolean             theHasAngles,
+                                     const SMESH::double_array& theAngles,
+                                     CORBA::Boolean             theHasRefPoint,
+                                     const SMESH::PointStruct&  theRefPoint,
+                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
@@ -2449,8 +2429,8 @@ ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       theRefPoint,
                                                       true,
                                                       Error,
-                                                     SMDSAbs_Edge);
-  
+                                                      SMDSAbs_Edge);
+
   if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
@@ -2469,11 +2449,11 @@ ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                 << theNodeStart     << ", "
                 << theHasAngles     << ", "
                 << theAngles        << ", "
-               << theHasRefPoint   << ", "
-               << "SMESH.PointStruct( "
-               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
-               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
-               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+                << theHasRefPoint   << ", "
+                << "SMESH.PointStruct( "
+                << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   return aGroups;
 }
@@ -2485,14 +2465,14 @@ ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
-                                    SMESH::SMESH_Mesh_ptr      thePathMesh,
-                                    GEOM::GEOM_Object_ptr      thePathShape,
-                                    CORBA::Long                theNodeStart,
-                                    CORBA::Boolean             theHasAngles,
-                                    const SMESH::double_array& theAngles,
-                                    CORBA::Boolean             theHasRefPoint,
-                                    const SMESH::PointStruct&  theRefPoint,
-                                    SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
+                                     SMESH::SMESH_Mesh_ptr      thePathMesh,
+                                     GEOM::GEOM_Object_ptr      thePathShape,
+                                     CORBA::Long                theNodeStart,
+                                     CORBA::Boolean             theHasAngles,
+                                     const SMESH::double_array& theAngles,
+                                     CORBA::Boolean             theHasRefPoint,
+                                     const SMESH::PointStruct&  theRefPoint,
+                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
@@ -2505,8 +2485,8 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       theRefPoint,
                                                       true,
                                                       Error,
-                                                     SMDSAbs_Face);
-  
+                                                      SMDSAbs_Face);
+
   if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
@@ -2525,11 +2505,11 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                 << theNodeStart     << ", "
                 << theHasAngles     << ", "
                 << theAngles        << ", "
-               << theHasRefPoint   << ", "
-               << "SMESH.PointStruct( "
-               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
-               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
-               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+                << theHasRefPoint   << ", "
+                << "SMESH.PointStruct( "
+                << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   return aGroups;
 }
@@ -2541,30 +2521,30 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 //=======================================================================
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
-                      SMESH::SMESH_IDSource_ptr  Path,
-                      CORBA::Long                NodeStart,
-                      CORBA::Boolean             HasAngles,
-                      const SMESH::double_array& Angles,
-                      CORBA::Boolean             LinearVariation,
-                      CORBA::Boolean             HasRefPoint,
-                      const SMESH::PointStruct&  RefPoint,
-                      CORBA::Boolean             MakeGroups,
-                      SMESH::ElementType         ElemType,
-                      SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
+                       SMESH::SMESH_IDSource_ptr  Path,
+                       CORBA::Long                NodeStart,
+                       CORBA::Boolean             HasAngles,
+                       const SMESH::double_array& Angles,
+                       CORBA::Boolean             LinearVariation,
+                       CORBA::Boolean             HasRefPoint,
+                       const SMESH::PointStruct&  RefPoint,
+                       CORBA::Boolean             MakeGroups,
+                       SMESH::ElementType         ElemType,
+                       SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
   SMESH::long_array_var anElementsId = Object->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
-                                                     Path,
-                                                     NodeStart,
-                                                     HasAngles,
-                                                     Angles,
-                                                     LinearVariation,
-                                                     HasRefPoint,
-                                                     RefPoint,
-                                                     MakeGroups,
-                                                     (SMDSAbs_ElementType)ElemType,
-                                                     Error);
-  
+                                                      Path,
+                                                      NodeStart,
+                                                      HasAngles,
+                                                      Angles,
+                                                      LinearVariation,
+                                                      HasRefPoint,
+                                                      RefPoint,
+                                                      MakeGroups,
+                                                      (SMDSAbs_ElementType)ElemType,
+                                                      Error);
+
   if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
@@ -2582,13 +2562,14 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
                 << NodeStart   << ", "
                 << HasAngles   << ", "
                 << Angles      << ", "
-               << LinearVariation << ", "
-               << HasRefPoint << ", "
-               << "SMESH.PointStruct( "
-               << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
-               << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
-               << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
-               << ElemType << " )";
+                << LinearVariation << ", "
+                << HasRefPoint << ", "
+                << "SMESH.PointStruct( "
+                << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
+                << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
+                << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
+                << MakeGroups << ", "
+                << ElemType << " )";
   }
   return aGroups;
 }
@@ -2600,29 +2581,29 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
 //=======================================================================
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
-                   SMESH::SMESH_IDSource_ptr  Path,
-                   CORBA::Long                NodeStart,
-                   CORBA::Boolean             HasAngles,
-                   const SMESH::double_array& Angles,
-                   CORBA::Boolean             LinearVariation,
-                   CORBA::Boolean             HasRefPoint,
-                   const SMESH::PointStruct&  RefPoint,
-                   CORBA::Boolean             MakeGroups,
-                   SMESH::ElementType         ElemType,
-                   SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
+                    SMESH::SMESH_IDSource_ptr  Path,
+                    CORBA::Long                NodeStart,
+                    CORBA::Boolean             HasAngles,
+                    const SMESH::double_array& Angles,
+                    CORBA::Boolean             LinearVariation,
+                    CORBA::Boolean             HasRefPoint,
+                    const SMESH::PointStruct&  RefPoint,
+                    CORBA::Boolean             MakeGroups,
+                    SMESH::ElementType         ElemType,
+                    SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
   SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
-                                                     Path,
-                                                     NodeStart,
-                                                     HasAngles,
-                                                     Angles,
-                                                     LinearVariation,
-                                                     HasRefPoint,
-                                                     RefPoint,
-                                                     MakeGroups,
-                                                     (SMDSAbs_ElementType)ElemType,
-                                                     Error);
-  
+                                                      Path,
+                                                      NodeStart,
+                                                      HasAngles,
+                                                      Angles,
+                                                      LinearVariation,
+                                                      HasRefPoint,
+                                                      RefPoint,
+                                                      MakeGroups,
+                                                      (SMDSAbs_ElementType)ElemType,
+                                                      Error);
+
   if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
@@ -2640,13 +2621,13 @@ ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
                 << NodeStart   << ", "
                 << HasAngles   << ", "
                 << Angles      << ", "
-               << LinearVariation << ", "
-               << HasRefPoint << ", "
-               << "SMESH.PointStruct( "
-               << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
-               << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
-               << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
-               << ElemType << " )";
+                << LinearVariation << ", "
+                << HasRefPoint << ", "
+                << "SMESH.PointStruct( "
+                << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
+                << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
+                << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
+                << ElemType << " )";
   }
   return aGroups;
 }
@@ -2656,10 +2637,10 @@ ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
 /*!
  * \brief Compute rotation angles for ExtrusionAlongPath as linear variation
  * of given angles along path steps
 * \param PathMesh mesh containing a 1D sub-mesh on the edge, along 
 *                which proceeds the extrusion
 * \param PathShape is shape(edge); as the mesh can be complex, the edge 
 *                 is used to define the sub-mesh for the path
+ * \param PathMesh mesh containing a 1D sub-mesh on the edge, along 
+ *                which proceeds the extrusion
+ * \param PathShape is shape(edge); as the mesh can be complex, the edge 
+ *                 is used to define the sub-mesh for the path
  */
 //================================================================================
 
@@ -2699,7 +2680,7 @@ SMESH_MeshEditor_i::LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       thePathMes
           int iP = int( angPrevFloor );
           double angPrevCeil = ceil(angPrev);
           angle = ( angPrevCeil - angPrev ) * theAngles[ iP ];
-          
+
           int iC = int( angCurFloor );
           if ( iC < nbAngles )
             angle += ( angCur - angCurFloor ) * theAngles[ iC ];
@@ -2794,9 +2775,9 @@ void SMESH_MeshEditor_i::Mirror(const SMESH::long_array &           theIDsOfElem
 //=======================================================================
 
 void SMESH_MeshEditor_i::MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
-                                     const SMESH::AxisStruct &           theAxis,
-                                     SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
-                                     CORBA::Boolean                      theCopy)
+                                      const SMESH::AxisStruct &           theAxis,
+                                      SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
+                                      CORBA::Boolean                      theCopy)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".MirrorObject( "
@@ -2870,7 +2851,7 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array&            theIDsOfE
   SMESH::SMESH_Mesh_var mesh;
   { // open new scope to dump "MakeMesh" command
     // and then "GetGroups" using SMESH_Mesh::GetGroups()
-    
+
     TPythonDump pydump; // to prevent dump at mesh creation
 
     mesh = makeMesh( theMeshName );
@@ -2880,7 +2861,7 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array&            theIDsOfE
              false, theCopyGroups, & mesh_i->GetImpl());
       mesh_i->CreateGroupServants();
     }
-    
+
     if ( !myPreviewMode ) {
       pydump << mesh << " = " << this << ".MirrorMakeMesh( "
              << theIDsOfElements << ", "
@@ -2894,7 +2875,7 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array&            theIDsOfE
   //dump "GetGroups"
   if(!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
-  
+
   return mesh._retn();
 }
 
@@ -2914,7 +2895,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           the
   SMESH::SMESH_Mesh_var mesh;
   { // open new scope to dump "MakeMesh" command
     // and then "GetGroups" using SMESH_Mesh::GetGroups()
-    
+
     TPythonDump pydump; // to prevent dump at mesh creation
 
     mesh = makeMesh( theMeshName );
@@ -2939,7 +2920,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           the
   //dump "GetGroups"
   if(!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
-  
+
   return mesh._retn();
 }
 
@@ -3001,8 +2982,8 @@ void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
 //=======================================================================
 
 void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
-                                        const SMESH::DirStruct &  theVector,
-                                        CORBA::Boolean            theCopy)
+                                         const SMESH::DirStruct &  theVector,
+                                         CORBA::Boolean            theCopy)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".TranslateObject( "
@@ -3048,7 +3029,7 @@ SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObjec
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = translate(anElementsId, theVector, true, true);
-  
+
   if ( !myPreviewMode ) {
 
     TPythonDump aPythonDump;
@@ -3073,21 +3054,21 @@ SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements,
 {
   SMESH_Mesh_i* mesh_i;
   SMESH::SMESH_Mesh_var mesh;
-  
+
   { // open new scope to dump "MakeMesh" command
     // and then "GetGroups" using SMESH_Mesh::GetGroups()
 
     TPythonDump pydump; // to prevent dump at mesh creation
-    
+
     mesh = makeMesh( theMeshName );
     mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
-    
+
     if ( mesh_i ) {
       translate(theIDsOfElements, theVector,
                 false, theCopyGroups, & mesh_i->GetImpl());
       mesh_i->CreateGroupServants();
     }
-    
+
     if ( !myPreviewMode ) {
       pydump << mesh << " = " << this << ".TranslateMakeMesh( "
              << theIDsOfElements << ", "
@@ -3096,11 +3077,11 @@ SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements,
              << theMeshName << "' )";
     }
   }
-  
+
   //dump "GetGroups"
   if(!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
-  
+
   return mesh._retn();
 }
 
@@ -3119,11 +3100,11 @@ SMESH_MeshEditor_i::TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
   SMESH::SMESH_Mesh_var mesh;
   { // open new scope to dump "MakeMesh" command
     // and then "GetGroups" using SMESH_Mesh::GetGroups()
-    
+
     TPythonDump pydump; // to prevent dump at mesh creation
     mesh = makeMesh( theMeshName );
     mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
-    
+
     if ( mesh_i ) {
       SMESH::long_array_var anElementsId = theObject->GetIDs();
       translate(anElementsId, theVector,
@@ -3138,11 +3119,11 @@ SMESH_MeshEditor_i::TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
              << theMeshName << "' )";
     }
   }
-  
+
   //dump "GetGroups"
   if(!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
-  
+
   return mesh._retn();
 }
 
@@ -3210,9 +3191,9 @@ void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
 //=======================================================================
 
 void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject,
-                                     const SMESH::AxisStruct & theAxis,
-                                     CORBA::Double             theAngle,
-                                     CORBA::Boolean            theCopy)
+                                      const SMESH::AxisStruct & theAxis,
+                                      CORBA::Double             theAngle,
+                                      CORBA::Boolean            theCopy)
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".RotateObject( "
@@ -3245,7 +3226,7 @@ SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".RotateMakeGroups( "
                 << theIDsOfElements << ", "
-               << theAxis << ", "
+                << theAxis << ", "
                 << theAngle << " )";
   }
   return aGroups;
@@ -3263,14 +3244,14 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups =  rotate(anElementsId,theAxis,theAngle,true,true);
+
   if ( !myPreviewMode ) {
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".RotateObjectMakeGroups( "
-               << theObject << ", "
-               << theAxis << ", "
-               << theAngle << " )";
+                << theObject << ", "
+                << theAxis << ", "
+                << theAngle << " )";
   }
   return aGroups;
 }
@@ -3292,12 +3273,12 @@ SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
 
   { // open new scope to dump "MakeMesh" command
     // and then "GetGroups" using SMESH_Mesh::GetGroups()
-    
+
     TPythonDump pydump; // to prevent dump at mesh creation
 
     mesh = makeMesh( theMeshName );
     mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
-    
+
     if ( mesh_i ) {
       rotate(theIDsOfElements, theAxis, theAngleInRadians,
              false, theCopyGroups, & mesh_i->GetImpl());
@@ -3312,11 +3293,11 @@ SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
              << theMeshName << "' )";
     }
   }
-  
+
   //dump "GetGroups"
   if(!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
-  
+
   return mesh._retn();
 }
 
@@ -3334,14 +3315,14 @@ SMESH_MeshEditor_i::RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
 {
   SMESH::SMESH_Mesh_var mesh;
   SMESH_Mesh_i* mesh_i;
-  
+
   {// open new scope to dump "MakeMesh" command
    // and then "GetGroups" using SMESH_Mesh::GetGroups()
-    
+
     TPythonDump pydump; // to prevent dump at mesh creation
     mesh = makeMesh( theMeshName );
     mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
-    
+
     if (mesh_i ) {
       SMESH::long_array_var anElementsId = theObject->GetIDs();
       rotate(anElementsId, theAxis, theAngleInRadians,
@@ -3357,11 +3338,11 @@ SMESH_MeshEditor_i::RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
              << theMeshName << "' )";
     }
   }
-  
+
   //dump "GetGroups"
   if(!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
-  
+
   return mesh._retn();
 }
 
@@ -3410,7 +3391,7 @@ void SMESH_MeshEditor_i::FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr
   set<const SMDS_MeshNode*> nodes;
 
   if ( !CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(theObject)) &&
-      SMESH::SMESH_GroupBase::_narrow(theObject)->GetType() == SMESH::NODE) {
+       SMESH::SMESH_GroupBase::_narrow(theObject)->GetType() == SMESH::NODE) {
     for(int i = 0; i < aElementsId->length(); i++) {
       CORBA::Long ind = aElementsId[i];
       const SMDS_MeshNode * elem = aMesh->FindNode(ind);
@@ -3429,13 +3410,13 @@ void SMESH_MeshEditor_i::FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr
       }
     }
   }
-    
-  
+
+
   ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
   ::SMESH_MeshEditor anEditor( myMesh );
   if(!nodes.empty())
     anEditor.FindCoincidentNodes( nodes, Tolerance, aListOfListOfNodes );
-  
+
   GroupsOfNodes = new SMESH::array_of_long_array;
   GroupsOfNodes->length( aListOfListOfNodes.size() );
   ::SMESH_MeshEditor::TListOfListOfNodes::iterator llIt = aListOfListOfNodes.begin();
@@ -3495,11 +3476,11 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN
 //purpose  :
 //=======================================================================
 void SMESH_MeshEditor_i::FindEqualElements(SMESH::SMESH_IDSource_ptr      theObject,
-                                          SMESH::array_of_long_array_out GroupsOfElementsID)
+                                           SMESH::array_of_long_array_out GroupsOfElementsID)
 {
   initData();
   if ( !(!CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(theObject)) &&
-        SMESH::SMESH_GroupBase::_narrow(theObject)->GetType() == SMESH::NODE) ) {
+         SMESH::SMESH_GroupBase::_narrow(theObject)->GetType() == SMESH::NODE) ) {
     typedef list<int> TListOfIDs;
     set<const SMDS_MeshElement*> elems;
     SMESH::long_array_var aElementsId = theObject->GetIDs();
@@ -3509,7 +3490,7 @@ void SMESH_MeshEditor_i::FindEqualElements(SMESH::SMESH_IDSource_ptr      theObj
       CORBA::Long anID = aElementsId[i];
       const SMDS_MeshElement * elem = aMesh->FindElement(anID);
       if (elem) {
-       elems.insert(elem);
+        elems.insert(elem);
       }
     }
 
@@ -3527,12 +3508,12 @@ void SMESH_MeshEditor_i::FindEqualElements(SMESH::SMESH_IDSource_ptr      theObj
       aGroup.length( listOfIDs.size() );
       TListOfIDs::iterator idIt = listOfIDs.begin();
       for (int k = 0; idIt != listOfIDs.end(); ++idIt, ++k ) {
-       aGroup[ k ] = *idIt;
+        aGroup[ k ] = *idIt;
       }
     }
 
-  TPythonDump() << "equal_elements = " << this << ".FindEqualElements( "
-                <<theObject<<" )";
+    TPythonDump() << "equal_elements = " << this << ".FindEqualElements( "
+                  <<theObject<<" )";
   }
 }
 
@@ -3585,6 +3566,61 @@ void SMESH_MeshEditor_i::MergeEqualElements()
   TPythonDump() << this << ".MergeEqualElements()";
 }
 
+//=============================================================================
+/*!
+ * Move the node to a given point
+ */
+//=============================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long   NodeID,
+                                            CORBA::Double x,
+                                            CORBA::Double y,
+                                            CORBA::Double z)
+{
+  initData(/*deleteSearchers=*/false);
+
+  const SMDS_MeshNode * node = GetMeshDS()->FindNode( NodeID );
+  if ( !node )
+    return false;
+
+  if ( theNodeSearcher )
+    theSearchersDeleter.Set( myMesh ); // remove theNodeSearcher if mesh is other
+
+  if ( theNodeSearcher ) // move node and update theNodeSearcher data accordingly
+    theNodeSearcher->MoveNode(node, gp_Pnt( x,y,z ));
+  else
+    GetMeshDS()->MoveNode(node, x, y, z);
+
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".MoveNode( "
+                << NodeID << ", " << x << ", " << y << ", " << z << " )";
+
+  return true;
+}
+
+//================================================================================
+/*!
+ * \brief Return ID of node closest to a given point
+ */
+//================================================================================
+
+CORBA::Long SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x,
+                                                  CORBA::Double y,
+                                                  CORBA::Double z)
+{
+  theSearchersDeleter.Set( myMesh ); // remove theNodeSearcher if mesh is other
+
+  if ( !theNodeSearcher ) {
+    ::SMESH_MeshEditor anEditor( myMesh );
+    theNodeSearcher = anEditor.GetNodeSearcher();
+  }
+  gp_Pnt p( x,y,z );
+  if ( const SMDS_MeshNode* node = theNodeSearcher->FindClosestTo( p ))
+    return node->GetID();
+
+  return 0;
+}
+
 //================================================================================
 /*!
  * \brief If the given ID is a valid node ID (nodeID > 0), just move this node, else
@@ -3597,24 +3633,24 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
                                                        CORBA::Double z,
                                                        CORBA::Long   theNodeID)
 {
-  // We keep myNodeSearcher until any mesh modification:
-  // 1) initData() deletes myNodeSearcher at any edition,
-  // 2) TNodeSearcherDeleter - at any mesh compute event and mesh change
+  // We keep theNodeSearcher until any mesh modification:
+  // 1) initData() deletes theNodeSearcher at any edition,
+  // 2) TSearchersDeleter - at any mesh compute event and mesh change
 
-  initData();
+  initData(/*deleteSearchers=*/false);
+
+  theSearchersDeleter.Set( myMesh ); // remove theNodeSearcher if mesh is other
 
   int nodeID = theNodeID;
   const SMDS_MeshNode* node = GetMeshDS()->FindNode( nodeID );
-  if ( !node )
+  if ( !node ) // preview moving node
   {
-    static TNodeSearcherDeleter deleter;
-    deleter.Set( myMesh );
-    if ( !myNodeSearcher ) {
+    if ( !theNodeSearcher ) {
       ::SMESH_MeshEditor anEditor( myMesh );
-      myNodeSearcher = anEditor.GetNodeSearcher();
+      theNodeSearcher = anEditor.GetNodeSearcher();
     }
     gp_Pnt p( x,y,z );
-    node = myNodeSearcher->FindClosestTo( p );
+    node = theNodeSearcher->FindClosestTo( p );
   }
   if ( node ) {
     nodeID = node->GetID();
@@ -3638,6 +3674,10 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
       ::SMESH_MeshEditor anEditor( & tmpMesh );
       storeResult( anEditor );
     }
+    else if ( theNodeSearcher ) // move node and update theNodeSearcher data accordingly
+    {
+      theNodeSearcher->MoveNode(node, gp_Pnt( x,y,z ));
+    }
     else
     {
       GetMeshDS()->MoveNode(node, x, y, z);
@@ -3653,6 +3693,44 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
   return nodeID;
 }
 
+//=======================================================================
+/*!
+ * Return elements of given type where the given point is IN or ON.
+ *
+ * 'ALL' type means elements of any type excluding nodes
+ */
+//=======================================================================
+
+SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double      x,
+                                                           CORBA::Double      y,
+                                                           CORBA::Double      z,
+                                                           SMESH::ElementType type)
+{
+  SMESH::long_array_var res = new SMESH::long_array;
+  vector< const SMDS_MeshElement* > foundElems;
+
+  theSearchersDeleter.Set( myMesh );
+  if ( !theElementSearcher ) {
+    ::SMESH_MeshEditor anEditor( myMesh );
+    theElementSearcher = anEditor.GetElementSearcher();
+  }
+  theElementSearcher->FindElementsByPoint( gp_Pnt( x,y,z ),
+                                           SMDSAbs_ElementType( type ),
+                                           foundElems);
+  res->length( foundElems.size() );
+  for ( int i = 0; i < foundElems.size(); ++i )
+    res[i] = foundElems[i]->GetID();
+
+  if ( !myPreviewMode ) // call from tui
+    TPythonDump() << res << " = " << this << ".FindElementsByPoint( "
+                  << x << ", "
+                  << y << ", "
+                  << z << ", "
+                  << type << " )";
+
+  return res._retn();
+}
+
 //=======================================================================
 //function : convError
 //purpose  :
@@ -3663,16 +3741,16 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
 static SMESH::SMESH_MeshEditor::Sew_Error convError( const::SMESH_MeshEditor::Sew_Error e )
 {
   switch ( e ) {
-  RETCASE( SEW_OK );
-  RETCASE( SEW_BORDER1_NOT_FOUND );
-  RETCASE( SEW_BORDER2_NOT_FOUND );
-  RETCASE( SEW_BOTH_BORDERS_NOT_FOUND );
-  RETCASE( SEW_BAD_SIDE_NODES );
-  RETCASE( SEW_VOLUMES_TO_SPLIT );
-  RETCASE( SEW_DIFF_NB_OF_ELEMENTS );
-  RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS );
-  RETCASE( SEW_BAD_SIDE1_NODES );
-  RETCASE( SEW_BAD_SIDE2_NODES );
+    RETCASE( SEW_OK );
+    RETCASE( SEW_BORDER1_NOT_FOUND );
+    RETCASE( SEW_BORDER2_NOT_FOUND );
+    RETCASE( SEW_BOTH_BORDERS_NOT_FOUND );
+    RETCASE( SEW_BAD_SIDE_NODES );
+    RETCASE( SEW_VOLUMES_TO_SPLIT );
+    RETCASE( SEW_DIFF_NB_OF_ELEMENTS );
+    RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS );
+    RETCASE( SEW_BAD_SIDE1_NODES );
+    RETCASE( SEW_BAD_SIDE2_NODES );
   }
   return SMESH::SMESH_MeshEditor::SEW_OK;
 }
@@ -3683,14 +3761,14 @@ static SMESH::SMESH_MeshEditor::Sew_Error convError( const::SMESH_MeshEditor::Se
 //=======================================================================
 
 SMESH::SMESH_MeshEditor::Sew_Error
-  SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1,
-                                     CORBA::Long SecondNodeID1,
-                                     CORBA::Long LastNodeID1,
-                                     CORBA::Long FirstNodeID2,
-                                     CORBA::Long SecondNodeID2,
-                                     CORBA::Long LastNodeID2,
-                                     CORBA::Boolean CreatePolygons,
-                                     CORBA::Boolean CreatePolyedrs)
+SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1,
+                                   CORBA::Long SecondNodeID1,
+                                   CORBA::Long LastNodeID1,
+                                   CORBA::Long FirstNodeID2,
+                                   CORBA::Long SecondNodeID2,
+                                   CORBA::Long LastNodeID2,
+                                   CORBA::Boolean CreatePolygons,
+                                   CORBA::Boolean CreatePolyedrs)
 {
   initData();
 
@@ -3912,9 +3990,9 @@ SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
 //================================================================================
 /*!
  * \brief Set new nodes for given element
 * \param ide - element id
 * \param newIDs - new node ids
 * \retval CORBA::Boolean - true if result is OK
+ * \param ide - element id
+ * \param newIDs - new node ids
+ * \retval CORBA::Boolean - true if result is OK
  */
 //================================================================================
 
@@ -3945,11 +4023,11 @@ CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide,
 
   return GetMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
 }
-  
+
 //================================================================================
 /*!
  * \brief Update myLastCreated* or myPreviewData
 * \param anEditor - it contains last modification results
+ * \param anEditor - it contains last modification results
  */
 //================================================================================
 
@@ -4007,8 +4085,8 @@ void SMESH_MeshEditor_i::storeResult(::SMESH_MeshEditor& anEditor)
       /*if (aMeshElem->GetType() == SMDSAbs_Volume) {
         aType = SMDSAbs_Node;
         isPoly = false;
-      }
-      else*/ {
+        }
+        else*/ {
         aType = aMeshElem->GetType();
         isPoly = aMeshElem->IsPoly();
       }
@@ -4026,7 +4104,7 @@ void SMESH_MeshEditor_i::storeResult(::SMESH_MeshEditor& anEditor)
     myPreviewData->elementConnectivities.length(aNodesConnectivity.size());
     for( int i = 0; aConnIter != aNodesConnectivity.end(); aConnIter++, i++ )
       myPreviewData->elementConnectivities[i] = *aConnIter;
-    
+
     return;
   }
 
@@ -4060,7 +4138,7 @@ SMESH::MeshPreviewStruct* SMESH_MeshEditor_i::GetPreviewData()
 //================================================================================
 /*!
  * \brief Returns list of it's IDs of created nodes
 * \retval SMESH::long_array* - list of node ID
+ * \retval SMESH::long_array* - list of node ID
  */
 //================================================================================
 
@@ -4072,7 +4150,7 @@ SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
 //================================================================================
 /*!
  * \brief Returns list of it's IDs of created elements
 * \retval SMESH::long_array* - list of elements' ID
+ * \retval SMESH::long_array* - list of elements' ID
  */
 //================================================================================
 
@@ -4136,23 +4214,159 @@ void SMESH_MeshEditor_i::DumpGroupsList(TPythonDump &               theDumpPytho
   }
 }
 
+//================================================================================
+/*!
+  \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+  \param theNodes - identifiers of nodes to be doubled
+  \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
+         nodes. If list of element identifiers is empty then nodes are doubled but 
+         they not assigned to elements
+  \return TRUE if operation has been completed successfully, FALSE otherwise
+  \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
+*/
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes, 
+                                                const SMESH::long_array& theModifiedElems )
+{
+  initData();
+
+  ::SMESH_MeshEditor aMeshEditor( myMesh );
+  list< int > aListOfNodes;
+  int i, n;
+  for ( i = 0, n = theNodes.length(); i < n; i++ )
+    aListOfNodes.push_back( theNodes[ i ] );
+
+  list< int > aListOfElems;
+  for ( i = 0, n = theModifiedElems.length(); i < n; i++ )
+    aListOfElems.push_back( theModifiedElems[ i ] );
+
+  bool aResult = aMeshEditor.DoubleNodes( aListOfNodes, aListOfElems );
+
+  storeResult( aMeshEditor) ;
+
+  return aResult;
+}
+
+//================================================================================
+/*!
+  \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+  This method provided for convenience works as DoubleNodes() described above.
+  \param theNodeId - identifier of node to be doubled.
+  \param theModifiedElems - identifiers of elements to be updated.
+  \return TRUE if operation has been completed successfully, FALSE otherwise
+  \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
+*/
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long              theNodeId, 
+                                               const SMESH::long_array& theModifiedElems )
+{
+  SMESH::long_array_var aNodes = new SMESH::long_array;
+  aNodes->length( 1 );
+  aNodes[ 0 ] = theNodeId;
+  return DoubleNodes( aNodes, theModifiedElems );
+}
+
+//================================================================================
+/*!
+  \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+  This method provided for convenience works as DoubleNodes() described above.
+  \param theNodes - group of nodes to be doubled.
+  \param theModifiedElems - group of elements to be updated.
+  \return TRUE if operation has been completed successfully, FALSE otherwise
+  \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups()
+*/
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup( 
+  SMESH::SMESH_GroupBase_ptr theNodes,
+  SMESH::SMESH_GroupBase_ptr theModifiedElems )
+{
+  if ( CORBA::is_nil( theNodes ) && theNodes->GetType() != SMESH::NODE )
+    return false;
+
+  SMESH::long_array_var aNodes = theNodes->GetListOfID();
+  SMESH::long_array_var aModifiedElems;
+  if ( !CORBA::is_nil( theModifiedElems ) )
+    aModifiedElems = theModifiedElems->GetListOfID();
+  else 
+  {
+    aModifiedElems = new SMESH::long_array;
+    aModifiedElems->length( 0 );
+  }
+
+  return DoubleNodes( aNodes, aModifiedElems );
+}
+
+//================================================================================
+/*!
+  \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+  This method provided for convenience works as DoubleNodes() described above.
+  \param theNodes - list of groups of nodes to be doubled
+  \param theModifiedElems - list of groups of elements to be updated.
+  \return TRUE if operation has been completed successfully, FALSE otherwise
+  \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
+*/
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups( 
+  const SMESH::ListOfGroups& theNodes,
+  const SMESH::ListOfGroups& theModifiedElems )
+{
+  initData();
+
+  ::SMESH_MeshEditor aMeshEditor( myMesh );
+
+  std::list< int > aNodes;
+  int i, n, j, m;
+  for ( i = 0, n = theNodes.length(); i < n; i++ )
+  {
+    SMESH::SMESH_GroupBase_var aGrp = theNodes[ i ];
+    if ( !CORBA::is_nil( aGrp ) && aGrp->GetType() == SMESH::NODE )
+    {
+      SMESH::long_array_var aCurr = aGrp->GetListOfID();
+      for ( j = 0, m = aCurr->length(); j < m; j++ )
+        aNodes.push_back( aCurr[ j ] );
+    }
+  }
+
+  std::list< int > anElems;
+  for ( i = 0, n = theModifiedElems.length(); i < n; i++ )
+  {
+    SMESH::SMESH_GroupBase_var aGrp = theModifiedElems[ i ];
+    if ( !CORBA::is_nil( aGrp ) && aGrp->GetType() != SMESH::NODE )
+    {
+      SMESH::long_array_var aCurr = aGrp->GetListOfID();
+      for ( j = 0, m = aCurr->length(); j < m; j++ )
+        anElems.push_back( aCurr[ j ] );
+    }
+  }
+
+  bool aResult = aMeshEditor.DoubleNodes( aNodes, anElems );
+
+  storeResult( aMeshEditor) ;
+
+  return aResult;
+}
+
 //================================================================================
 /*!
   \brief Creates a hole in a mesh by doubling the nodes of some particular elements
   \param theElems - the list of elements (edges or faces) to be replicated
-        The nodes for duplication could be found from these elements
+  The nodes for duplication could be found from these elements
   \param theNodesNot - list of nodes to NOT replicate
   \param theAffectedElems - the list of elements (cells and edges) to which the 
-        replicated nodes should be associated to.
+  replicated nodes should be associated to.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodeGroup(), DoubleNodeGroups()
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theElems, 
-                                                const SMESH::long_array& theNodesNot,
-                                                const SMESH::long_array& theAffectedElems )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems, 
+                                                   const SMESH::long_array& theNodesNot,
+                                                   const SMESH::long_array& theAffectedElems )
+
 {
   initData();
 
@@ -4168,6 +4382,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theElem
 
   storeResult( aMeshEditor) ;
 
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodes( " << theElems << ", "
+    << theNodesNot << ", " << theAffectedElems << " )";
   return aResult;
 }
 
@@ -4175,21 +4392,21 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theElem
 /*!
   \brief Creates a hole in a mesh by doubling the nodes of some particular elements
   \param theElems - the list of elements (edges or faces) to be replicated
-        The nodes for duplication could be found from these elements
+  The nodes for duplication could be found from these elements
   \param theNodesNot - list of nodes to NOT replicate
   \param theShape - shape to detect affected elements (element which geometric center
-         located on or inside shape).
-         The replicated nodes should be associated to affected elements.
+  located on or inside shape).
+  The replicated nodes should be associated to affected elements.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesInRegion
-  ( const SMESH::long_array& theElems, 
-    const SMESH::long_array& theNodesNot,
-    GEOM::GEOM_Object_ptr    theShape )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion
+( const SMESH::long_array& theElems, 
+  const SMESH::long_array& theNodesNot,
+  GEOM::GEOM_Object_ptr    theShape )
+
 {
   initData();
 
@@ -4205,6 +4422,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesInRegion
 
   storeResult( aMeshEditor) ;
 
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodesInRegion( " << theElems << ", "
+    << theNodesNot << ", " << theShape << " )";
   return aResult;
 }
 
@@ -4214,7 +4434,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesInRegion
   \param theElems - group of of elements (edges or faces) to be replicated
   \param theNodesNot - group of nodes not to replicated
   \param theAffectedElems - group of elements to which the replicated nodes
-         should be associated to.
+  should be associated to.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodes(), DoubleNodeGroups()
 */
@@ -4224,7 +4444,7 @@ static void groupToSet(SMESH::SMESH_GroupBase_ptr theGrp,
                        SMESHDS_Mesh*              theMeshDS,
                        TIDSortedElemSet&          theElemSet,
                        const SMDSAbs_ElementType  theType)
+
 {
   if ( CORBA::is_nil( theGrp ) )
     return;
@@ -4232,15 +4452,15 @@ static void groupToSet(SMESH::SMESH_GroupBase_ptr theGrp,
   arrayToSet( anIDs, theMeshDS, theElemSet, theType);
 }
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup( 
-  SMESH::SMESH_GroupBase_ptr theElems,
-  SMESH::SMESH_GroupBase_ptr theNodesNot,
-  SMESH::SMESH_GroupBase_ptr theAffectedElems )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroup( 
+                                                       SMESH::SMESH_GroupBase_ptr theElems,
+                                                       SMESH::SMESH_GroupBase_ptr theNodesNot,
+                                                       SMESH::SMESH_GroupBase_ptr theAffectedElems )
 
 {
   if ( CORBA::is_nil( theElems ) && theElems->GetType() == SMESH::NODE )
     return false;
-  
+
   initData();
 
   ::SMESH_MeshEditor aMeshEditor( myMesh );
@@ -4255,6 +4475,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup(
 
   storeResult( aMeshEditor) ;
 
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodeGroup( " << theElems << ", "
+    << theNodesNot << ", " << theAffectedElems << " )";
   return aResult;
 }
 
@@ -4264,22 +4487,22 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup(
   \param theElems - group of of elements (edges or faces) to be replicated
   \param theNodesNot - group of nodes not to replicated
   \param theShape - shape to detect affected elements (element which geometric center
-         located on or inside shape).
-         The replicated nodes should be associated to affected elements.
+  located on or inside shape).
+  The replicated nodes should be associated to affected elements.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroupInRegion( 
-  SMESH::SMESH_GroupBase_ptr theElems,
-  SMESH::SMESH_GroupBase_ptr theNodesNot,
-  GEOM::GEOM_Object_ptr      theShape )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroupInRegion( 
+                                                               SMESH::SMESH_GroupBase_ptr theElems,
+                                                               SMESH::SMESH_GroupBase_ptr theNodesNot,
+                                                               GEOM::GEOM_Object_ptr      theShape )
 
 {
   if ( CORBA::is_nil( theElems ) && theElems->GetType() == SMESH::NODE )
     return false;
-  
+
   initData();
 
   ::SMESH_MeshEditor aMeshEditor( myMesh );
@@ -4294,6 +4517,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroupInRegion(
 
   storeResult( aMeshEditor) ;
 
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodeGroupInRegion( " << theElems << ", "
+    << theNodesNot << ", " << theShape << " )";
   return aResult;
 }
 
@@ -4304,7 +4530,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroupInRegion(
   \param theElems - list of groups of elements (edges or faces) to be replicated
   \param theNodesNot - list of groups of nodes not to replicated
   \param theAffectedElems - group of elements to which the replicated nodes
-         should be associated to.
+  should be associated to.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodeGroup(), DoubleNodes()
 */
@@ -4319,7 +4545,7 @@ static void listOfGroupToSet(const SMESH::ListOfGroups& theGrpList,
   {
     SMESH::SMESH_GroupBase_var aGrp = theGrpList[ i ];
     if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE 
-                                                 : aGrp->GetType() != SMESH::NODE ) )
+                                    : aGrp->GetType() != SMESH::NODE ) )
     {
       SMESH::long_array_var anIDs = aGrp->GetIDs();
       arrayToSet( anIDs, theMeshDS, theElemSet, theIsNodeGrp ? SMDSAbs_Node : SMDSAbs_All );
@@ -4327,10 +4553,10 @@ static void listOfGroupToSet(const SMESH::ListOfGroups& theGrpList,
   }
 }
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups( 
-  const SMESH::ListOfGroups& theElems,
-  const SMESH::ListOfGroups& theNodesNot,
-  const SMESH::ListOfGroups& theAffectedElems )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroups( 
+                                                        const SMESH::ListOfGroups& theElems,
+                                                        const SMESH::ListOfGroups& theNodesNot,
+                                                        const SMESH::ListOfGroups& theAffectedElems )
 {
   initData();
 
@@ -4346,6 +4572,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(
 
   storeResult( aMeshEditor) ;
 
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodeGroups( " << &theElems << ", "
+    << &theNodesNot << ", " << &theAffectedElems << " )";
   return aResult;
 }
 
@@ -4356,17 +4585,17 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(
   \param theElems - list of groups of elements (edges or faces) to be replicated
   \param theNodesNot - list of groups of nodes not to replicated
   \param theShape - shape to detect affected elements (element which geometric center
-         located on or inside shape).
-         The replicated nodes should be associated to affected elements.
+  located on or inside shape).
+  The replicated nodes should be associated to affected elements.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroupsInRegion( 
-  const SMESH::ListOfGroups& theElems,
-  const SMESH::ListOfGroups& theNodesNot,
-  GEOM::GEOM_Object_ptr      theShape )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroupsInRegion( 
+                                                                const SMESH::ListOfGroups& theElems,
+                                                                const SMESH::ListOfGroups& theNodesNot,
+                                                                GEOM::GEOM_Object_ptr      theShape )
 {
   initData();
 
@@ -4382,5 +4611,28 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroupsInRegion(
 
   storeResult( aMeshEditor) ;
 
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodeGroupsInRegion( " << &theElems << ", "
+    << &theNodesNot << ", " << theShape << " )";
+  return aResult;
+}
+
+//================================================================================
+/*!
+  \brief Generated skin mesh (containing 2D cells) from 3D mesh
+   The created 2D mesh elements based on nodes of free faces of boundary volumes
+  \return TRUE if operation has been completed successfully, FALSE otherwise
+*/
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D()
+{
+  initData();
+
+  ::SMESH_MeshEditor aMeshEditor( myMesh );
+  bool aResult = aMeshEditor.Make2DMeshFrom3D();
+  storeResult( aMeshEditor) ;
+  
+  TPythonDump() << "isDone = " << this << ".Make2DMeshFrom3D()";
   return aResult;
 }
index 73df0b465a49f20ae4eb6bd4673c69dc5f9e86d0..5c4dd85ca809f8618684659336e155dbdcc88c11 100644 (file)
@@ -138,10 +138,10 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                         CORBA::Double                          MaxAspectRatio,
                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
   CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
-                             const SMESH::long_array &              IDsOfFixedNodes,
-                             CORBA::Long                            MaxNbOfIterations,
-                             CORBA::Double                          MaxAspectRatio,
-                             SMESH::SMESH_MeshEditor::Smooth_Method Method);
+                              const SMESH::long_array &              IDsOfFixedNodes,
+                              CORBA::Long                            MaxNbOfIterations,
+                              CORBA::Double                          MaxAspectRatio,
+                              SMESH::SMESH_MeshEditor::Smooth_Method Method);
   CORBA::Boolean SmoothParametric(const SMESH::long_array &              IDsOfElements,
                                   const SMESH::long_array &              IDsOfFixedNodes,
                                   CORBA::Long                            MaxNbOfIterations,
@@ -159,10 +159,10 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
                         bool                                   IsParametric);
   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
-                             const SMESH::long_array &              IDsOfFixedNodes,
-                             CORBA::Long                            MaxNbOfIterations,
-                             CORBA::Double                          MaxAspectRatio,
-                             SMESH::SMESH_MeshEditor::Smooth_Method Method,
+                              const SMESH::long_array &              IDsOfFixedNodes,
+                              CORBA::Long                            MaxNbOfIterations,
+                              CORBA::Double                          MaxAspectRatio,
+                              SMESH::SMESH_MeshEditor::Smooth_Method Method,
                               bool                                   IsParametric);
 
 
@@ -178,27 +178,27 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                      CORBA::Long               NbOfSteps,
                      CORBA::Double             Tolerance);
   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
-                          const SMESH::AxisStruct & Axis,
-                          CORBA::Double             AngleInRadians,
-                          CORBA::Long               NbOfSteps,
-                          CORBA::Double             Tolerance);
+                           const SMESH::AxisStruct & Axis,
+                           CORBA::Double             AngleInRadians,
+                           CORBA::Long               NbOfSteps,
+                           CORBA::Double             Tolerance);
   void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
-                            const SMESH::AxisStruct & Axis,
-                            CORBA::Double             AngleInRadians,
-                            CORBA::Long               NbOfSteps,
-                            CORBA::Double             Tolerance);
+                             const SMESH::AxisStruct & Axis,
+                             CORBA::Double             AngleInRadians,
+                             CORBA::Long               NbOfSteps,
+                             CORBA::Double             Tolerance);
   void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
-                            const SMESH::AxisStruct & Axis,
-                            CORBA::Double             AngleInRadians,
-                            CORBA::Long               NbOfSteps,
-                            CORBA::Double             Tolerance);
+                             const SMESH::AxisStruct & Axis,
+                             CORBA::Double             AngleInRadians,
+                             CORBA::Long               NbOfSteps,
+                             CORBA::Double             Tolerance);
 
   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
                       const SMESH::DirStruct &  StepVector,
                       CORBA::Long               NbOfSteps);
   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
-                           const SMESH::DirStruct &  StepVector,
-                           CORBA::Long               NbOfSteps);
+                            const SMESH::DirStruct &  StepVector,
+                            CORBA::Long               NbOfSteps);
   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
                               const SMESH::DirStruct &  StepVector,
                               CORBA::Long               NbOfSteps);
@@ -206,23 +206,32 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                               const SMESH::DirStruct &  StepVector,
                               CORBA::Long               NbOfSteps);
   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
-                        const SMESH::DirStruct &  theStepVector,
-                        CORBA::Long               theNbOfSteps,
-                        CORBA::Long               theExtrFlags,
-                        CORBA::Double             theSewTolerance);
+                         const SMESH::DirStruct &  theStepVector,
+                         CORBA::Long               theNbOfSteps,
+                         CORBA::Long               theExtrFlags,
+                         CORBA::Double             theSewTolerance);
 
   SMESH::SMESH_MeshEditor::Extrusion_Error
-    ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
-                       SMESH::SMESH_Mesh_ptr       PathMesh,
-                       GEOM::GEOM_Object_ptr       PathShape,
-                       CORBA::Long                 NodeStart,
-                       CORBA::Boolean              HasAngles,
-                       const SMESH::double_array & Angles,
-                       CORBA::Boolean              HasRefPoint,
-                       const SMESH::PointStruct &  RefPoint);
+  ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
+                     SMESH::SMESH_Mesh_ptr       PathMesh,
+                     GEOM::GEOM_Object_ptr       PathShape,
+                     CORBA::Long                 NodeStart,
+                     CORBA::Boolean              HasAngles,
+                     const SMESH::double_array & Angles,
+                     CORBA::Boolean              HasRefPoint,
+                     const SMESH::PointStruct &  RefPoint);
 
   SMESH::SMESH_MeshEditor::Extrusion_Error
-    ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
+  ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
+                           SMESH::SMESH_Mesh_ptr       PathMesh,
+                           GEOM::GEOM_Object_ptr       PathShape,
+                           CORBA::Long                 NodeStart,
+                           CORBA::Boolean              HasAngles,
+                           const SMESH::double_array & Angles,
+                           CORBA::Boolean              HasRefPoint,
+                           const SMESH::PointStruct &  RefPoint);
+  SMESH::SMESH_MeshEditor::Extrusion_Error
+  ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
                              SMESH::SMESH_Mesh_ptr       PathMesh,
                              GEOM::GEOM_Object_ptr       PathShape,
                              CORBA::Long                 NodeStart,
@@ -231,23 +240,14 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                              CORBA::Boolean              HasRefPoint,
                              const SMESH::PointStruct &  RefPoint);
   SMESH::SMESH_MeshEditor::Extrusion_Error
-    ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
-                              SMESH::SMESH_Mesh_ptr       PathMesh,
-                              GEOM::GEOM_Object_ptr       PathShape,
-                              CORBA::Long                 NodeStart,
-                              CORBA::Boolean              HasAngles,
-                              const SMESH::double_array & Angles,
-                              CORBA::Boolean              HasRefPoint,
-                              const SMESH::PointStruct &  RefPoint);
-  SMESH::SMESH_MeshEditor::Extrusion_Error
-    ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
-                              SMESH::SMESH_Mesh_ptr       PathMesh,
-                              GEOM::GEOM_Object_ptr       PathShape,
-                              CORBA::Long                 NodeStart,
-                              CORBA::Boolean              HasAngles,
-                              const SMESH::double_array & Angles,
-                              CORBA::Boolean              HasRefPoint,
-                              const SMESH::PointStruct &  RefPoint);
+  ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
+                             SMESH::SMESH_Mesh_ptr       PathMesh,
+                             GEOM::GEOM_Object_ptr       PathShape,
+                             CORBA::Long                 NodeStart,
+                             CORBA::Boolean              HasAngles,
+                             const SMESH::double_array & Angles,
+                             CORBA::Boolean              HasRefPoint,
+                             const SMESH::PointStruct &  RefPoint);
 
   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
                                              GEOM::GEOM_Object_ptr       PathShape,
@@ -258,23 +258,23 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
               CORBA::Boolean                      Copy);
   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
-                   const SMESH::AxisStruct &           Axis,
-                   SMESH::SMESH_MeshEditor::MirrorType MirrorType,
-                   CORBA::Boolean                      Copy);
+                    const SMESH::AxisStruct &           Axis,
+                    SMESH::SMESH_MeshEditor::MirrorType MirrorType,
+                    CORBA::Boolean                      Copy);
   void Translate(const SMESH::long_array & IDsOfElements,
                  const SMESH::DirStruct &   Vector,
                  CORBA::Boolean            Copy);
   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
-                      const SMESH::DirStruct &   Vector,
-                      CORBA::Boolean             Copy);
+                       const SMESH::DirStruct &   Vector,
+                       CORBA::Boolean             Copy);
   void Rotate(const SMESH::long_array & IDsOfElements,
               const SMESH::AxisStruct &  Axis,
               CORBA::Double             Angle,
               CORBA::Boolean            Copy);
   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
-                   const SMESH::AxisStruct &  Axis,
-                   CORBA::Double              Angle,
-                   CORBA::Boolean             Copy);
+                    const SMESH::AxisStruct &  Axis,
+                    CORBA::Double              Angle,
+                    CORBA::Boolean             Copy);
 
   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
                                                const SMESH::AxisStruct& Axix,
@@ -287,15 +287,15 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                                      CORBA::Long               NbOfSteps,
                                                      CORBA::Double             Tolerance);
   SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
-                                                      const SMESH::AxisStruct&  Axix,
-                                                      CORBA::Double             AngleInRadians,
-                                                      CORBA::Long               NbOfSteps,
-                                                      CORBA::Double             Tolerance);
+                                                       const SMESH::AxisStruct&  Axix,
+                                                       CORBA::Double             AngleInRadians,
+                                                       CORBA::Long               NbOfSteps,
+                                                       CORBA::Double             Tolerance);
   SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
-                                                      const SMESH::AxisStruct&  Axix,
-                                                      CORBA::Double             AngleInRadians,
-                                                      CORBA::Long               NbOfSteps,
-                                                      CORBA::Double             Tolerance);
+                                                       const SMESH::AxisStruct&  Axix,
+                                                       CORBA::Double             AngleInRadians,
+                                                       CORBA::Long               NbOfSteps,
+                                                       CORBA::Double             Tolerance);
   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
                                                 const SMESH::DirStruct&  StepVector,
                                                 CORBA::Long              NbOfSteps);
@@ -332,47 +332,47 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                                           const SMESH::PointStruct&  RefPoint,
                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
   SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
-                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
-                                                           GEOM::GEOM_Object_ptr      PathShape,
-                                                           CORBA::Long                NodeStart,
-                                                           CORBA::Boolean             HasAngles,
-                                                           const SMESH::double_array& Angles,
-                                                           CORBA::Boolean             HasRefPoint,
-                                                           const SMESH::PointStruct&  RefPoint,
-                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
+                                                            SMESH::SMESH_Mesh_ptr      PathMesh,
+                                                            GEOM::GEOM_Object_ptr      PathShape,
+                                                            CORBA::Long                NodeStart,
+                                                            CORBA::Boolean             HasAngles,
+                                                            const SMESH::double_array& Angles,
+                                                            CORBA::Boolean             HasRefPoint,
+                                                            const SMESH::PointStruct&  RefPoint,
+                                                            SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
   SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
-                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
-                                                           GEOM::GEOM_Object_ptr      PathShape,
-                                                           CORBA::Long                NodeStart,
-                                                           CORBA::Boolean             HasAngles,
-                                                           const SMESH::double_array& Angles,
-                                                           CORBA::Boolean             HasRefPoint,
-                                                           const SMESH::PointStruct&  RefPoint,
-                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
+                                                            SMESH::SMESH_Mesh_ptr      PathMesh,
+                                                            GEOM::GEOM_Object_ptr      PathShape,
+                                                            CORBA::Long                NodeStart,
+                                                            CORBA::Boolean             HasAngles,
+                                                            const SMESH::double_array& Angles,
+                                                            CORBA::Boolean             HasRefPoint,
+                                                            const SMESH::PointStruct&  RefPoint,
+                                                            SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
 
   // skl 04.06.2009 
   SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
-                                             SMESH::SMESH_IDSource_ptr  Path,
-                                             CORBA::Long                NodeStart,
-                                             CORBA::Boolean             HasAngles,
-                                             const SMESH::double_array& Angles,
-                                             CORBA::Boolean             LinearVariation,
-                                             CORBA::Boolean             HasRefPoint,
-                                             const SMESH::PointStruct&  RefPoint,
-                                             CORBA::Boolean             MakeGroups,
-                                             SMESH::ElementType         ElemType,
-                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
+                                              SMESH::SMESH_IDSource_ptr  Path,
+                                              CORBA::Long                NodeStart,
+                                              CORBA::Boolean             HasAngles,
+                                              const SMESH::double_array& Angles,
+                                              CORBA::Boolean             LinearVariation,
+                                              CORBA::Boolean             HasRefPoint,
+                                              const SMESH::PointStruct&  RefPoint,
+                                              CORBA::Boolean             MakeGroups,
+                                              SMESH::ElementType         ElemType,
+                                              SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
   SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
-                                          SMESH::SMESH_IDSource_ptr  Path,
-                                          CORBA::Long                NodeStart,
-                                          CORBA::Boolean             HasAngles,
-                                          const SMESH::double_array& Angles,
-                                          CORBA::Boolean             LinearVariation,
-                                          CORBA::Boolean             HasRefPoint,
-                                          const SMESH::PointStruct&  RefPoint,
-                                          CORBA::Boolean             MakeGroups,
-                                          SMESH::ElementType         ElemType,
-                                          SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
+                                           SMESH::SMESH_IDSource_ptr  Path,
+                                           CORBA::Long                NodeStart,
+                                           CORBA::Boolean             HasAngles,
+                                           const SMESH::double_array& Angles,
+                                           CORBA::Boolean             LinearVariation,
+                                           CORBA::Boolean             HasRefPoint,
+                                           const SMESH::PointStruct&  RefPoint,
+                                           CORBA::Boolean             MakeGroups,
+                                           SMESH::ElementType         ElemType,
+                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
 
   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
                                         const SMESH::AxisStruct&            Mirror,
@@ -434,7 +434,21 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                      CORBA::Double y,
                                      CORBA::Double z,
                                      CORBA::Long   nodeID);
-
+  /*!
+   * \brief Return ID of node closest to a given point
+   */
+  CORBA::Long FindNodeClosestTo(CORBA::Double x,
+                                CORBA::Double y,
+                                CORBA::Double z);
+  /*!
+   * Return elements of given type where the given point is IN or ON.
+   *
+   * 'ALL' type means elements of any type excluding nodes
+   */
+  SMESH::long_array* FindElementsByPoint(CORBA::Double      x,
+                                         CORBA::Double      y,
+                                         CORBA::Double      z,
+                                         SMESH::ElementType type);
 
 
   SMESH::SMESH_MeshEditor::Sew_Error
@@ -474,7 +488,7 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    * element - returns false
    */
   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
-  
+
   /*!
    * Return data of mesh edition preview
    */
@@ -496,10 +510,21 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
 
   /*!
    * \brief Return edited mesh ID
-    * \retval int - mesh ID
+   * \retval int - mesh ID
    */
   int GetMeshId() const { return myMesh->GetId(); }
-  
+
+ CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
+                              const SMESH::long_array& theModifiedElems );
+
+  CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
+                             const SMESH::long_array& theModifiedElems );
+
+  CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
+                                  SMESH::SMESH_GroupBase_ptr theModifiedElems );
+
+  CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
+                                   const SMESH::ListOfGroups& theModifiedElems);
 
   /*!
    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -510,10 +535,10 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    *       replicated nodes should be associated to.
    * \return TRUE if operation has been completed successfully, FALSE otherwise
    * \sa DoubleNodeGroup(), DoubleNodeGroups()
-  */
-  CORBA::Boolean DoubleNodes( const SMESH::long_array& theElems, 
-                              const SMESH::long_array& theNodesNot,
-                              const SMESH::long_array& theAffectedElems );
+   */
+  CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems, 
+                                 const SMESH::long_array& theNodesNot,
+                                 const SMESH::long_array& theAffectedElems );
 
   /*!
    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -526,9 +551,9 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    * \return TRUE if operation has been completed successfully, FALSE otherwise
    * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
    */
-  CORBA::Boolean DoubleNodesInRegion( const SMESH::long_array& theElems, 
-                                      const SMESH::long_array& theNodesNot,
-                                      GEOM::GEOM_Object_ptr    theShape );
+  CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems, 
+                                         const SMESH::long_array& theNodesNot,
+                                         GEOM::GEOM_Object_ptr    theShape );
 
   /*!
    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -539,10 +564,10 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    * \return TRUE if operation has been completed successfully, FALSE otherwise
    * \sa DoubleNodes(), DoubleNodeGroups()
    */
-   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theElems,
-                                   SMESH::SMESH_GroupBase_ptr theNodesNot,
-                                   SMESH::SMESH_GroupBase_ptr theAffectedElems );
-
+  CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
+                                      SMESH::SMESH_GroupBase_ptr theNodesNot,
+                                      SMESH::SMESH_GroupBase_ptr theAffectedElems );
+  
   /*!
    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
    * \param theElems - group of of elements (edges or faces) to be replicated
@@ -553,9 +578,9 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    * \return TRUE if operation has been completed successfully, FALSE otherwise
    * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
    */
-   CORBA::Boolean DoubleNodeGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
-                                           SMESH::SMESH_GroupBase_ptr theNodesNot,
-                                           GEOM::GEOM_Object_ptr      theShape );
+  CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
+                                              SMESH::SMESH_GroupBase_ptr theNodesNot,
+                                              GEOM::GEOM_Object_ptr      theShape );
 
   /*!
    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -567,9 +592,9 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    * \return TRUE if operation has been completed successfully, FALSE otherwise
    * \sa DoubleNodeGroup(), DoubleNodes()
    */
-   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theElems,
-                                    const SMESH::ListOfGroups& theNodesNot,
-                                    const SMESH::ListOfGroups& theAffectedElems );
+  CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
+                                       const SMESH::ListOfGroups& theNodesNot,
+                                       const SMESH::ListOfGroups& theAffectedElems );
 
 
   /*!
@@ -583,9 +608,16 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
    * \return TRUE if operation has been completed successfully, FALSE otherwise
    * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
    */
-   CORBA::Boolean DoubleNodeGroupsInRegion( const SMESH::ListOfGroups& theElems,
-                                            const SMESH::ListOfGroups& theNodesNot,
-                                            GEOM::GEOM_Object_ptr      theShape );
+  CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
+                                               const SMESH::ListOfGroups& theNodesNot,
+                                               GEOM::GEOM_Object_ptr      theShape );
+
+    /*!
+     * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+     * The created 2D mesh elements based on nodes of free faces of boundary volumes
+     * \return TRUE if operation has been completed successfully, FALSE otherwise
+    */
+    CORBA::Boolean Make2DMeshFrom3D();
 
  private: //!< private methods
 
@@ -593,13 +625,13 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
 
   /*!
    * \brief Update myLastCreated* or myPreviewData
-    * \param anEditor - it contains edition results
+   * \param anEditor - it contains edition results
    */
   void storeResult(::SMESH_MeshEditor& anEditor);
   /*!
    * \brief Clear myLastCreated* or myPreviewData
    */
-  void initData();
+  void initData(bool deleteSearchers=true);
 
   /*!
    * \brief Return groups by their IDs
@@ -612,7 +644,7 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                      CORBA::Long               NbOfSteps,
                                      CORBA::Double             Tolerance,
                                      const bool                MakeGroups,
-                                    const SMDSAbs_ElementType ElementType=SMDSAbs_All);
+                                     const SMDSAbs_ElementType ElementType=SMDSAbs_All);
   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
                                       const SMESH::DirStruct &  StepVector,
                                       CORBA::Long               NbOfSteps,
@@ -634,18 +666,18 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                           const SMESH::PointStruct &  RefPoint,
                                           const bool                  MakeGroups,
                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
-                                         const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
+                                          const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
   SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
-                                          SMESH::SMESH_IDSource_ptr  Path,
-                                          CORBA::Long                NodeStart,
-                                          CORBA::Boolean             HasAngles,
-                                          const SMESH::double_array& Angles,
-                                          CORBA::Boolean             LinearVariation,
-                                          CORBA::Boolean             HasRefPoint,
-                                          const SMESH::PointStruct&  RefPoint,
-                                          const bool                 MakeGroups,
-                                          const SMDSAbs_ElementType  ElementType,
-                                          SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
+                                           SMESH::SMESH_IDSource_ptr  Path,
+                                           CORBA::Long                NodeStart,
+                                           CORBA::Boolean             HasAngles,
+                                           const SMESH::double_array& Angles,
+                                           CORBA::Boolean             LinearVariation,
+                                           CORBA::Boolean             HasRefPoint,
+                                           const SMESH::PointStruct&  RefPoint,
+                                           const bool                 MakeGroups,
+                                           const SMDSAbs_ElementType  ElementType,
+                                           SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
                               const SMESH::AxisStruct &           Axis,
                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
@@ -665,7 +697,7 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                               ::SMESH_Mesh*             TargetMesh=0);
 
   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
-  
+
   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
                       const SMESH::ListOfGroups * theGroupList);
 
index 175be3dad5af36006b1205a5bd5a3495887c5fcc..6b6d8220b47cbcc80455afddaebb38e69e9cb689 100644 (file)
@@ -95,8 +95,8 @@ int SMESH_Mesh_i::myIdGenerator = 0;
 //=============================================================================
 
 SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
-                           SMESH_Gen_i*            gen_i,
-                           CORBA::Long studyId )
+                            SMESH_Gen_i*            gen_i,
+                            CORBA::Long studyId )
 : SALOME::GenericObj_i( thePOA )
 {
   MESSAGE("SMESH_Mesh_i");
@@ -522,41 +522,40 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Object_ptr aS
  */
 //=============================================================================
 
-SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
-                                 SMESH::SMESH_Hypothesis_ptr anHyp)
+SMESH_Hypothesis::Hypothesis_Status
+SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr       aSubShapeObject,
+                               SMESH::SMESH_Hypothesis_ptr anHyp)
 {
-       if(MYDEBUG) MESSAGE("removeHypothesis()");
-       // **** proposer liste de subShape (selection multiple)
+  if(MYDEBUG) MESSAGE("removeHypothesis()");
+  // **** proposer liste de subShape (selection multiple)
 
-       if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh())
-               THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
-                       SALOME::BAD_PARAM);
+  if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh())
+    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", SALOME::BAD_PARAM);
 
-       SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
-       if (CORBA::is_nil(myHyp))
-         THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
-                       SALOME::BAD_PARAM);
+  SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
+  if (CORBA::is_nil(myHyp))
+    THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", SALOME::BAD_PARAM);
 
-       SMESH_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK;
-       try
-       {
-                TopoDS_Shape myLocSubShape;
-                //use PseudoShape in case if mesh has no shape
-                if(HasShapeToMesh())
-                  myLocSubShape = _gen_i->GeomObjectToShape( aSubShapeObject);
-                else
-                  myLocSubShape = _impl->GetShapeToMesh();
-                
-                int hypId = myHyp->GetId();
-               status = _impl->RemoveHypothesis(myLocSubShape, hypId);
-                if ( !SMESH_Hypothesis::IsStatusFatal(status) )
-                  _mapHypo.erase( hypId );
-       }
-       catch(SALOME_Exception & S_ex)
-       {
-               THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
-       }
-       return status;
+  SMESH_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK;
+  try
+  {
+    TopoDS_Shape myLocSubShape;
+    //use PseudoShape in case if mesh has no shape
+    if(HasShapeToMesh())
+      myLocSubShape = _gen_i->GeomObjectToShape( aSubShapeObject);
+    else
+      myLocSubShape = _impl->GetShapeToMesh();
+
+    int hypId = myHyp->GetId();
+    status = _impl->RemoveHypothesis(myLocSubShape, hypId);
+//     if ( !SMESH_Hypothesis::IsStatusFatal(status) ) EAP: hyp can be used on many subshapes
+//       _mapHypo.erase( hypId );
+  }
+  catch(SALOME_Exception & S_ex)
+  {
+    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+  }
+  return status;
 }
 
 //=============================================================================
@@ -566,14 +565,13 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Ob
 //=============================================================================
 
 SMESH::ListOfHypothesis *
-       SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject)
+        SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject)
 throw(SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
   if (MYDEBUG) MESSAGE("GetHypothesisList");
   if (_impl->HasShapeToMesh() && CORBA::is_nil(aSubShapeObject))
-    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
-                                SALOME::BAD_PARAM);
+    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", SALOME::BAD_PARAM);
 
   SMESH::ListOfHypothesis_var aList = new SMESH::ListOfHypothesis();
 
@@ -588,7 +586,7 @@ throw(SALOME::SALOME_Exception)
     for ( list<const SMESHDS_Hypothesis*>::const_iterator anIt = aLocalList.begin(); i < n && anIt != aLocalList.end(); anIt++ ) {
       SMESHDS_Hypothesis* aHyp = (SMESHDS_Hypothesis*)(*anIt);
       if ( _mapHypo.find( aHyp->GetID() ) != _mapHypo.end() )
-       aList[i++] = SMESH::SMESH_Hypothesis::_narrow( _mapHypo[aHyp->GetID()] );
+        aList[i++] = SMESH::SMESH_Hypothesis::_narrow( _mapHypo[aHyp->GetID()] );
     }
 
     aList->length( i );
@@ -606,14 +604,14 @@ throw(SALOME::SALOME_Exception)
  */
 //=============================================================================
 SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject,
-                                                 const char*           theName )
+                                                  const char*           theName )
      throw(SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
   MESSAGE("SMESH_Mesh_i::GetSubMesh");
   if (CORBA::is_nil(aSubShapeObject))
     THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
-                                SALOME::BAD_PARAM);
+                                 SALOME::BAD_PARAM);
 
   SMESH::SMESH_subMesh_var subMesh;
   SMESH::SMESH_Mesh_var    aMesh = SMESH::SMESH_Mesh::_narrow(_this());
@@ -667,7 +665,10 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
       long aTag = SMESH_Gen_i::GetRefOnShapeTag();
       SALOMEDS::SObject_var anObj, aRef;
       if ( anSO->FindSubObject( aTag, anObj ) && anObj->ReferencedObject( aRef ) )
-       aSubShapeObject = GEOM::GEOM_Object::_narrow( aRef->GetObject() );
+        aSubShapeObject = GEOM::GEOM_Object::_narrow( aRef->GetObject() );
+
+//       if ( aSubShapeObject->_is_nil() ) // not published shape (IPAL13617)
+//         aSubShapeObject = theSubMesh->GetSubShape();
 
       aStudy->NewBuilder()->RemoveObjectWithChildren( anSO );
 
@@ -1980,20 +1981,37 @@ void SMESH_Mesh_i::removeSubMesh (SMESH::SMESH_subMesh_ptr theSubMesh,
                                   GEOM::GEOM_Object_ptr    theSubShapeObject )
 {
   MESSAGE("SMESH_Mesh_i::removeSubMesh()");
-  if ( theSubMesh->_is_nil() || theSubShapeObject->_is_nil() )
+  if ( theSubMesh->_is_nil() /*|| theSubShapeObject->_is_nil()*/ )
     return;
 
-  try {
-    SMESH::ListOfHypothesis_var aHypList = GetHypothesisList( theSubShapeObject );
-    for ( int i = 0, n = aHypList->length(); i < n; i++ ) {
-      removeHypothesis( theSubShapeObject, aHypList[i] );
+  if ( theSubShapeObject->_is_nil() )  // not published shape (IPAL13617)
+  {
+    CORBA::Long shapeId = theSubMesh->GetId();
+    if ( _mapSubMesh.find( shapeId ) != _mapSubMesh.end())
+    {
+      TopoDS_Shape S = _mapSubMesh[ shapeId ]->GetSubShape();
+      if ( !S.IsNull() )
+      {
+        list<const SMESHDS_Hypothesis*> hyps = _impl->GetHypothesisList( S );
+        list<const SMESHDS_Hypothesis*>::const_iterator hyp = hyps.begin();
+        for ( ; hyp != hyps.end(); ++hyp )
+          _impl->RemoveHypothesis(S, (*hyp)->GetID());
+      }
     }
   }
-  catch( const SALOME::SALOME_Exception& ) {
-    INFOS("SMESH_Mesh_i::removeSubMesh(): exception caught!");
+  else
+  {
+    try {
+      SMESH::ListOfHypothesis_var aHypList = GetHypothesisList( theSubShapeObject );
+      for ( int i = 0, n = aHypList->length(); i < n; i++ ) {
+        removeHypothesis( theSubShapeObject, aHypList[i] );
+      }
+    }
+    catch( const SALOME::SALOME_Exception& ) {
+      INFOS("SMESH_Mesh_i::removeSubMesh(): exception caught!");
+    }
+    removeGeomGroupData( theSubShapeObject );
   }
-  removeGeomGroupData( theSubShapeObject );
-
   int subMeshId = theSubMesh->GetId();
 
   _mapSubMesh.erase(subMeshId);
@@ -2100,14 +2118,14 @@ throw(SALOME::SALOME_Exception)
       aLog[indexLog].coords.length(rnum);
       aLog[indexLog].indexes.length(inum);
       for(int i = 0; i < rnum; i++){
-       aLog[indexLog].coords[i] = *ir;
-       //MESSAGE(" "<<i<<" "<<ir.Value());
-       ir++;
+        aLog[indexLog].coords[i] = *ir;
+        //MESSAGE(" "<<i<<" "<<ir.Value());
+        ir++;
       }
       for(int i = 0; i < inum; i++){
-       aLog[indexLog].indexes[i] = *ii;
-       //MESSAGE(" "<<i<<" "<<ii.Value());
-       ii++;
+        aLog[indexLog].indexes[i] = *ii;
+        //MESSAGE(" "<<i<<" "<<ii.Value());
+        ii++;
       }
       indexLog++;
       its++;
@@ -2131,7 +2149,7 @@ throw(SALOME::SALOME_Exception)
 void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
 {
   if(MYDEBUG) MESSAGE("SMESH_Mesh_i::ClearLog");
-  // ****
+  _impl->ClearLog();
 }
 
 //=============================================================================
@@ -2288,8 +2306,8 @@ void SMESH_Mesh_i::PrepareForWriting (const char* file)
 }
 
 void SMESH_Mesh_i::ExportToMED (const char* file,
-                               CORBA::Boolean auto_groups,
-                               SMESH::MED_VERSION theVersion)
+                                CORBA::Boolean auto_groups,
+                                SMESH::MED_VERSION theVersion)
   throw(SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
@@ -2304,20 +2322,20 @@ void SMESH_Mesh_i::ExportToMED (const char* file,
       aMeshName = aMeshSO->GetName();
       // asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes
       if ( !aStudy->GetProperties()->IsLocked() )
-       {
-       SALOMEDS::GenericAttribute_var anAttr;
-       SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
-       SALOMEDS::AttributeExternalFileDef_var aFileName;
-       anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeExternalFileDef");
-       aFileName = SALOMEDS::AttributeExternalFileDef::_narrow(anAttr);
-       ASSERT(!aFileName->_is_nil());
+        {
+        SALOMEDS::GenericAttribute_var anAttr;
+        SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+        SALOMEDS::AttributeExternalFileDef_var aFileName;
+        anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeExternalFileDef");
+        aFileName = SALOMEDS::AttributeExternalFileDef::_narrow(anAttr);
+        ASSERT(!aFileName->_is_nil());
         aFileName->SetValue(file);
         SALOMEDS::AttributeFileType_var aFileType;
         anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeFileType");
         aFileType = SALOMEDS::AttributeFileType::_narrow(anAttr);
         ASSERT(!aFileType->_is_nil());
         aFileType->SetValue("FICHIERMED");
-       }
+        }
     }
   }
   // Update Python script
@@ -2334,7 +2352,7 @@ void SMESH_Mesh_i::ExportToMED (const char* file,
 }
 
 void SMESH_Mesh_i::ExportMED (const char* file,
-                             CORBA::Boolean auto_groups)
+                              CORBA::Boolean auto_groups)
   throw(SALOME::SALOME_Exception)
 {
   ExportToMED(file,auto_groups,SMESH::MED_V2_1);
@@ -2418,7 +2436,7 @@ CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
 CORBA::Long SMESH_Mesh_i::NbElements()throw (SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
-  return NbEdges() + NbFaces() + NbVolumes();
+  return Nb0DElements() + NbEdges() + NbFaces() + NbVolumes();
 }
 
 //=============================================================================
index 2c46676f64ea422ac3bb59af65ee6692a5ebdb3f..e8598de3479d7af7f5d348a14cae49db0ca7e3fe 100644 (file)
@@ -58,7 +58,7 @@ class SMESH_I_EXPORT SMESH_Mesh_i:
 public:
   SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
                 SMESH_Gen_i*            myGen_i,
-               CORBA::Long             studyId );
+              CORBA::Long             studyId );
 
   virtual ~SMESH_Mesh_i();
 
index bd7268049430ef85fee519a2b0f295ed32ce01ac..2345a4279fb460853ceb569feb942d8c834bb4fb 100644 (file)
@@ -239,19 +239,19 @@ void SMESH_NoteBook::ReplaceVariables()
       TMeshEditorMap::const_iterator meIt = myMeshEditors.find(aObject);
       if(meIt != myMeshEditors.end()) {
         TCollection_AsciiString aMesh = (*meIt).second;
-       it = _objectMap.find(aMesh);
+        it = _objectMap.find(aMesh);
       }
     }
     
     if(it == _objectMap.end()) { // additional check for pattern mapping
       if(aMethod.IsEqual("ApplyToMeshFaces") ||
-        aMethod.IsEqual("ApplyToHexahedrons"))
-       it = _objectMap.find(aCmd->GetArg(1));
+         aMethod.IsEqual("ApplyToHexahedrons"))
+        it = _objectMap.find(aCmd->GetArg(1));
     }
     
     if(it != _objectMap.end()) {
       if(MYDEBUG)
-       cout << "Found object : " << (*it).first << endl;
+        cout << "Found object : " << (*it).first << endl;
       ObjectStates *aStates = (*it).second;
       // Case for LocalLength hypothesis
       if(aStates->GetObjectType().IsEqual("LocalLength") && aStates->GetCurrectState().size() >= 2) {
@@ -402,9 +402,9 @@ void SMESH_NoteBook::ReplaceVariables()
       }
       
       else if(aStates->GetObjectType().IsEqual("Mesh")) {
-       TState aCurrentState = aStates->GetCurrectState();
+        TState aCurrentState = aStates->GetCurrectState();
         int aCurrentStateSize = aCurrentState.size();
-       if(aMethod.IsEqual("Translate")                  ||
+        if(aMethod.IsEqual("Translate")                  ||
            aMethod.IsEqual("TranslateMakeGroups")        ||
            aMethod.IsEqual("TranslateMakeMesh")          ||
            aMethod.IsEqual("TranslateObject")            ||
@@ -419,211 +419,211 @@ void SMESH_NoteBook::ReplaceVariables()
             }
           }
           if(anArgIndex > 0) {
-           if(aCurrentStateSize == 3) { // translation by dx, dy, dz
-             for(int j = 0; j < aCurrentStateSize; j++) {
-               if(!aCurrentState.at(j).IsEmpty()) {
-                 isVariableFound = true;
-                 aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
-               }
-             }
-           }
-           else if(aCurrentStateSize == 6) { // translation by x1, x2, y1, y2, z1, z2
-             // TODO: limitation until operations on the variables will be introduced
-             /*
-             isVariableFound = true;
-             for(int j = 0; j < 3; j++) {
-               TCollection_AsciiString anArg = aCmd->GetArg(anArgIndex+j);
-               TCollection_AsciiString aValue1 = aCurrentState.at(2*j), aValue2 = aCurrentState.at(2*j+1);
-               bool aV1 = !aValue1.IsEmpty();
-               bool aV2 = !aValue2.IsEmpty();
-               double aValue, aCurrentValue = anArg.IsRealValue() ? anArg.RealValue() : 0;
-               if(aV1 && !aV2) {
-                 if(!GetReal(aValue1, aValue))
-                   aValue = 0;
-                 aValue2 = TCollection_AsciiString( aValue + aCurrentValue );
-               }
-               else if(!aV1 && aV2) {
-                 if(!GetReal(aValue2, aValue))
-                   aValue = 0;
-                 aValue1 = TCollection_AsciiString( aValue - aCurrentValue );
-               }
-               else if(!aV1 && !aV2) {
-                 aValue1 = TCollection_AsciiString( 0 );
-                 aValue2 = TCollection_AsciiString( aCurrentValue );
-               }
-               aCmd->SetArg(anArgIndex+j, aValue1 + ", " + aValue2 );
-             }
-             */
-           }
+            if(aCurrentStateSize == 3) { // translation by dx, dy, dz
+              for(int j = 0; j < aCurrentStateSize; j++) {
+                if(!aCurrentState.at(j).IsEmpty()) {
+                  isVariableFound = true;
+                  aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+                }
+              }
+            }
+            else if(aCurrentStateSize == 6) { // translation by x1, x2, y1, y2, z1, z2
+              // TODO: limitation until operations on the variables will be introduced
+              /*
+              isVariableFound = true;
+              for(int j = 0; j < 3; j++) {
+                TCollection_AsciiString anArg = aCmd->GetArg(anArgIndex+j);
+                TCollection_AsciiString aValue1 = aCurrentState.at(2*j), aValue2 = aCurrentState.at(2*j+1);
+                bool aV1 = !aValue1.IsEmpty();
+                bool aV2 = !aValue2.IsEmpty();
+                double aValue, aCurrentValue = anArg.IsRealValue() ? anArg.RealValue() : 0;
+                if(aV1 && !aV2) {
+                  if(!GetReal(aValue1, aValue))
+                    aValue = 0;
+                  aValue2 = TCollection_AsciiString( aValue + aCurrentValue );
+                }
+                else if(!aV1 && aV2) {
+                  if(!GetReal(aValue2, aValue))
+                    aValue = 0;
+                  aValue1 = TCollection_AsciiString( aValue - aCurrentValue );
+                }
+                else if(!aV1 && !aV2) {
+                  aValue1 = TCollection_AsciiString( 0 );
+                  aValue2 = TCollection_AsciiString( aCurrentValue );
+                }
+                aCmd->SetArg(anArgIndex+j, aValue1 + ", " + aValue2 );
+              }
+              */
+            }
           }
           if(isVariableFound) {
             TCollection_AsciiString aDim;
-           if(aCurrentStateSize == 6)
-             aDim = "6";
+            if(aCurrentStateSize == 6)
+              aDim = "6";
             aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr"+aDim);
             aCmd->SetArg(anArgIndex - 2, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".DirStructStr");
           }
           aStates->IncrementState();
         }
-       else if(aMethod.IsEqual("Rotate")                  ||
-               aMethod.IsEqual("RotateMakeGroups")        ||
-               aMethod.IsEqual("RotateMakeMesh")          ||
+        else if(aMethod.IsEqual("Rotate")                  ||
+                aMethod.IsEqual("RotateMakeGroups")        ||
+                aMethod.IsEqual("RotateMakeMesh")          ||
                 aMethod.IsEqual("RotateObject")            ||
                 aMethod.IsEqual("RotateObjectMakeGroups")  ||
                 aMethod.IsEqual("RotateObjectMakeMesh")    ||
-               aMethod.IsEqual("RotationSweep")           ||
-               aMethod.IsEqual("RotationSweepObject")     ||
-               aMethod.IsEqual("RotationSweepObject1D")   ||
-               aMethod.IsEqual("RotationSweepObject2D")   ||
-               aMethod.IsEqual("RotationSweepMakeGroups") ||
-               aMethod.IsEqual("RotationSweepObjectMakeGroups") ||
-               aMethod.IsEqual("RotationSweepObject1DMakeGroups") ||
-               aMethod.IsEqual("RotationSweepObject2DMakeGroups") ||
-               aMethod.IsEqual("Mirror")                  ||
-               aMethod.IsEqual("MirrorMakeMesh")          ||
+                aMethod.IsEqual("RotationSweep")           ||
+                aMethod.IsEqual("RotationSweepObject")     ||
+                aMethod.IsEqual("RotationSweepObject1D")   ||
+                aMethod.IsEqual("RotationSweepObject2D")   ||
+                aMethod.IsEqual("RotationSweepMakeGroups") ||
+                aMethod.IsEqual("RotationSweepObjectMakeGroups") ||
+                aMethod.IsEqual("RotationSweepObject1DMakeGroups") ||
+                aMethod.IsEqual("RotationSweepObject2DMakeGroups") ||
+                aMethod.IsEqual("Mirror")                  ||
+                aMethod.IsEqual("MirrorMakeMesh")          ||
                 aMethod.IsEqual("MirrorMakeGroups")        ||
                 aMethod.IsEqual("MirrorObject")            || 
                 aMethod.IsEqual("MirrorObjectMakeMesh")    ||
                 aMethod.IsEqual("MirrorObjectMakeGroups")) {
-         bool isSubstitute = false;
-         int anArgIndex = 0;
-         for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
-           if(aCmd->GetArg(i).IsEqual("SMESH.AxisStruct")) {
-             anArgIndex = i+1;
-             break;
-           }
-         }
-         if(anArgIndex > 0) {
-           for(int j = 0; j < aCurrentStateSize; j++) {
-             if(!aCurrentState.at(j).IsEmpty()) {
-               if(j < 6) // 0-5 - axis struct, 6 - angle (rotation & sweep), 7-8 - nbSteps and tolerance (sweep)
-                 isSubstitute = true;
-               aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
-             }
-           }
-         }
-         if(isSubstitute)
-           aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".AxisStructStr");
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("AddNode") ||
-               aMethod.IsEqual("MoveClosestNodeToPoint")) {
-         for(int j = 0; j < aCurrentStateSize; j++) {
-           if(!aCurrentState.at(j).IsEmpty())
-             aCmd->SetArg(j+1, aCurrentState.at(j));
-         }
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("MoveNode")) {
-         for(int j = 0; j < aCurrentStateSize; j++) {
-           if(!aCurrentState.at(j).IsEmpty())
-             aCmd->SetArg(j+2, aCurrentState.at(j));
-         }
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("ExtrusionSweep") ||
-               aMethod.IsEqual("ExtrusionSweepObject") ||
-               aMethod.IsEqual("ExtrusionSweepObject1D") ||
-               aMethod.IsEqual("ExtrusionSweepObject2D") ||
-               aMethod.IsEqual("ExtrusionSweepMakeGroups") ||
-               aMethod.IsEqual("ExtrusionSweepObjectMakeGroups") ||
-               aMethod.IsEqual("ExtrusionSweepObject1DMakeGroups") ||
-               aMethod.IsEqual("ExtrusionSweepObject2DMakeGroups")) {
-         bool isSubstitute = false;
-         int anArgIndex = 0;
-         for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
-           if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
-             anArgIndex = i+1;
-             break;
-           }
-         }
-         if(anArgIndex > 0) {
-           for(int j = 0; j < aCurrentStateSize; j++) {
-             if(!aCurrentState.at(j).IsEmpty()) {
-               if(j < 3) // 0-2 - dir struct, 3 - number of steps
-                 isSubstitute = true;
-               aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
-             }
-           }
-         }
-         if(isSubstitute) {
+          bool isSubstitute = false;
+          int anArgIndex = 0;
+          for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+            if(aCmd->GetArg(i).IsEqual("SMESH.AxisStruct")) {
+              anArgIndex = i+1;
+              break;
+            }
+          }
+          if(anArgIndex > 0) {
+            for(int j = 0; j < aCurrentStateSize; j++) {
+              if(!aCurrentState.at(j).IsEmpty()) {
+                if(j < 6) // 0-5 - axis struct, 6 - angle (rotation & sweep), 7-8 - nbSteps and tolerance (sweep)
+                  isSubstitute = true;
+                aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+              }
+            }
+          }
+          if(isSubstitute)
+            aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".AxisStructStr");
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("AddNode") ||
+                aMethod.IsEqual("MoveClosestNodeToPoint")) {
+          for(int j = 0; j < aCurrentStateSize; j++) {
+            if(!aCurrentState.at(j).IsEmpty())
+              aCmd->SetArg(j+1, aCurrentState.at(j));
+          }
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("MoveNode")) {
+          for(int j = 0; j < aCurrentStateSize; j++) {
+            if(!aCurrentState.at(j).IsEmpty())
+              aCmd->SetArg(j+2, aCurrentState.at(j));
+          }
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("ExtrusionSweep") ||
+                aMethod.IsEqual("ExtrusionSweepObject") ||
+                aMethod.IsEqual("ExtrusionSweepObject1D") ||
+                aMethod.IsEqual("ExtrusionSweepObject2D") ||
+                aMethod.IsEqual("ExtrusionSweepMakeGroups") ||
+                aMethod.IsEqual("ExtrusionSweepObjectMakeGroups") ||
+                aMethod.IsEqual("ExtrusionSweepObject1DMakeGroups") ||
+                aMethod.IsEqual("ExtrusionSweepObject2DMakeGroups")) {
+          bool isSubstitute = false;
+          int anArgIndex = 0;
+          for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+            if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+              anArgIndex = i+1;
+              break;
+            }
+          }
+          if(anArgIndex > 0) {
+            for(int j = 0; j < aCurrentStateSize; j++) {
+              if(!aCurrentState.at(j).IsEmpty()) {
+                if(j < 3) // 0-2 - dir struct, 3 - number of steps
+                  isSubstitute = true;
+                aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+              }
+            }
+          }
+          if(isSubstitute) {
             aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
             aCmd->SetArg(anArgIndex - 2, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".DirStructStr");
-         }
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("ExtrusionAlongPath") ||
-               aMethod.IsEqual("ExtrusionAlongPathObject") ||
-               aMethod.IsEqual("ExtrusionAlongPathObject1D") ||
-               aMethod.IsEqual("ExtrusionAlongPathObject2D") ||
-               aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
-               aMethod.IsEqual("ExtrusionAlongPathObjectMakeGroups") ||
-               aMethod.IsEqual("ExtrusionAlongPathObject1DMakeGroups") ||
-               aMethod.IsEqual("ExtrusionAlongPathObject2DMakeGroups") ||
-               /* workaround for a bug in the command parsing algorithm */
-               aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1 ||
-               aCmd->GetString().Search("ExtrusionAlongPathObjectMakeGroups") != -1 ||
-               aCmd->GetString().Search("ExtrusionAlongPathObject1DMakeGroups") != -1 ||
-               aCmd->GetString().Search("ExtrusionAlongPathObject2DMakeGroups") != -1 ) {
-         int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
-         bool isSubstitute = false;
-         int anArgIndex = 0;
-         for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
-           if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
-             anArgIndex = i-1-aNbAngles;
-             break;
-           }
-         }
-         if(anArgIndex > 0) {
-           int j = 0;
-           for(; j < aNbAngles; j++) {
-             if(!aCurrentState.at(j).IsEmpty()) {
-               aCmd->SetArg(anArgIndex+j-1, aCurrentState.at(j));
-             }
-           }
-           for(; j < aNbAngles+3; j++) {
-             if(!aCurrentState.at(j).IsEmpty()) {
-               isSubstitute = true;
-               aCmd->SetArg(anArgIndex+j+2, aCurrentState.at(j));
-             }
-           }
-         }
-         if(isSubstitute)
-           aCmd->SetArg(anArgIndex + aNbAngles + 1,
-                        TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("TriToQuad") ||
-               aMethod.IsEqual("Concatenate") ||
-               aMethod.IsEqual("ConcatenateWithGroups")) {
-         if(aCurrentStateSize && !aCurrentState.at(0).IsEmpty())
-           aCmd->SetArg(aCmd->GetNbArgs(), aCurrentState.at(0));
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("Smooth") ||
-               aMethod.IsEqual("SmoothObject") ||
-               aMethod.IsEqual("SmoothParametric") ||
-               aMethod.IsEqual("SmoothParametricObject")) {
-         int anArgIndex = aCmd->GetNbArgs() - 2;
-         for(int j = 0; j < aCurrentStateSize; j++) {
-           if(!aCurrentState.at(j).IsEmpty())
-             aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
-         }
-         aStates->IncrementState();
-       }
-       else if(aMethod.IsEqual("ApplyToMeshFaces") ||
-               aMethod.IsEqual("ApplyToHexahedrons")) {
-         int anArgIndex = aCmd->GetNbArgs()-1;
-         for(int j = 0; j < aCurrentStateSize; j++)
-           if(!aCurrentState.at(j).IsEmpty())
-             aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
-         aStates->IncrementState();
-       }
+          }
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("ExtrusionAlongPath") ||
+                aMethod.IsEqual("ExtrusionAlongPathObject") ||
+                aMethod.IsEqual("ExtrusionAlongPathObject1D") ||
+                aMethod.IsEqual("ExtrusionAlongPathObject2D") ||
+                aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
+                aMethod.IsEqual("ExtrusionAlongPathObjectMakeGroups") ||
+                aMethod.IsEqual("ExtrusionAlongPathObject1DMakeGroups") ||
+                aMethod.IsEqual("ExtrusionAlongPathObject2DMakeGroups") ||
+                /* workaround for a bug in the command parsing algorithm */
+                aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1 ||
+                aCmd->GetString().Search("ExtrusionAlongPathObjectMakeGroups") != -1 ||
+                aCmd->GetString().Search("ExtrusionAlongPathObject1DMakeGroups") != -1 ||
+                aCmd->GetString().Search("ExtrusionAlongPathObject2DMakeGroups") != -1 ) {
+          int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
+          bool isSubstitute = false;
+          int anArgIndex = 0;
+          for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+            if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+              anArgIndex = i-1-aNbAngles;
+              break;
+            }
+          }
+          if(anArgIndex > 0) {
+            int j = 0;
+            for(; j < aNbAngles; j++) {
+              if(!aCurrentState.at(j).IsEmpty()) {
+                aCmd->SetArg(anArgIndex+j-1, aCurrentState.at(j));
+              }
+            }
+            for(; j < aNbAngles+3; j++) {
+              if(!aCurrentState.at(j).IsEmpty()) {
+                isSubstitute = true;
+                aCmd->SetArg(anArgIndex+j+2, aCurrentState.at(j));
+              }
+            }
+          }
+          if(isSubstitute)
+            aCmd->SetArg(anArgIndex + aNbAngles + 1,
+                         TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("TriToQuad") ||
+                aMethod.IsEqual("Concatenate") ||
+                aMethod.IsEqual("ConcatenateWithGroups")) {
+          if(aCurrentStateSize && !aCurrentState.at(0).IsEmpty())
+            aCmd->SetArg(aCmd->GetNbArgs(), aCurrentState.at(0));
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("Smooth") ||
+                aMethod.IsEqual("SmoothObject") ||
+                aMethod.IsEqual("SmoothParametric") ||
+                aMethod.IsEqual("SmoothParametricObject")) {
+          int anArgIndex = aCmd->GetNbArgs() - 2;
+          for(int j = 0; j < aCurrentStateSize; j++) {
+            if(!aCurrentState.at(j).IsEmpty())
+              aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+          }
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("ApplyToMeshFaces") ||
+                aMethod.IsEqual("ApplyToHexahedrons")) {
+          int anArgIndex = aCmd->GetNbArgs()-1;
+          for(int j = 0; j < aCurrentStateSize; j++)
+            if(!aCurrentState.at(j).IsEmpty())
+              aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+          aStates->IncrementState();
+        }
       }
     }
     else {
       if(MYDEBUG)
-       cout << "Object not found" << endl;
+        cout << "Object not found" << endl;
     }
     if(MYDEBUG) {
       cout<<"Command after: "<< aCmd->GetString()<<endl;
@@ -716,7 +716,7 @@ void SMESH_NoteBook::AddCommand(const TCollection_AsciiString& theString)
 
   if ( aCommand->GetMethod() == "GetMeshEditor" ) { // MeshEditor creation
     myMeshEditors.insert( make_pair( aCommand->GetResultValue(),
-                                    aCommand->GetObject() ) );
+                                     aCommand->GetObject() ) );
   }
 }
 
index b96a8d95452d8dffb8af233911ac17ebe72f6a84..f3f1fcfbc2c4d7294ad93305c64ea988fadd841a 100644 (file)
@@ -149,7 +149,7 @@ CORBA::Boolean SMESH_Pattern_i::LoadFromFace(SMESH::SMESH_Mesh_ptr theMesh,
     return false;
 
   // Update Python script
-  TPythonDump() << "isDone = pattern.LoadFromFace( " << theMesh << ", "
+  TPythonDump() << "isDone = pattern.LoadFromFace( " << theMesh << ".GetMesh(), "
                 << theFace << ", " << theProject << " )";
   addErrorCode( "LoadFromFace" );
 
@@ -180,7 +180,7 @@ CORBA::Boolean SMESH_Pattern_i::LoadFrom3DBlock(SMESH::SMESH_Mesh_ptr theMesh,
     return false;
 
   // Update Python script
-  TPythonDump() << "isDone = pattern.LoadFrom3DBlock( " << theMesh << ", " << theBlock << " )";
+  TPythonDump() << "isDone = pattern.LoadFrom3DBlock( " << theMesh << ".GetMesh(), " << theBlock << " )";
   addErrorCode( "LoadFrom3DBlock" );
 
   return myPattern.Load( aMesh, TopoDS::Shell( exp.Current() ));
@@ -316,7 +316,7 @@ SMESH::point_array*
   }
 
   // Update Python script
-  TPythonDump() << "pattern.ApplyToMeshFaces( " << theMesh << ", "
+  TPythonDump() << "pattern.ApplyToMeshFaces( " << theMesh << ".GetMesh(), "
                 << theFacesIDs << ", "
                 << theNodeIndexOnKeyPoint1 << ", " << theReverse << " )";
 
@@ -361,7 +361,7 @@ SMESH::point_array*
   }
 
   // Update Python script
-  TPythonDump() << "pattern.ApplyToHexahedrons( " << theMesh << ", "
+  TPythonDump() << "pattern.ApplyToHexahedrons( " << theMesh << ".GetMesh(), "
                 << theVolumesIDs << ", "
                 << theNode000Index << ", " << theNode001Index << " )";
 
@@ -382,7 +382,7 @@ CORBA::Boolean SMESH_Pattern_i::MakeMesh (SMESH::SMESH_Mesh_ptr theMesh,
     return false;
 
   // Update Python script
-  TPythonDump() << "isDone = pattern.MakeMesh( " << theMesh << ", "
+  TPythonDump() << "isDone = pattern.MakeMesh( " << theMesh << ".GetMesh(), "
                 << CreatePolygons << ", " << CreatePolyedrs << " )";
   addErrorCode( "MakeMesh" );
 
index bee3cbb834c7fec061ebeee2f9414342a5355ec8..10d6dd85c8a65d112d21a9e23ac08ab8ebdb40f9 100644 (file)
@@ -56,7 +56,7 @@ public:
   static TCollection_AsciiString
   ConvertScript(const TCollection_AsciiString& theScript,
                 Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
-               Resource_DataMapOfAsciiStringAsciiString& theObjectNames);
+                Resource_DataMapOfAsciiStringAsciiString& theObjectNames);
 
   /*!
    * \brief Return the name of the python file wrapping IDL API
index 7d342969a9adaa29e0c2fa776efa6a2e636e1f1d..2720de2c73b981c3a92316c5291d137b8358dab2 100644 (file)
@@ -59,9 +59,9 @@ SMESH_subMesh_i::SMESH_subMesh_i()
 //=============================================================================
 
 SMESH_subMesh_i::SMESH_subMesh_i( PortableServer::POA_ptr thePOA,
-                                 SMESH_Gen_i*            gen_i,
-                                 SMESH_Mesh_i*           mesh_i,
-                                 int                     localId )
+                                  SMESH_Gen_i*            gen_i,
+                                  SMESH_Mesh_i*           mesh_i,
+                                  int                     localId )
      : SALOME::GenericObj_i( thePOA )
 {
   MESSAGE("SMESH_subMesh_i::SMESH_subMesh_i");
@@ -458,11 +458,11 @@ GEOM::GEOM_Object_ptr SMESH_subMesh_i::GetSubShape()
       TopoDS_Shape S = _mesh_i->_mapSubMesh[ _localId ]->GetSubShape();
       if ( !S.IsNull() ) {
         aShapeObj = _gen_i->ShapeToGeomObject( S );
-       //mzn: N7PAL16232, N7PAL16233
-       //In some cases it's possible that GEOM_Client contains the shape same to S, but
-       //with another orientation.
-       if (aShapeObj->_is_nil())
-         aShapeObj = _gen_i->ShapeToGeomObject( S.Reversed() );
+        //mzn: N7PAL16232, N7PAL16233
+        //In some cases it's possible that GEOM_Client contains the shape same to S, but
+        //with another orientation.
+        if (aShapeObj->_is_nil())
+          aShapeObj = _gen_i->ShapeToGeomObject( S.Reversed() );
       }
     }
   }
index 26b37a7539623349ada7ef85054ff85916abb927..5a6eb8bd8ed34c63014ae8a4ff90858762bf85f0 100644 (file)
@@ -48,8 +48,8 @@ public:
   SMESH_subMesh_i();
   SMESH_subMesh_i( PortableServer::POA_ptr thePOA,
                    SMESH_Gen_i*            gen_i,
-                  SMESH_Mesh_i*           mesh_i,
-                  int                     localId );
+                   SMESH_Mesh_i*           mesh_i,
+                   int                     localId );
   ~SMESH_subMesh_i();
 
   CORBA::Long GetNumberOfElements()
index 869ea8108e40298aa184cb2ced887e8d8e2d6912..5b820f22f30795abffc6095c63b0f5795ff1ec68 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index c1138f9be01c9f62e5f8556d4d62adc9c5854daa..523429d2bb29020c24975a83d8eb2d0f71e319db 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 678f6db30eb84edd5d21f439c04e87f0ed5b45de..35bd54cda299820577daf6364117a23922372b1d 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e40854bbe46a149c42d35031c97889cf064c498d..bc4e115f035d5c9aa41d07c751870b60b226dd00 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 86e8ce1f023fbd51dd59f70b907da1e72bc3617e..a480d029f261ad09da17a8781f6c896771755877 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index b66986067fb1048d67e57b6f34f184995594bdd9..0ba648118dfc84489a79bd64e026741c1a70c16a 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 843071ed15f7e79e57e6900ec624f926c9d2172e..e82abfa409e4d1b0d198e0206993a0110c7481b7 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 1bc88014bc125f89e79e1f8ecdbf33c77eda4bd4..e4763c0b05ff338874bbdd8c796f53a7a7db5012 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 0b15ecbac335c8bdefc03c8f52fb6f033c1e677a..85dbd4056c7360b7633963ee4d6af35112b4ba04 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 67d498fad333f5ea22399b4528b415b28745b6f7..816dede851bb7945cf47fe7dec125bffc936c9db 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 6585cd5e4bf84137d41c2b20f12e2a6d45133c90..11428f8c5d0d5e8a6c296e18d782e99155762801 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 11a68dfa4cb1779214499b02c71544212c68c91b..e3af5d2d1fbd5d70ffc99c3f0541d909d20112fb 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index b5e54a42dfa37cd15a2e82eeaa337c3e883d0312..3b1ca2e79b8a6f9c851d7ed6fa6c694237c3f9cc 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e61ce50f21c11301b783d9c1b1b599e1fcd5bc86..d3e744d5fa7d16e7b583e6bebd038b031a291d41 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index b57138a1c5aa3ba04bd2f1891a6c0eecd4b439a3..8a1b39cacc6f50009785eee6dcc898806d438e84 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index c77f1f00142ea3667db881d68201bfb60c123270..79cf3b536b56121d39b727420c0b77954db5b65d 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e13fd86590c6211849b9957bb25449879f472782..fd1b3ef62e52524de61cab9683b1d6f9607d37cc 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 39dd1db2debcec10a933a77018e0c9a0edf3f15d..279ae11ab57f44fc3d4b5d2239f084a3e7e1a6b6 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 18cdb4a4cc940d4ce59413d7802e746c57f9280e..41e561329c34c185b947054811acb294a9e1b631 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 245fccec4b652631dff625b1484dcb6d67e0c855..f5f6d65e50323ae91c3226609b64668b9f22568d 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 597b1d0eae861da9d0beb7fcbe72665ebe9d3e5e..bb406f035f8097bb26e264404c2fae31bfc057ef 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 5195cc9ae07d78606ce6ae9a82fd232feaf69275..6a73b38b8161acc44a69a1fe7fffbbfa942654a0 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index ae003973525063341437aa047333bdccec98af19..16295a5e5c8ef51f963797586e897da5d5e522a2 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index bb190b30f4d66179687d56684fb309ffbd7ba2be..483cd666dd60474f4cd8a1447a98beb01d04da16 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 6aa8d37164882540d00beb59c1df2dd2351cc1de..534bed16cca0105d2722da8bc056d1e682c90665 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index b1c1e8b9b7c521144491aca287d4282b69f551ad..4c5fc646da63f7aff9abb41d19edac0ce36caa96 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index d32e9b0bd1012101f445f6c4708bd39df041be28..4345b08b8f2d009275f3e29bf71dfe6746fb2434 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index f1b02854d7676a819c6c0738351cd160f36a7ece..46032383c3e42f518f304cc6ef9e1cf9a7c1629a 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 80780ca63c8fe64f781829757b0d37bb69280591..9ff0027040430d23ac0922d6e872d402ec0a34b2 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e296eaed15c7ceae9a1435364dcc76ae39dd1485..038e64e0b655c818e85d4f6eef542eed9679dbc9 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index ff2f421f73dddbf017a804941aab82eeca378b09..1307067df0221544f50b94b2ccbdbfc0d1b39fa5 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 8a0ec7cfcf4d554714a383296a1a2c285b2d5975..92005898dcc50b012e6d119c4ee66de69c5ef389 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 01286ea65f733eba8b26797cbff23986b3369166..594832b32dbd3630a55aadc3f3f059b1cb794efe 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index c18504deac4e9159890226628d4eea8bc5d26a3f..da4eda8435792be5748c968878892caaed30a8d6 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
@@ -129,5 +130,5 @@ for a in log:
             i2 = a.indexes[ii]
             ii = ii+1
             i3 = a.indexes[ii]
-            #ii = ii+1
+            ii = ii+1
             print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3)
index 421acc1ed2308502c4c4b29a93b8c81523fb7937..407d25ead854922ef79cabc84f9b24fb8316b58d 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 25ce49704e3d5f6da65db3b06abec6a0d01b6ac4..cd68018d2fb63d04b2a6cf0de3dc20108ee7c21a 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e529d2c13c4573c0b3fc6455bb227aef8aca6e1d..c87694894c9eb8201feada5aa7f79daf9412ef56 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index fe38b2da4fc1a06c1cae15cf1286f018f9ed4e7f..01c91297383fd357ddc452fd14bc2583d6c009b8 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 59c853a46bc02f3edaaf241dce9a2f83f81cec34..a2c771b80fffc0c7104509d81a2873fee93b7359 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index dd86094d51c11552ffe66684c389e1b07428fb88..18183393469b6fc3d05d8a3475cd95c2bd740632 100755 (executable)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 03a380ca653dc88e68e70c05b3eeb895815243e5..616f0e39ded82148ccc667e474743da7eff00deb 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 7750233704156310cc963ea305800c58468191f6..0e768a4d1849e9883b539e51d379ce6ea46fce8b 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index d6688362ddff587d09c609b49de396f8dbbed1fd..eb2c4e1fe4b2a9069d1e856943eee49d52638941 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e4159ebdbd997fad640a110f5d757be66caae06a..0ef515b9cf336bfbb2803c93e8a487be474f09e5 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index fbc8c5f231c325f44547c921a13d1752d96d707f..34bb6e39d575338774e82cd4fb08e9ce8a468f58 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 732b579b722d7b6b48b541681cfbefc5e662cff9..885d8722a7c5631216adeefcbcebf845aeea872e 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index e3447c37da10fc2bf4c7ba13ed165da696210bc3..d620a641157772221a57e63df6e3ebcf7777294c 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 18d4900ffb7f9521ff35d404681743a7a7531e45..02f6f2c87ef5ab972060130838c686ee4a8b428d 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 050509e29f70618bd815c1fa3bbf4ed36ecc7d3f..31793da2e4624562b02d769e84b50ea7040e2b28 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 3f2c6893d84418d6bb43df2382bf015b0e3838d1..acdc7f5e9925d37b34c2e2de4711167db8599a16 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index c46864c2d5c325c3e53ae422ffe3a0fc4abf9439..4ca5c481db38baecb5723a2def372813e21981fa 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 6ccb77d41e83dfb3cc5042b085374de701452802..cb417562eee9f62a24428454c4e4cee694e38e05 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index d0e0fb72a4a5e7f44fe165ae7b9d9d3bf556bdda..4fd9c6db21644888051ff2f68ef80410ff7ff5cc 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 8f63e031d52080997ef807c81584a372d39c10e3..f9a8c399b4d77eeb70eaa55d00444fb0c13aba12 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 3369074d2873babb00f92f550c28fb2819b91af5..1ed38c03b3d3f122b9f67d3ab0d2fe557952715f 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 2f41e3beef6288528be0106c5c61a7ce5953f811..3499a3e0bba07f47fa429b886b360bba4dca6e82 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 0b3ff6baf81abd2833d67ee003d5e8ef3faedc69..609f48052624f0f3fe03305f3c491bb5e87793e1 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 42d460b93965ececf89e2dc43d9cba0b4b73c7a5..1c89971fce38dda2a87df88b3de05938d7a10a46 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 2bcba7195620e6003e07508d3950e37d623a6126..72a0a4b92594e33d95f52c9482e3ce719826e012 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 774cc5f7d08dabfe65ced71bc5b1e9218b4cda5e..4a3adf337077e044acd5b5d10c867914c44580dc 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index a25de9627f7257e1c652996a0fd3682f9fca6f8b..c94136b20e309192a0b8717918bf7968908488fd 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index f56015619e7fa68efd29cf553d01fc8b3889b2cb..fc78722d7096d00943b9b2ab9f1608c32d4ed862 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 510adf8002c363c5094f77abbe3abc915c2033c6..53b6e2ae64e2b663fe9a4e183250ac186d5e4ebe 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index f6c3c3789f923e69f9efa0ba7b505ec56efa7d20..b7a511d4d113c73d94e9b8ea2b158c80653d9ee1 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 6d9f3077dac394051f92470e79350e97c96a7614..2e7b52d821c0cddd52ecd42b626d40de57f9e5e1 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 1e218a8fa90e28bb71b1eec4e66d1f3c3f8ca26b..2f378a1b180466444549e0ca269ad9102936e762 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index af892e7ff7b2b59af6a9a5bea6c94f329a90ee3e..f1a857d9a1cb620394450554ac7bdbb66510fa79 100755 (executable)
@@ -1,73 +1,74 @@
-\r
-import sys\r
-import salome\r
-import geompy\r
-import math\r
-import SALOMEDS\r
-import SMESH\r
-import smesh\r
-\r
-salome.salome_init()\r
-aStudyId = salome.myStudy._get_StudyId()\r
-\r
-geompy.init_geom(salome.myStudy)\r
-global Face_1\r
-Face_1 = geompy.MakeFaceHW(100, 100, 1)\r
-geompy.addToStudy( Face_1, "Face_1" )\r
-\r
-#smesh.smesh.SetCurrentStudy(aStudyId)\r
-import StdMeshers\r
-pattern = smesh.GetPattern()\r
-Mesh_1 = smesh.Mesh(Face_1)\r
-Regular_1D = Mesh_1.Segment()\r
-Nb_Segments_1 = Regular_1D.NumberOfSegments(10)\r
-Nb_Segments_1.SetDistrType( 0 )\r
-Quadrangle_2D = Mesh_1.Quadrangle()\r
-isDone = Mesh_1.Compute()\r
-\r
-# groups creation\r
-\r
-aListOfElems = [ 52, 53, 54, 55, 56, 57,\r
-                 62, 63, 64, 65, 66, 67,\r
-                 72, 73, 74, 75, 76, 77,\r
-                 82, 83, 84, 85, 86, 87 ]\r
-                 \r
-aRedGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Red" )\r
-aRedGroup.Add( aListOfElems );\r
-aRedGroup.SetColor( SALOMEDS.Color( 1, 0, 0 ) )\r
-\r
-aListOfElems = [ 55, 56, 57, 58, 59,\r
-                 65, 66, 67, 68, 69,\r
-                 75, 76, 77, 78, 79,\r
-                 85, 86, 87, 88, 89,\r
-                 95, 96, 97, 98, 99,\r
-                 105, 106, 107, 108, 109,\r
-                 115, 116, 117, 118, 119,\r
-                 125, 126, 127, 128, 129 ]\r
-                 \r
-aGreenGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Green" )\r
-aGreenGroup.Add( aListOfElems );\r
-aGreenGroup.SetColor( SALOMEDS.Color( 0, 1, 0 ) )\r
-\r
-aListOfElems = [ 63, 64, 65, 66, 67, 68, \r
-                 73, 74, 75, 76, 77, 78,\r
-                 83, 84, 85, 86, 87, 88, \r
-                 93, 94, 95, 96, 97, 98, \r
-                 103, 104, 105, 106, 107, 108, \r
-                 113, 114, 115, 116, 117, 118 ]\r
-                 \r
-aBlueGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Blue" )\r
-aBlueGroup.Add( aListOfElems );\r
-aBlueGroup.SetColor( SALOMEDS.Color( 0, 0, 1 ) )\r
-\r
-# UnionListOfGroups()\r
-aUnGrp = Mesh_1.UnionListOfGroups([aRedGroup, aGreenGroup, aBlueGroup], "UnionGrp" )\r
-\r
-# IntersectListOfGroups()\r
-aIntGrp=Mesh_1.IntersectListOfGroups([aRedGroup, aGreenGroup, aBlueGroup], "IntGrp" )\r
-\r
-# CutListOfGroups()\r
-aCutGrp=Mesh_1.CutListOfGroups([aRedGroup],[aGreenGroup,aBlueGroup],"CutGrp")\r
-\r
-salome.sg.updateObjBrowser( 1 )\r
-\r
+#  -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+import geompy
+import math
+import SALOMEDS
+import SMESH
+import smesh
+
+salome.salome_init()
+aStudyId = salome.myStudy._get_StudyId()
+
+geompy.init_geom(salome.myStudy)
+global Face_1
+Face_1 = geompy.MakeFaceHW(100, 100, 1)
+geompy.addToStudy( Face_1, "Face_1" )
+
+#smesh.smesh.SetCurrentStudy(aStudyId)
+import StdMeshers
+pattern = smesh.GetPattern()
+Mesh_1 = smesh.Mesh(Face_1)
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh_1.Quadrangle()
+isDone = Mesh_1.Compute()
+
+# groups creation
+
+aListOfElems = [ 52, 53, 54, 55, 56, 57,
+                 62, 63, 64, 65, 66, 67,
+                 72, 73, 74, 75, 76, 77,
+                 82, 83, 84, 85, 86, 87 ]
+                 
+aRedGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Red" )
+aRedGroup.Add( aListOfElems );
+aRedGroup.SetColor( SALOMEDS.Color( 1, 0, 0 ) )
+
+aListOfElems = [ 55, 56, 57, 58, 59,
+                 65, 66, 67, 68, 69,
+                 75, 76, 77, 78, 79,
+                 85, 86, 87, 88, 89,
+                 95, 96, 97, 98, 99,
+                 105, 106, 107, 108, 109,
+                 115, 116, 117, 118, 119,
+                 125, 126, 127, 128, 129 ]
+                 
+aGreenGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Green" )
+aGreenGroup.Add( aListOfElems );
+aGreenGroup.SetColor( SALOMEDS.Color( 0, 1, 0 ) )
+
+aListOfElems = [ 63, 64, 65, 66, 67, 68, 
+                 73, 74, 75, 76, 77, 78,
+                 83, 84, 85, 86, 87, 88, 
+                 93, 94, 95, 96, 97, 98, 
+                 103, 104, 105, 106, 107, 108, 
+                 113, 114, 115, 116, 117, 118 ]
+                 
+aBlueGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Blue" )
+aBlueGroup.Add( aListOfElems );
+aBlueGroup.SetColor( SALOMEDS.Color( 0, 0, 1 ) )
+
+# UnionListOfGroups()
+aUnGrp = Mesh_1.UnionListOfGroups([aRedGroup, aGreenGroup, aBlueGroup], "UnionGrp" )
+
+# IntersectListOfGroups()
+aIntGrp=Mesh_1.IntersectListOfGroups([aRedGroup, aGreenGroup, aBlueGroup], "IntGrp" )
+
+# CutListOfGroups()
+aCutGrp=Mesh_1.CutListOfGroups([aRedGroup],[aGreenGroup,aBlueGroup],"CutGrp")
+
+salome.sg.updateObjBrowser( 1 )
+
index c73dc872dfcbe03c37035b99c1130afd68cbeaec..61a0350225bdeaf088d53e8ed66c8c071e3ed309 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 # CEA/LGLS 2008, Christian Van Wambeke (CEA/LGLS), Francis KLOSS (OCC)
 # ====================================================================
 
index 13cd9cf2625460a556a15b3fa05698273802454e..7f4600d3ff3e1bf52ebb33c4f878dcc1cd7e1657 100755 (executable)
@@ -1,47 +1,49 @@
-import sys\r
-import salome\r
-import geompy\r
-import math\r
-import SALOMEDS\r
-import SMESH\r
-import smesh\r
-\r
-salome.salome_init()\r
-aStudyId = salome.myStudy._get_StudyId()\r
-\r
-geompy.init_geom(salome.myStudy)\r
-\r
-geompy.init_geom(salome.myStudy)\r
-global Box_1\r
-Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)\r
-geompy.addToStudy( Box_1, "Box_1" )\r
-\r
-#smesh.smesh.SetCurrentStudy(theStudy)\r
-import StdMeshers\r
-Mesh_1 = smesh.Mesh(Box_1)\r
-Regular_1D = Mesh_1.Segment()\r
-Nb_Segments_1 = Regular_1D.NumberOfSegments(10)\r
-Nb_Segments_1.SetDistrType( 0 )\r
-Quadrangle_2D = Mesh_1.Quadrangle()\r
-Hexa_3D = Mesh_1.Hexahedron()\r
-isDone = Mesh_1.Compute()\r
-\r
-### CreateDimGroup()\r
-\r
-aListOf3d_1=range(721,821)\r
-\r
-aGrp3D_1=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 1" )\r
-aGrp3D_1.Add( aListOf3d_1 )\r
-\r
-aListOf3d_2=range(821, 921)\r
-aGrp3D_2=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 2" )\r
-aGrp3D_2.Add( aListOf3d_2 )\r
-\r
-aGrp2D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.FACE, "Faces" )\r
-\r
-aGrp1D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.EDGE, "Edges" )\r
-\r
-aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.NODE, "Nodes" )\r
-\r
-salome.sg.updateObjBrowser( 1 )\r
-\r
+#  -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+import geompy
+import math
+import SALOMEDS
+import SMESH
+import smesh
+
+salome.salome_init()
+aStudyId = salome.myStudy._get_StudyId()
+
+geompy.init_geom(salome.myStudy)
+
+geompy.init_geom(salome.myStudy)
+global Box_1
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+geompy.addToStudy( Box_1, "Box_1" )
+
+#smesh.smesh.SetCurrentStudy(theStudy)
+import StdMeshers
+Mesh_1 = smesh.Mesh(Box_1)
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh_1.Quadrangle()
+Hexa_3D = Mesh_1.Hexahedron()
+isDone = Mesh_1.Compute()
+
+### CreateDimGroup()
+
+aListOf3d_1=range(721,821)
+
+aGrp3D_1=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 1" )
+aGrp3D_1.Add( aListOf3d_1 )
+
+aListOf3d_2=range(821, 921)
+aGrp3D_2=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 2" )
+aGrp3D_2.Add( aListOf3d_2 )
+
+aGrp2D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.FACE, "Faces" )
+
+aGrp1D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.EDGE, "Edges" )
+
+aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.NODE, "Nodes" )
+
+salome.sg.updateObjBrowser( 1 )
+
index dc22bc389d3ca1b078d48737e865a738ad4735e3..217439fa5940383888860fdf85f2106590428be4 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
index 689e76f492afc3fcc99ecfdf89793fb750673ccf..4789415c96b2ac875e48a97c99d1d6f60d907771 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
@@ -107,6 +108,38 @@ except ImportError:
     noNETGENPlugin = 1
     pass
 
+# import GHS3DPlugin module if possible
+noGHS3DPlugin = 0
+try:
+    import GHS3DPlugin
+except ImportError:
+    noGHS3DPlugin = 1
+    pass
+
+# import GHS3DPRLPlugin module if possible
+noGHS3DPRLPlugin = 0
+try:
+    import GHS3DPRLPlugin
+except ImportError:
+    noGHS3DPRLPlugin = 1
+    pass
+
+# import HexoticPlugin module if possible
+noHexoticPlugin = 0
+try:
+    import HexoticPlugin
+except ImportError:
+    noHexoticPlugin = 1
+    pass
+
+# import BLSURFPlugin module if possible
+noBLSURFPlugin = 0
+try:
+    import BLSURFPlugin
+except ImportError:
+    noBLSURFPlugin = 1
+    pass
+
 ## @addtogroup l1_auxiliary
 ## @{
 
@@ -148,7 +181,10 @@ VeryFine   = 4
 Custom     = 5
 
 # Optimization level of GHS3D
+# V3.1
 None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization = 0,1,2,3
+# V4.1 (partialy redefines V3.1). Issue 0020574
+None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4
 
 # Topology treatment way of BLSURF
 FromCAD, PreProcess, PreProcessPlus = 0,1,2
@@ -402,6 +438,25 @@ def TreatHypoStatus(status, hypName, geomName, isAlgo):
         print hypName, "was not assigned to",geomName,":", reason
         pass
 
+## Check meshing plugin availability
+def CheckPlugin(plugin):
+    if plugin == NETGEN and noNETGENPlugin:
+        print "Warning: NETGENPlugin module unavailable"
+        return False
+    elif plugin == GHS3D and noGHS3DPlugin:
+        print "Warning: GHS3DPlugin module unavailable"
+        return False
+    elif plugin == GHS3DPRL and noGHS3DPRLPlugin:
+        print "Warning: GHS3DPRLPlugin module unavailable"
+        return False
+    elif plugin == Hexotic and noHexoticPlugin:
+        print "Warning: HexoticPlugin module unavailable"
+        return False
+    elif plugin == BLSURF and noBLSURFPlugin:
+        print "Warning: BLSURFPlugin module unavailable"
+        return False
+    return True
+    
 # end of l1_auxiliary
 ## @}
 
@@ -420,7 +475,9 @@ class smeshDC(SMESH._objref_SMESH_Gen):
     #  @return an instance of Mesh class.
     #  @ingroup l2_construct
     def Mesh(self, obj=0, name=0):
-      return Mesh(self,self.geompyD,obj,name)
+        if isinstance(obj,str):
+            obj,name = name,obj
+        return Mesh(self,self.geompyD,obj,name)
 
     ## Returns a long value from enumeration
     #  Should be used for SMESH.FunctorType enumeration
@@ -753,12 +810,26 @@ class smeshDC(SMESH._objref_SMESH_Gen):
             print "Error: given parameter is not numerucal functor type."
 
     ## Creates hypothesis
-    #  @param 
-    #  @param 
+    #  @param theHType mesh hypothesis type (string)
+    #  @param theLibName mesh plug-in library name
     #  @return created hypothesis instance
     def CreateHypothesis(self, theHType, theLibName="libStdMeshersEngine.so"):
         return SMESH._objref_SMESH_Gen.CreateHypothesis(self, theHType, theLibName )
 
+    ## Gets the mesh stattistic
+    #  @return dictionary type element - count of elements
+    #  @ingroup l1_meshinfo
+    def GetMeshInfo(self, obj):
+        if isinstance( obj, Mesh ):
+            obj = obj.GetMesh()
+        d = {}
+        if hasattr(obj, "_narrow") and obj._narrow(SMESH.SMESH_IDSource):
+            values = obj.GetMeshInfo() 
+            for i in range(SMESH.Entity_Last._v):
+                if i < len(values): d[SMESH.EntityType._item(i)]=values[i]
+            pass
+        return d
+
 import omniORB
 #Registering the new proxy for SMESH_Gen
 omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshDC)
@@ -1249,6 +1320,8 @@ class Mesh:
     #  Exports the mesh in a file in MED format and chooses the \a version of MED format
     #  @param f the file name
     #  @param version values are SMESH.MED_V2_1, SMESH.MED_V2_2
+    #  @param opt boolean parameter for creating/not creating
+    #  the groups Group_On_All_Nodes, Group_On_All_Faces, ...
     #  @ingroup l2_impexp
     def ExportToMED(self, f, version, opt=0):
         self.mesh.ExportToMED(f, opt, version)
@@ -1320,19 +1393,37 @@ class Mesh:
             elif tgeo == "SHELL":
                 typ = VOLUME
             elif tgeo == "COMPOUND":
-                if len( self.geompyD.GetObjectIDs( grp )) == 0:
-                    print "Mesh.Group: empty geometric group", GetName( grp )
-                    return 0
-                tgeo = self.geompyD.GetType(grp)
-                if tgeo == geompyDC.ShapeType["VERTEX"]:
-                    typ = NODE
-                elif tgeo == geompyDC.ShapeType["EDGE"]:
-                    typ = EDGE
-                elif tgeo == geompyDC.ShapeType["FACE"]:
-                    typ = FACE
-                elif tgeo == geompyDC.ShapeType["SOLID"]:
-                    typ = VOLUME
-
+                try: # it raises on a compound of compounds
+                    if len( self.geompyD.GetObjectIDs( grp )) == 0:
+                        print "Mesh.Group: empty geometric group", GetName( grp )
+                        return 0
+                    pass
+                except:
+                    pass
+                if grp.GetType() == 37: # GEOMImpl_Types.hxx: #define GEOM_GROUP 37
+                    # group
+                    tgeo = self.geompyD.GetType(grp)
+                    if tgeo == geompyDC.ShapeType["VERTEX"]:
+                        typ = NODE
+                    elif tgeo == geompyDC.ShapeType["EDGE"]:
+                        typ = EDGE
+                    elif tgeo == geompyDC.ShapeType["FACE"]:
+                        typ = FACE
+                    elif tgeo == geompyDC.ShapeType["SOLID"]:
+                        typ = VOLUME
+                        pass
+                    pass
+                else:
+                    # just a compound
+                    for elemType, shapeType in [[VOLUME,"SOLID"],[FACE,"FACE"],
+                                                [EDGE,"EDGE"],[NODE,"VERTEX"]]:
+                        if self.geompyD.SubShapeAll(grp,geompyDC.ShapeType[shapeType]):
+                            typ = elemType
+                            break
+                        pass
+                    pass
+                pass
+            pass
         if typ == None:
             print "Mesh.Group: bad first argument: expected a group, a vertex, an edge, a face or a solid"
             return 0
@@ -1593,13 +1684,7 @@ class Mesh:
     #  @ingroup l1_meshinfo
     def GetMeshInfo(self, obj = None):
         if not obj: obj = self.mesh
-        d = {}
-        if hasattr(obj, "_narrow") and obj._narrow(SMESH.SMESH_IDSource):
-            values = obj.GetMeshInfo() 
-            for i in range(SMESH.Entity_Last._v):
-                if i < len(values): d[SMESH.EntityType._item(i)]=values[i]
-            pass
-        return d
+        return self.smeshpyD.GetMeshInfo(obj)
 
     ## Returns the number of nodes in the mesh
     #  @return an integer value
@@ -2125,6 +2210,8 @@ class Mesh:
     #  @param x  the X coordinate of a point
     #  @param y  the Y coordinate of a point
     #  @param z  the Z coordinate of a point
+    #  @param NodeID if specified (>0), the node with this ID is moved,
+    #  otherwise, the node closest to point (@a x,@a y,@a z) is moved
     #  @return the ID of a node
     #  @ingroup l2_modif_throughp
     def MoveClosestNodeToPoint(self, x, y, z, NodeID):
@@ -2139,8 +2226,21 @@ class Mesh:
     #  @return the ID of a node
     #  @ingroup l2_modif_throughp
     def FindNodeClosestTo(self, x, y, z):
-        preview = self.mesh.GetMeshEditPreviewer()
-        return preview.MoveClosestNodeToPoint(x, y, z, -1)
+        #preview = self.mesh.GetMeshEditPreviewer()
+        #return preview.MoveClosestNodeToPoint(x, y, z, -1)
+        return self.editor.FindNodeClosestTo(x, y, z)
+
+    ## Finds the elements where a point lays IN or ON
+    #  @param x  the X coordinate of a point
+    #  @param y  the Y coordinate of a point
+    #  @param z  the Z coordinate of a point
+    #  @param elementType type of elements to find (SMESH.ALL type
+    #         means elements of any type excluding nodes and 0D elements)
+    #  @return list of IDs of found elements
+    #  @ingroup l2_modif_throughp
+    def FindElementsByPoint(self, x, y, z, elementType = SMESH.ALL):
+        return self.editor.FindElementsByPoint(x, y, z, elementType)
+        
 
     ## Finds the node closest to a point and moves it to a point location
     #  @param x  the X coordinate of a point
@@ -2497,6 +2597,12 @@ class Mesh:
     def ConvertFromQuadratic(self):
         return self.editor.ConvertFromQuadratic()
 
+    ## Creates 2D mesh as skin on boundary faces of a 3D mesh
+    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @ingroup l2_modif_edit
+    def  Make2DMeshFrom3D(self):
+        return self.editor. Make2DMeshFrom3D()
+        
     ## Renumber mesh nodes
     #  @ingroup l2_modif_renumber
     def RenumberNodes(self):
@@ -2792,7 +2898,7 @@ class Mesh:
                                                    HasRefPoint, RefPoint, MakeGroups, ElemType)
         else:
             if isinstance(Base,Mesh):
-                return self.editor.ExtrusionAlongPathObjX(Base.GetMesh(), Path, NodeStart,
+                return self.editor.ExtrusionAlongPathObjX(Base, Path, NodeStart,
                                                           HasAngles, Angles, LinearVariation,
                                                           HasRefPoint, RefPoint, MakeGroups, ElemType)
             else:
@@ -3253,6 +3359,8 @@ class Mesh:
     #  @return a list of groups of equal elements
     #  @ingroup l2_modif_trsf
     def FindEqualElements (self, MeshOrSubMeshOrGroup):
+        if ( isinstance( MeshOrSubMeshOrGroup, Mesh )):
+            MeshOrSubMeshOrGroup = MeshOrSubMeshOrGroup.GetMesh()
         return self.editor.FindEqualElements(MeshOrSubMeshOrGroup)
 
     ## Merges elements in each given group.
@@ -3330,6 +3438,43 @@ class Mesh:
     #  @ingroup l1_auxiliary
     def GetLastCreatedElems(self):
         return self.editor.GetLastCreatedElems()
+
+     ## Creates a hole in a mesh by doubling the nodes of some particular elements
+    #  @param theNodes identifiers of nodes to be doubled
+    #  @param theModifiedElems identifiers of elements to be updated by the new (doubled) 
+    #         nodes. If list of element identifiers is empty then nodes are doubled but 
+    #         they not assigned to elements
+    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @ingroup l2_modif_edit
+    def DoubleNodes(self, theNodes, theModifiedElems):
+        return self.editor.DoubleNodes(theNodes, theModifiedElems)
+        
+    ## Creates a hole in a mesh by doubling the nodes of some particular elements
+    #  This method provided for convenience works as DoubleNodes() described above.
+    #  @param theNodes identifiers of node to be doubled
+    #  @param theModifiedElems identifiers of elements to be updated
+    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @ingroup l2_modif_edit
+    def DoubleNode(self, theNodeId, theModifiedElems):
+        return self.editor.DoubleNode(theNodeId, theModifiedElems)
+        
+    ## Creates a hole in a mesh by doubling the nodes of some particular elements
+    #  This method provided for convenience works as DoubleNodes() described above.
+    #  @param theNodes group of nodes to be doubled
+    #  @param theModifiedElems group of elements to be updated.
+    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @ingroup l2_modif_edit
+    def DoubleNodeGroup(self, theNodes, theModifiedElems):
+        return self.editor.DoubleNodeGroup(theNodes, theModifiedElems)
+        
+    ## Creates a hole in a mesh by doubling the nodes of some particular elements
+    #  This method provided for convenience works as DoubleNodes() described above.
+    #  @param theNodes list of groups of nodes to be doubled
+    #  @param theModifiedElems list of groups of elements to be updated.
+    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @ingroup l2_modif_edit
+    def DoubleNodeGroups(self, theNodes, theModifiedElems):
+        return self.editor.DoubleNodeGroups(theNodes, theModifiedElems)
     
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  @param theElems - the list of elements (edges or faces) to be replicated
@@ -3339,8 +3484,8 @@ class Mesh:
     #         replicated nodes should be associated to.
     #  @return TRUE if operation has been completed successfully, FALSE otherwise
     #  @ingroup l2_modif_edit
-    def DoubleNodes(self, theElems, theNodesNot, theAffectedElems):
-        return self.editor.DoubleNodes(theElems, theNodesNot, theAffectedElems)
+    def DoubleNodeElem(self, theElems, theNodesNot, theAffectedElems):
+        return self.editor.DoubleNodeElem(theElems, theNodesNot, theAffectedElems)
         
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  @param theElems - the list of elements (edges or faces) to be replicated
@@ -3351,8 +3496,8 @@ class Mesh:
     #         The replicated nodes should be associated to affected elements.
     #  @return TRUE if operation has been completed successfully, FALSE otherwise
     #  @ingroup l2_modif_edit
-    def DoubleNodesInRegion(self, theElems, theNodesNot, theShape):
-        return self.editor.DoubleNodesInRegion(theElems, theNodesNot, theShape)
+    def DoubleNodeElemInRegion(self, theElems, theNodesNot, theShape):
+        return self.editor.DoubleNodeElemInRegion(theElems, theNodesNot, theShape)
     
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  This method provided for convenience works as DoubleNodes() described above.
@@ -3361,8 +3506,8 @@ class Mesh:
     #  @param theAffectedElems - group of elements to which the replicated nodes
     #         should be associated to.
     #  @ingroup l2_modif_edit
-    def DoubleNodeGroup(self, theElems, theNodesNot, theAffectedElems):
-        return self.editor.DoubleNodeGroup(theElems, theNodesNot, theAffectedElems)
+    def DoubleNodeElemGroup(self, theElems, theNodesNot, theAffectedElems):
+        return self.editor.DoubleNodeElemGroup(theElems, theNodesNot, theAffectedElems)
         
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  This method provided for convenience works as DoubleNodes() described above.
@@ -3372,8 +3517,8 @@ class Mesh:
     #         located on or inside shape).
     #         The replicated nodes should be associated to affected elements.
     #  @ingroup l2_modif_edit
-    def DoubleNodeGroupInRegion(self, theElems, theNodesNot, theShape):
-        return self.editor.DoubleNodeGroup(theElems, theNodesNot, theShape)
+    def DoubleNodeElemGroupInRegion(self, theElems, theNodesNot, theShape):
+        return self.editor.DoubleNodeElemGroup(theElems, theNodesNot, theShape)
         
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  This method provided for convenience works as DoubleNodes() described above.
@@ -3383,8 +3528,8 @@ class Mesh:
     #         should be associated to.
     #  @return TRUE if operation has been completed successfully, FALSE otherwise
     #  @ingroup l2_modif_edit
-    def DoubleNodeGroups(self, theElems, theNodesNot, theAffectedElems):
-        return self.editor.DoubleNodeGroups(theElems, theNodesNot, theAffectedElems)
+    def DoubleNodeElemGroups(self, theElems, theNodesNot, theAffectedElems):
+        return self.editor.DoubleNodeElemGroups(theElems, theNodesNot, theAffectedElems)
 
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  This method provided for convenience works as DoubleNodes() described above.
@@ -3395,8 +3540,8 @@ class Mesh:
     #         The replicated nodes should be associated to affected elements.
     #  @return TRUE if operation has been completed successfully, FALSE otherwise
     #  @ingroup l2_modif_edit
-    def DoubleNodeGroupsInRegion(self, theElems, theNodesNot, theShape):
-        return self.editor.DoubleNodeGroupsInRegion(theElems, theNodesNot, theShape)
+    def DoubleNodeElemGroupsInRegion(self, theElems, theNodesNot, theShape):
+        return self.editor.DoubleNodeElemGroupsInRegion(theElems, theNodesNot, theShape)
 
 ## The mother class to define algorithm, it is not recommended to use it directly.
 #
@@ -3974,19 +4119,15 @@ class Mesh_Triangle(Mesh_Algorithm):
             self.Create(mesh, geom, "MEFISTO_2D")
             pass
         elif algoType == BLSURF:
-            import BLSURFPlugin
+            CheckPlugin(BLSURF)
             self.Create(mesh, geom, "BLSURF", "libBLSURFEngine.so")
             #self.SetPhysicalMesh() - PAL19680
         elif algoType == NETGEN:
-            if noNETGENPlugin:
-                print "Warning: NETGENPlugin module unavailable"
-                pass
+            CheckPlugin(NETGEN)
             self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
             pass
         elif algoType == NETGEN_2D:
-            if noNETGENPlugin:
-                print "Warning: NETGENPlugin module unavailable"
-                pass
+            CheckPlugin(NETGEN)
             self.Create(mesh, geom, "NETGEN_2D_ONLY", "libNETGENEngine.so")
             pass
 
@@ -4035,6 +4176,7 @@ class Mesh_Triangle(Mesh_Algorithm):
     #  @ingroup l3_hypos_blsurf
     def SetPhySize(self, theVal):
         # Parameter of BLSURF algo
+        self.SetPhysicalMesh(1) #Custom - else why to set the size?
         self.Parameters().SetPhySize(theVal)
 
     ## Sets lower boundary of mesh element size (PhySize).
@@ -4289,22 +4431,22 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
         Mesh_Algorithm.__init__(self)
 
         if algoType == NETGEN:
+            CheckPlugin(NETGEN)
             self.Create(mesh, geom, "NETGEN_3D", "libNETGENEngine.so")
             pass
 
         elif algoType == FULL_NETGEN:
-            if noNETGENPlugin:
-                print "Warning: NETGENPlugin module has not been imported."
+            CheckPlugin(NETGEN)
             self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
             pass
 
         elif algoType == GHS3D:
-            import GHS3DPlugin
+            CheckPlugin(GHS3D)
             self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so")
             pass
 
         elif algoType == GHS3DPRL:
-            import GHS3DPRLPlugin
+            CheckPlugin(GHS3DPRL)
             self.Create(mesh, geom, "GHS3DPRL_3D" , "libGHS3DPRLEngine.so")
             pass
 
@@ -4442,8 +4584,9 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
         self.Parameters().SetToMeshHoles(toMesh)
 
     ## Set Optimization level:
-    #   None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization.
-    #  Default is Medium_Optimization
+    #   None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization,
+    #   Strong_Optimization.
+    # Default is Standard_Optimization
     #  @ingroup l3_hypos_ghs3dh
     def SetOptimizationLevel(self, level):
         #  Parameter of GHS3D
@@ -4540,7 +4683,7 @@ class Mesh_Hexahedron(Mesh_Algorithm):
             pass
 
         elif algoType == Hexotic:
-            import HexoticPlugin
+            CheckPlugin(Hexotic)
             self.Create(mesh, geom, "Hexotic_3D", "libHexoticEngine.so")
             pass
 
@@ -4573,8 +4716,7 @@ class Mesh_Netgen(Mesh_Algorithm):
     def __init__(self, mesh, is3D, geom=0):
         Mesh_Algorithm.__init__(self)
 
-        if noNETGENPlugin:
-            print "Warning: NETGENPlugin module has not been imported."
+        CheckPlugin(NETGEN)
 
         self.is3D = is3D
         if is3D:
@@ -5093,7 +5235,7 @@ omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementArea._NP_Reposito
 class MaxElementVolume(StdMeshers._objref_StdMeshers_MaxElementVolume):
     
     ## Set Max Element Volume parameter value
-    #  @param area  numerical value or name of variable from notebook
+    #  @param volume numerical value or name of variable from notebook
     def SetMaxElementVolume(self, volume):
         volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetLastParameters(self),1,1,volume)
         StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters)
@@ -5137,110 +5279,112 @@ class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments):
 #Registering the new proxy for NumberOfSegments
 omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfSegments._NP_RepositoryId, NumberOfSegments)
 
+if not noNETGENPlugin:
+    #Wrapper class for NETGENPlugin_Hypothesis hypothesis
+    class NETGENPlugin_Hypothesis(NETGENPlugin._objref_NETGENPlugin_Hypothesis):
+
+        ## Set Max Size parameter value
+        #  @param maxsize numerical value or name of variable from notebook
+        def SetMaxSize(self, maxsize):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+            maxsize, parameters = ParseParameters(lastParameters,4,1,maxsize)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetMaxSize(self,maxsize)
+
+        ## Set Growth Rate parameter value
+        #  @param value  numerical value or name of variable from notebook
+        def SetGrowthRate(self, value):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+            value, parameters = ParseParameters(lastParameters,4,2,value)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetGrowthRate(self,value)
+
+        ## Set Number of Segments per Edge parameter value
+        #  @param value  numerical value or name of variable from notebook
+        def SetNbSegPerEdge(self, value):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+            value, parameters = ParseParameters(lastParameters,4,3,value)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerEdge(self,value)
+
+        ## Set Number of Segments per Radius parameter value
+        #  @param value  numerical value or name of variable from notebook
+        def SetNbSegPerRadius(self, value):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+            value, parameters = ParseParameters(lastParameters,4,4,value)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerRadius(self,value)
+
+    #Registering the new proxy for NETGENPlugin_Hypothesis
+    omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis._NP_RepositoryId, NETGENPlugin_Hypothesis)
+
+
+    #Wrapper class for NETGENPlugin_Hypothesis_2D hypothesis
+    class NETGENPlugin_Hypothesis_2D(NETGENPlugin_Hypothesis,NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D):
+        pass
 
-#Wrapper class for NETGENPlugin_Hypothesis hypothesis
-class NETGENPlugin_Hypothesis(NETGENPlugin._objref_NETGENPlugin_Hypothesis):
-
-    ## Set Max Size parameter value
-    #  @param maxsize numerical value or name of variable from notebook
-    def SetMaxSize(self, maxsize):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
-        maxsize, parameters = ParseParameters(lastParameters,4,1,maxsize)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetMaxSize(self,maxsize)
-        
-    ## Set Growth Rate parameter value
-    #  @param value  numerical value or name of variable from notebook
-    def SetGrowthRate(self, value):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
-        value, parameters = ParseParameters(lastParameters,4,2,value)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetGrowthRate(self,value)
-        
-    ## Set Number of Segments per Edge parameter value
-    #  @param value  numerical value or name of variable from notebook
-    def SetNbSegPerEdge(self, value):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
-        value, parameters = ParseParameters(lastParameters,4,3,value)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerEdge(self,value)
-        
-    ## Set Number of Segments per Radius parameter value
-    #  @param value  numerical value or name of variable from notebook
-    def SetNbSegPerRadius(self, value):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
-        value, parameters = ParseParameters(lastParameters,4,4,value)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerRadius(self,value)
-        
-#Registering the new proxy for NETGENPlugin_Hypothesis
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis._NP_RepositoryId, NETGENPlugin_Hypothesis)
-
-
-#Wrapper class for NETGENPlugin_Hypothesis_2D hypothesis
-class NETGENPlugin_Hypothesis_2D(NETGENPlugin_Hypothesis,NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D):
-    pass
-
-#Registering the new proxy for NETGENPlugin_Hypothesis_2D
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D._NP_RepositoryId, NETGENPlugin_Hypothesis_2D)
-
-#Wrapper class for NETGENPlugin_SimpleHypothesis_2D hypothesis
-class NETGEN_SimpleParameters_2D(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D):
-    
-    ## Set Number of Segments parameter value
-    #  @param nbSeg numerical value or name of variable from notebook
-    def SetNumberOfSegments(self, nbSeg):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
-        nbSeg, parameters = ParseParameters(lastParameters,2,1,nbSeg)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetNumberOfSegments(self, nbSeg)
-
-    ## Set Local Length parameter value
-    #  @param length numerical value or name of variable from notebook
-    def SetLocalLength(self, length):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
-        length, parameters = ParseParameters(lastParameters,2,1,length)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length)
-
-    ## Set Max Element Area parameter value
-    #  @param area numerical value or name of variable from notebook    
-    def SetMaxElementArea(self, area):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
-        area, parameters = ParseParameters(lastParameters,2,2,area)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetMaxElementArea(self, area)
-
-    def LengthFromEdges(self):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
-        value = 0;
-        value, parameters = ParseParameters(lastParameters,2,2,value)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.LengthFromEdges(self)
-        
-#Registering the new proxy for NETGEN_SimpleParameters_2D
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D._NP_RepositoryId, NETGEN_SimpleParameters_2D)
-
-
-#Wrapper class for NETGENPlugin_SimpleHypothesis_3D hypothesis
-class NETGEN_SimpleParameters_3D(NETGEN_SimpleParameters_2D,NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D):
-    ## Set Max Element Volume parameter value
-    #  @param volume numerical value or name of variable from notebook    
-    def SetMaxElementVolume(self, volume):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
-        volume, parameters = ParseParameters(lastParameters,3,3,volume)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetMaxElementVolume(self, volume)
-
-    def LengthFromFaces(self):
-        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
-        value = 0;
-        value, parameters = ParseParameters(lastParameters,3,3,value)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
-        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.LengthFromFaces(self)
-        
-#Registering the new proxy for NETGEN_SimpleParameters_3D
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D._NP_RepositoryId, NETGEN_SimpleParameters_3D)
+    #Registering the new proxy for NETGENPlugin_Hypothesis_2D
+    omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D._NP_RepositoryId, NETGENPlugin_Hypothesis_2D)
+
+    #Wrapper class for NETGENPlugin_SimpleHypothesis_2D hypothesis
+    class NETGEN_SimpleParameters_2D(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D):
+
+        ## Set Number of Segments parameter value
+        #  @param nbSeg numerical value or name of variable from notebook
+        def SetNumberOfSegments(self, nbSeg):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+            nbSeg, parameters = ParseParameters(lastParameters,2,1,nbSeg)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetNumberOfSegments(self, nbSeg)
+
+        ## Set Local Length parameter value
+        #  @param length numerical value or name of variable from notebook
+        def SetLocalLength(self, length):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+            length, parameters = ParseParameters(lastParameters,2,1,length)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length)
+
+        ## Set Max Element Area parameter value
+        #  @param area numerical value or name of variable from notebook    
+        def SetMaxElementArea(self, area):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+            area, parameters = ParseParameters(lastParameters,2,2,area)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetMaxElementArea(self, area)
+
+        def LengthFromEdges(self):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+            value = 0;
+            value, parameters = ParseParameters(lastParameters,2,2,value)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.LengthFromEdges(self)
+
+    #Registering the new proxy for NETGEN_SimpleParameters_2D
+    omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D._NP_RepositoryId, NETGEN_SimpleParameters_2D)
+
+
+    #Wrapper class for NETGENPlugin_SimpleHypothesis_3D hypothesis
+    class NETGEN_SimpleParameters_3D(NETGEN_SimpleParameters_2D,NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D):
+        ## Set Max Element Volume parameter value
+        #  @param volume numerical value or name of variable from notebook    
+        def SetMaxElementVolume(self, volume):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
+            volume, parameters = ParseParameters(lastParameters,3,3,volume)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetMaxElementVolume(self, volume)
+
+        def LengthFromFaces(self):
+            lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
+            value = 0;
+            value, parameters = ParseParameters(lastParameters,3,3,value)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+            NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.LengthFromFaces(self)
+
+    #Registering the new proxy for NETGEN_SimpleParameters_3D
+    omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D._NP_RepositoryId, NETGEN_SimpleParameters_3D)
+
+    pass # if not noNETGENPlugin:
 
 class Pattern(SMESH._objref_SMESH_Pattern):
 
index d04f77c55e6dc301943432a79bf067d54936a376..38bbdeaf32d77c9c4f9ae00f3efa4ffcc4ae8698 100644 (file)
@@ -252,7 +252,7 @@ StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, int studyId,
   :SMESH_3D_Algo(hypId, studyId, gen)
 {
   _name = "CompositeHexa_3D";
-  _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);      // 1 bit /shape type
+  _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
 }
 
 //================================================================================
@@ -514,7 +514,7 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh&         theMesh,
 //purpose  : auxilary for Evaluate
 //=======================================================================
 int GetNb2d(_QuadFaceGrid* QFG, SMESH_Mesh& theMesh,
-           MapShapeNbElems& aResMap)
+            MapShapeNbElems& aResMap)
 {
   int nb2d = 0;
   _QuadFaceGrid::TChildIterator aCI = QFG->GetChildren();
@@ -539,8 +539,8 @@ int GetNb2d(_QuadFaceGrid* QFG, SMESH_Mesh& theMesh,
 //================================================================================
 
 bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh,
-                                          const TopoDS_Shape& theShape,
-                                          MapShapeNbElems& aResMap)
+                                           const TopoDS_Shape& theShape,
+                                           MapShapeNbElems& aResMap)
 {
   SMESH_MesherHelper aTool(theMesh);
   bool _quadraticMesh = aTool.IsQuadraticSubMesh(theShape);
@@ -636,22 +636,22 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh,
       int nb0 = 0;
       SMESH_subMesh *sm = theMesh.GetSubMesh(exp.Current());
       if( sm ) {
-       MapShapeNbElemsItr anIt = aResMap.find(sm);
-       if( anIt == aResMap.end() ) continue;
-       std::vector<int> aVec = (*anIt).second;
-       nb0 = aVec[SMDSEntity_Node];
+        MapShapeNbElemsItr anIt = aResMap.find(sm);
+        if( anIt == aResMap.end() ) continue;
+        std::vector<int> aVec = (*anIt).second;
+        nb0 = aVec[SMDSEntity_Node];
       }
       int j = 1;
       for(; j<=BndEdges.Length(); j++) {
-       if( BndEdges.Value(j) == exp.Current() ) {
-         // internal edge => remove it
-         BndEdges.Remove(j);
-         nb0d_in += nb0;
-         break;
-       }
+        if( BndEdges.Value(j) == exp.Current() ) {
+          // internal edge => remove it
+          BndEdges.Remove(j);
+          nb0d_in += nb0;
+          break;
+        }
       }
       if( j > BndEdges.Length() ) {
-       BndEdges.Append(exp.Current());
+        BndEdges.Append(exp.Current());
       }
       //if( BndEdges.Contains(exp.Current()) ) {
       //BndEdges.Remove( exp.Current() );
index 15ebca37371656df8bc54eaad69f5a021c30cdf5..c677973be2bf2aca288bd974c04e7b18b00e2276 100644 (file)
@@ -165,8 +165,8 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
 //================================================================================
 
 StdMeshers_FaceSide::StdMeshers_FaceSide(const SMDS_MeshNode* theNode,
-                                        const gp_Pnt2d thePnt2d,
-                                        const StdMeshers_FaceSide* theSide)
+                                         const gp_Pnt2d thePnt2d,
+                                         const StdMeshers_FaceSide* theSide)
 {
   myC2d.resize(1);
   myLength = 0;
@@ -541,15 +541,7 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
         return TSideVector(0);
       }
     }
-    // find out side orientation, which is important if there are several wires (PAL19080) 
-    bool isForward = true;
-    if ( nbWires > 1 ) {
-      TopExp_Explorer e( theFace, TopAbs_EDGE );
-      while ( ! e.Current().IsSame( wireEdges.back() ))
-        e.Next();
-      isForward = ( e.Current().Orientation() == wireEdges.back().Orientation() );
-    }
-
+    const bool isForward = true;
     StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
                                                          isForward, theIgnoreMediumNodes);
     wires[ iW ] = StdMeshers_FaceSidePtr( wire );
index f340dad04362d33c56d58349a80d204338c5a236..8382a8fbd1cba8f8f4ae665e156c65fbe27c3590 100644 (file)
@@ -97,7 +97,7 @@ public:
    * \brief Wrap for vertex using data from other FaceSide
    */
   StdMeshers_FaceSide(const SMDS_MeshNode* theNode,
-                     const gp_Pnt2d thePnt2d,
+                      const gp_Pnt2d thePnt2d,
                       const StdMeshers_FaceSide* theSide);
   /*!
    * \brief Return wires of a face as StdMeshers_FaceSide's
index 1300bf9b11f6264da599946dce858a360d6ec515..42b5488ecda855a7827d137409381fd7629e361e 100644 (file)
@@ -61,10 +61,10 @@ typedef SMESH_Comment TComm;
 using namespace std;
 
 static SMESH_ComputeErrorPtr ComputePentahedralMesh(SMESH_Mesh &,
-                                                   const TopoDS_Shape &);
+                                                    const TopoDS_Shape &);
 
 static bool EvaluatePentahedralMesh(SMESH_Mesh &, const TopoDS_Shape &,
-                                   MapShapeNbElems &);
+                                    MapShapeNbElems &);
 
 //=============================================================================
 /*!
@@ -77,7 +77,7 @@ StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen * gen)
 {
   MESSAGE("StdMeshers_Hexa_3D::StdMeshers_Hexa_3D");
   _name = "Hexa_3D";
-  _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);      // 1 bit /shape type
+  _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
 }
 
 //=============================================================================
@@ -298,7 +298,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     try {
       aQuads[i] = quadAlgo->CheckAnd2Dcompute(aMesh, aFace, _quadraticMesh);
       if(!aQuads[i]) {
-       return error( quadAlgo->GetComputeError());
+        return error( quadAlgo->GetComputeError());
       }
     }
     catch(SALOME_Exception & S_ex) {
@@ -361,7 +361,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   int _indX1 = GetFaceIndex(aMesh, aShape, meshFaces,
                             aCube.V100, aCube.V101, aCube.V110, aCube.V111);
 
-  // IPAL21120:        SIGSEGV on Meshing attached Compound with Automatic Hexadralization
+  // IPAL21120: SIGSEGV on Meshing attached Compound with Automatic Hexadralization
   if ( _indY1 < 1 || _indZ0 < 1 || _indZ1 < 1 || _indX0 < 1 || _indX1 < 1 )
     return error(COMPERR_BAD_SHAPE);
 
@@ -374,8 +374,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
 
   // 1.7 - get convertion coefs from face 2D normalized to 3D normalized
 
-  Conv2DStruct cx0;                    // for face X=0
-  Conv2DStruct cx1;                    // for face X=1
+  Conv2DStruct cx0;                     // for face X=0
+  Conv2DStruct cx1;                     // for face X=1
   Conv2DStruct cy0;
   Conv2DStruct cy1;
   Conv2DStruct cz0;
@@ -414,12 +414,12 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX0]->GetSubShape());
 
     faceQuadStruct *quad = aCube.quad_X0;
-    int i = 0;                         // j = x/face , k = y/face
+    int i = 0;                          // j = x/face , k = y/face
     int nbdown = quad->side[0]->NbPoints();
     int nbright = quad->side[1]->NbPoints();
 
     SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-                       
+                        
     while(itf->more()) {
       const SMDS_MeshNode * node = itf->next();
       if(aTool.IsMedium(node))
@@ -433,8 +433,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for (int i1 = 0; i1 < nbdown; i1++)
       for (int j1 = 0; j1 < nbright; j1++) {
         int ij1 = j1 * nbdown + i1;
-        int j = cx0.ia * i1 + cx0.ib * j1 + cx0.ic;    // j = x/face
-        int k = cx0.ja * i1 + cx0.jb * j1 + cx0.jc;    // k = y/face
+        int j = cx0.ia * i1 + cx0.ib * j1 + cx0.ic;     // j = x/face
+        int k = cx0.ja * i1 + cx0.jb * j1 + cx0.jc;     // k = y/face
         int ijk = k * nbx * nby + j * nbx + i;
         //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
         np[ijk].node = quad->uv_grid[ij1].node;
@@ -448,7 +448,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
 
     faceQuadStruct *quad = aCube.quad_X1;
-    int i = nbx - 1;           // j = x/face , k = y/face
+    int i = nbx - 1;            // j = x/face , k = y/face
     int nbdown = quad->side[0]->NbPoints();
     int nbright = quad->side[1]->NbPoints();
 
@@ -465,8 +465,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for (int i1 = 0; i1 < nbdown; i1++)
       for (int j1 = 0; j1 < nbright; j1++) {
         int ij1 = j1 * nbdown + i1;
-        int j = cx1.ia * i1 + cx1.ib * j1 + cx1.ic;    // j = x/face
-        int k = cx1.ja * i1 + cx1.jb * j1 + cx1.jc;    // k = y/face
+        int j = cx1.ia * i1 + cx1.ib * j1 + cx1.ic;     // j = x/face
+        int k = cx1.ja * i1 + cx1.jb * j1 + cx1.jc;     // k = y/face
         int ijk = k * nbx * nby + j * nbx + i;
         //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
         np[ijk].node = quad->uv_grid[ij1].node;
@@ -480,7 +480,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
 
     faceQuadStruct *quad = aCube.quad_Y0;
-    int j = 0;                         // i = x/face , k = y/face
+    int j = 0;                          // i = x/face , k = y/face
     int nbdown = quad->side[0]->NbPoints();
     int nbright = quad->side[1]->NbPoints();
 
@@ -497,8 +497,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for (int i1 = 0; i1 < nbdown; i1++)
       for (int j1 = 0; j1 < nbright; j1++) {
         int ij1 = j1 * nbdown + i1;
-        int i = cy0.ia * i1 + cy0.ib * j1 + cy0.ic;    // i = x/face
-        int k = cy0.ja * i1 + cy0.jb * j1 + cy0.jc;    // k = y/face
+        int i = cy0.ia * i1 + cy0.ib * j1 + cy0.ic;     // i = x/face
+        int k = cy0.ja * i1 + cy0.jb * j1 + cy0.jc;     // k = y/face
         int ijk = k * nbx * nby + j * nbx + i;
         //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
         np[ijk].node = quad->uv_grid[ij1].node;
@@ -512,7 +512,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
 
     faceQuadStruct *quad = aCube.quad_Y1;
-    int j = nby - 1;           // i = x/face , k = y/face
+    int j = nby - 1;            // i = x/face , k = y/face
     int nbdown = quad->side[0]->NbPoints();
     int nbright = quad->side[1]->NbPoints();
 
@@ -529,8 +529,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for (int i1 = 0; i1 < nbdown; i1++)
       for (int j1 = 0; j1 < nbright; j1++) {
         int ij1 = j1 * nbdown + i1;
-        int i = cy1.ia * i1 + cy1.ib * j1 + cy1.ic;    // i = x/face
-        int k = cy1.ja * i1 + cy1.jb * j1 + cy1.jc;    // k = y/face
+        int i = cy1.ia * i1 + cy1.ib * j1 + cy1.ic;     // i = x/face
+        int k = cy1.ja * i1 + cy1.jb * j1 + cy1.jc;     // k = y/face
         int ijk = k * nbx * nby + j * nbx + i;
         //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
         np[ijk].node = quad->uv_grid[ij1].node;
@@ -544,7 +544,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
 
     faceQuadStruct *quad = aCube.quad_Z0;
-    int k = 0;                         // i = x/face , j = y/face
+    int k = 0;                          // i = x/face , j = y/face
     int nbdown = quad->side[0]->NbPoints();
     int nbright = quad->side[1]->NbPoints();
 
@@ -561,8 +561,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for (int i1 = 0; i1 < nbdown; i1++)
       for (int j1 = 0; j1 < nbright; j1++) {
         int ij1 = j1 * nbdown + i1;
-        int i = cz0.ia * i1 + cz0.ib * j1 + cz0.ic;    // i = x/face
-        int j = cz0.ja * i1 + cz0.jb * j1 + cz0.jc;    // j = y/face
+        int i = cz0.ia * i1 + cz0.ib * j1 + cz0.ic;     // i = x/face
+        int j = cz0.ja * i1 + cz0.jb * j1 + cz0.jc;     // j = y/face
         int ijk = k * nbx * nby + j * nbx + i;
         //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
         np[ijk].node = quad->uv_grid[ij1].node;
@@ -576,7 +576,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
 
     faceQuadStruct *quad = aCube.quad_Z1;
-    int k = nbz - 1;           // i = x/face , j = y/face
+    int k = nbz - 1;            // i = x/face , j = y/face
     int nbdown = quad->side[0]->NbPoints();
     int nbright = quad->side[1]->NbPoints();
     
@@ -593,8 +593,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for (int i1 = 0; i1 < nbdown; i1++)
       for (int j1 = 0; j1 < nbright; j1++) {
         int ij1 = j1 * nbdown + i1;
-        int i = cz1.ia * i1 + cz1.ib * j1 + cz1.ic;    // i = x/face
-        int j = cz1.ja * i1 + cz1.jb * j1 + cz1.jc;    // j = y/face
+        int i = cz1.ia * i1 + cz1.ib * j1 + cz1.ic;     // i = x/face
+        int j = cz1.ja * i1 + cz1.jb * j1 + cz1.jc;     // j = y/face
         int ijk = k * nbx * nby + j * nbx + i;
         //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
         np[ijk].node = quad->uv_grid[ij1].node;
@@ -655,9 +655,9 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
         GetPoint(p1yz, nbx - 1, j, k, nbx, nby, nbz, np, meshDS);
 
         int ijk = k * nbx * nby + j * nbx + i;
-        double x = double (i) / double (nbx - 1);      // *** seulement
-        double y = double (j) / double (nby - 1);      // *** maillage
-        double z = double (k) / double (nbz - 1);      // *** regulier
+        double x = double (i) / double (nbx - 1);       // *** seulement
+        double y = double (j) / double (nby - 1);       // *** maillage
+        double z = double (k) / double (nbz - 1);       // *** regulier
 
         Pt3 X;
         for (int i = 0; i < 3; i++) {
@@ -750,8 +750,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
 //=============================================================================
 
 bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
-                                 const TopoDS_Shape & aShape,
-                                 MapShapeNbElems& aResMap)
+                                  const TopoDS_Shape & aShape,
+                                  MapShapeNbElems& aResMap)
 {
   vector < SMESH_subMesh * >meshFaces;
   TopTools_SequenceOfShape aFaces;
@@ -789,7 +789,7 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
       std::vector<int> aVec = (*anIt).second;
       int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
       if( nbtri == 0 )
-       isAllQuad = true;
+        isAllQuad = true;
     }
     if ( ! isAllQuad ) {
       return EvaluatePentahedralMesh(aMesh, aShape, aResMap);
@@ -810,8 +810,8 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
       std::vector<int> aVec = (*anIt).second;
       nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
       if(IsFirst) {
-       IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
-       IsFirst = false;
+        IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
+        IsFirst = false;
       }
     }
   }
@@ -821,8 +821,8 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
     bool IsOpposite = true;
     for(TopExp_Explorer exp(aFaces.Value(i), TopAbs_EDGE); exp.More(); exp.Next()) {
       if( Edges1.Contains(exp.Current()) ) {
-       IsOpposite = false;
-       break;
+        IsOpposite = false;
+        break;
       }
     }
     if(IsOpposite) {
@@ -872,12 +872,12 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
 void StdMeshers_Hexa_3D::GetPoint(Pt3 p, int i, int j, int k, int nbx, int nby, int nbz,
                                   Point3DStruct * np, const SMESHDS_Mesh * meshDS)
 {
-       int ijk = k * nbx * nby + j * nbx + i;
-       const SMDS_MeshNode * node = np[ijk].node;
-       p[0] = node->X();
-       p[1] = node->Y();
-       p[2] = node->Z();
-       //MESSAGE(" "<<i<<" "<<j<<" "<<k<<" "<<p[0]<<" "<<p[1]<<" "<<p[2]);
+        int ijk = k * nbx * nby + j * nbx + i;
+        const SMDS_MeshNode * node = np[ijk].node;
+        p[0] = node->X();
+        p[1] = node->Y();
+        p[2] = node->Z();
+        //MESSAGE(" "<<i<<" "<<j<<" "<<k<<" "<<p[0]<<" "<<p[1]<<" "<<p[2]);
 }
 
 //=============================================================================
@@ -887,35 +887,35 @@ void StdMeshers_Hexa_3D::GetPoint(Pt3 p, int i, int j, int k, int nbx, int nby,
 //=============================================================================
 
 int StdMeshers_Hexa_3D::GetFaceIndex(SMESH_Mesh & aMesh,
-       const TopoDS_Shape & aShape,
-       const vector < SMESH_subMesh * >&meshFaces,
-       const TopoDS_Vertex & V0,
-       const TopoDS_Vertex & V1,
-       const TopoDS_Vertex & V2, const TopoDS_Vertex & V3)
+        const TopoDS_Shape & aShape,
+        const vector < SMESH_subMesh * >&meshFaces,
+        const TopoDS_Vertex & V0,
+        const TopoDS_Vertex & V1,
+        const TopoDS_Vertex & V2, const TopoDS_Vertex & V3)
 {
-       //MESSAGE("StdMeshers_Hexa_3D::GetFaceIndex");
-       int faceIndex = -1;
-       for (int i = 1; i < 6; i++)
-       {
-               const TopoDS_Shape & aFace = meshFaces[i]->GetSubShape();
-               //const TopoDS_Face& F = TopoDS::Face(aFace);
-               TopTools_IndexedMapOfShape M;
-               TopExp::MapShapes(aFace, TopAbs_VERTEX, M);
-               bool verticesInShape = false;
-               if (M.Contains(V0))
-                       if (M.Contains(V1))
-                               if (M.Contains(V2))
-                                       if (M.Contains(V3))
-                                               verticesInShape = true;
-               if (verticesInShape)
-               {
-                       faceIndex = i;
-                       break;
-               }
-       }
-       //IPAL21120 ASSERT(faceIndex > 0);
-       //SCRUTE(faceIndex);
-       return faceIndex;
+        //MESSAGE("StdMeshers_Hexa_3D::GetFaceIndex");
+        int faceIndex = -1;
+        for (int i = 1; i < 6; i++)
+        {
+                const TopoDS_Shape & aFace = meshFaces[i]->GetSubShape();
+                //const TopoDS_Face& F = TopoDS::Face(aFace);
+                TopTools_IndexedMapOfShape M;
+                TopExp::MapShapes(aFace, TopAbs_VERTEX, M);
+                bool verticesInShape = false;
+                if (M.Contains(V0))
+                        if (M.Contains(V1))
+                                if (M.Contains(V2))
+                                        if (M.Contains(V3))
+                                                verticesInShape = true;
+                if (verticesInShape)
+                {
+                        faceIndex = i;
+                        break;
+                }
+        }
+        //IPAL21120 ASSERT(faceIndex > 0);
+        //SCRUTE(faceIndex);
+        return faceIndex;
 }
 
 //=============================================================================
@@ -925,46 +925,46 @@ int StdMeshers_Hexa_3D::GetFaceIndex(SMESH_Mesh & aMesh,
 //=============================================================================
 
 TopoDS_Edge
-       StdMeshers_Hexa_3D::EdgeNotInFace(SMESH_Mesh & aMesh,
-       const TopoDS_Shape & aShape,
-       const TopoDS_Face & aFace,
-       const TopoDS_Vertex & aVertex,
-       const TopTools_IndexedDataMapOfShapeListOfShape & MS)
+        StdMeshers_Hexa_3D::EdgeNotInFace(SMESH_Mesh & aMesh,
+        const TopoDS_Shape & aShape,
+        const TopoDS_Face & aFace,
+        const TopoDS_Vertex & aVertex,
+        const TopTools_IndexedDataMapOfShapeListOfShape & MS)
 {
-       //MESSAGE("StdMeshers_Hexa_3D::EdgeNotInFace");
-       TopTools_IndexedDataMapOfShapeListOfShape MF;
-       TopExp::MapShapesAndAncestors(aFace, TopAbs_VERTEX, TopAbs_EDGE, MF);
-       const TopTools_ListOfShape & ancestorsInSolid = MS.FindFromKey(aVertex);
-       const TopTools_ListOfShape & ancestorsInFace = MF.FindFromKey(aVertex);
-//     SCRUTE(ancestorsInSolid.Extent());
-//     SCRUTE(ancestorsInFace.Extent());
-       ASSERT(ancestorsInSolid.Extent() == 6); // 6 (edges doublees)
-       ASSERT(ancestorsInFace.Extent() == 2);
-
-       TopoDS_Edge E;
-       E.Nullify();
-       TopTools_ListIteratorOfListOfShape its(ancestorsInSolid);
-       for (; its.More(); its.Next())
-       {
-               TopoDS_Shape ancestor = its.Value();
-               TopTools_ListIteratorOfListOfShape itf(ancestorsInFace);
-               bool isInFace = false;
-               for (; itf.More(); itf.Next())
-               {
-                       TopoDS_Shape ancestorInFace = itf.Value();
-                       if (ancestorInFace.IsSame(ancestor))
-                       {
-                               isInFace = true;
-                               break;
-                       }
-               }
-               if (!isInFace)
-               {
-                       E = TopoDS::Edge(ancestor);
-                       break;
-               }
-       }
-       return E;
+        //MESSAGE("StdMeshers_Hexa_3D::EdgeNotInFace");
+        TopTools_IndexedDataMapOfShapeListOfShape MF;
+        TopExp::MapShapesAndAncestors(aFace, TopAbs_VERTEX, TopAbs_EDGE, MF);
+        const TopTools_ListOfShape & ancestorsInSolid = MS.FindFromKey(aVertex);
+        const TopTools_ListOfShape & ancestorsInFace = MF.FindFromKey(aVertex);
+//      SCRUTE(ancestorsInSolid.Extent());
+//      SCRUTE(ancestorsInFace.Extent());
+        ASSERT(ancestorsInSolid.Extent() == 6); // 6 (edges doublees)
+        ASSERT(ancestorsInFace.Extent() == 2);
+
+        TopoDS_Edge E;
+        E.Nullify();
+        TopTools_ListIteratorOfListOfShape its(ancestorsInSolid);
+        for (; its.More(); its.Next())
+        {
+                TopoDS_Shape ancestor = its.Value();
+                TopTools_ListIteratorOfListOfShape itf(ancestorsInFace);
+                bool isInFace = false;
+                for (; itf.More(); itf.Next())
+                {
+                        TopoDS_Shape ancestorInFace = itf.Value();
+                        if (ancestorInFace.IsSame(ancestor))
+                        {
+                                isInFace = true;
+                                break;
+                        }
+                }
+                if (!isInFace)
+                {
+                        E = TopoDS::Edge(ancestor);
+                        break;
+                }
+        }
+        return E;
 }
 
 //=============================================================================
@@ -974,135 +974,135 @@ TopoDS_Edge
 //=============================================================================
 
 void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
-       const TopoDS_Shape & aShape,
-       const TopoDS_Vertex & V0,
-       const TopoDS_Vertex & V1,
-       const TopoDS_Vertex & V2, const TopoDS_Vertex & V3, Conv2DStruct & conv)
+        const TopoDS_Shape & aShape,
+        const TopoDS_Vertex & V0,
+        const TopoDS_Vertex & V1,
+        const TopoDS_Vertex & V2, const TopoDS_Vertex & V3, Conv2DStruct & conv)
 {
-//     MESSAGE("StdMeshers_Hexa_3D::GetConv2DCoefs");
-//     const TopoDS_Face & F = TopoDS::Face(aShape);
-//     TopoDS_Edge E = quad.edge[0];
-//     double f, l;
-//     Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
-//     TopoDS_Vertex VFirst, VLast;
-//     TopExp::Vertices(E, VFirst, VLast);     // corresponds to f and l
-//     bool isForward = (((l - f) * (quad.last[0] - quad.first[0])) > 0);
+//      MESSAGE("StdMeshers_Hexa_3D::GetConv2DCoefs");
+//      const TopoDS_Face & F = TopoDS::Face(aShape);
+//      TopoDS_Edge E = quad.edge[0];
+//      double f, l;
+//      Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
+//      TopoDS_Vertex VFirst, VLast;
+//      TopExp::Vertices(E, VFirst, VLast);     // corresponds to f and l
+//      bool isForward = (((l - f) * (quad.last[0] - quad.first[0])) > 0);
   TopoDS_Vertex VA, VB;
-//     if (isForward)
-//     {
-//             VA = VFirst;
-//             VB = VLast;
-//     }
-//     else
-//     {
-//             VA = VLast;
-//             VB = VFirst;
-//     }
+//      if (isForward)
+//      {
+//              VA = VFirst;
+//              VB = VLast;
+//      }
+//      else
+//      {
+//              VA = VLast;
+//              VB = VFirst;
+//      }
   VA = quad.side[0]->FirstVertex();
   VB = quad.side[0]->LastVertex();
   
-       int a1, b1, c1, a2, b2, c2;
-       if (VA.IsSame(V0))
-               if (VB.IsSame(V1))
-               {
-                       a1 = 1;
-                       b1 = 0;
-                       c1 = 0;                         // x
-                       a2 = 0;
-                       b2 = 1;
-                       c2 = 0;                         // y
-               }
-               else
-               {
-                       ASSERT(VB.IsSame(V3));
-                       a1 = 0;
-                       b1 = 1;
-                       c1 = 0;                         // y
-                       a2 = 1;
-                       b2 = 0;
-                       c2 = 0;                         // x
-               }
-       if (VA.IsSame(V1))
-               if (VB.IsSame(V2))
-               {
-                       a1 = 0;
-                       b1 = -1;
-                       c1 = 1;                         // 1-y
-                       a2 = 1;
-                       b2 = 0;
-                       c2 = 0;                         // x
-               }
-               else
-               {
-                       ASSERT(VB.IsSame(V0));
-                       a1 = -1;
-                       b1 = 0;
-                       c1 = 1;                         // 1-x
-                       a2 = 0;
-                       b2 = 1;
-                       c2 = 0;                         // y
-               }
-       if (VA.IsSame(V2))
-               if (VB.IsSame(V3))
-               {
-                       a1 = -1;
-                       b1 = 0;
-                       c1 = 1;                         // 1-x
-                       a2 = 0;
-                       b2 = -1;
-                       c2 = 1;                         // 1-y
-               }
-               else
-               {
-                       ASSERT(VB.IsSame(V1));
-                       a1 = 0;
-                       b1 = -1;
-                       c1 = 1;                         // 1-y
-                       a2 = -1;
-                       b2 = 0;
-                       c2 = 1;                         // 1-x
-               }
-       if (VA.IsSame(V3))
-               if (VB.IsSame(V0))
-               {
-                       a1 = 0;
-                       b1 = 1;
-                       c1 = 0;                         // y
-                       a2 = -1;
-                       b2 = 0;
-                       c2 = 1;                         // 1-x
-               }
-               else
-               {
-                       ASSERT(VB.IsSame(V2));
-                       a1 = 1;
-                       b1 = 0;
-                       c1 = 0;                         // x
-                       a2 = 0;
-                       b2 = -1;
-                       c2 = 1;                         // 1-y
-               }
-//     MESSAGE("X = " << c1 << "+ " << a1 << "*x + " << b1 << "*y");
-//     MESSAGE("Y = " << c2 << "+ " << a2 << "*x + " << b2 << "*y");
-       conv.a1 = a1;
-       conv.b1 = b1;
-       conv.c1 = c1;
-       conv.a2 = a2;
-       conv.b2 = b2;
-       conv.c2 = c2;
-
-       int nbdown = quad.side[0]->NbPoints();
-       int nbright = quad.side[1]->NbPoints();
-       conv.ia = int (a1);
-       conv.ib = int (b1);
-       conv.ic =
-               int (c1 * a1 * a1) * (nbdown - 1) + int (c1 * b1 * b1) * (nbright - 1);
-       conv.ja = int (a2);
-       conv.jb = int (b2);
-       conv.jc =
-               int (c2 * a2 * a2) * (nbdown - 1) + int (c2 * b2 * b2) * (nbright - 1);
-//     MESSAGE("I " << conv.ia << " " << conv.ib << " " << conv.ic);
-//     MESSAGE("J " << conv.ja << " " << conv.jb << " " << conv.jc);
+        int a1, b1, c1, a2, b2, c2;
+        if (VA.IsSame(V0))
+                if (VB.IsSame(V1))
+                {
+                        a1 = 1;
+                        b1 = 0;
+                        c1 = 0;                         // x
+                        a2 = 0;
+                        b2 = 1;
+                        c2 = 0;                         // y
+                }
+                else
+                {
+                        ASSERT(VB.IsSame(V3));
+                        a1 = 0;
+                        b1 = 1;
+                        c1 = 0;                         // y
+                        a2 = 1;
+                        b2 = 0;
+                        c2 = 0;                         // x
+                }
+        if (VA.IsSame(V1))
+                if (VB.IsSame(V2))
+                {
+                        a1 = 0;
+                        b1 = -1;
+                        c1 = 1;                         // 1-y
+                        a2 = 1;
+                        b2 = 0;
+                        c2 = 0;                         // x
+                }
+                else
+                {
+                        ASSERT(VB.IsSame(V0));
+                        a1 = -1;
+                        b1 = 0;
+                        c1 = 1;                         // 1-x
+                        a2 = 0;
+                        b2 = 1;
+                        c2 = 0;                         // y
+                }
+        if (VA.IsSame(V2))
+                if (VB.IsSame(V3))
+                {
+                        a1 = -1;
+                        b1 = 0;
+                        c1 = 1;                         // 1-x
+                        a2 = 0;
+                        b2 = -1;
+                        c2 = 1;                         // 1-y
+                }
+                else
+                {
+                        ASSERT(VB.IsSame(V1));
+                        a1 = 0;
+                        b1 = -1;
+                        c1 = 1;                         // 1-y
+                        a2 = -1;
+                        b2 = 0;
+                        c2 = 1;                         // 1-x
+                }
+        if (VA.IsSame(V3))
+                if (VB.IsSame(V0))
+                {
+                        a1 = 0;
+                        b1 = 1;
+                        c1 = 0;                         // y
+                        a2 = -1;
+                        b2 = 0;
+                        c2 = 1;                         // 1-x
+                }
+                else
+                {
+                        ASSERT(VB.IsSame(V2));
+                        a1 = 1;
+                        b1 = 0;
+                        c1 = 0;                         // x
+                        a2 = 0;
+                        b2 = -1;
+                        c2 = 1;                         // 1-y
+                }
+//      MESSAGE("X = " << c1 << "+ " << a1 << "*x + " << b1 << "*y");
+//      MESSAGE("Y = " << c2 << "+ " << a2 << "*x + " << b2 << "*y");
+        conv.a1 = a1;
+        conv.b1 = b1;
+        conv.c1 = c1;
+        conv.a2 = a2;
+        conv.b2 = b2;
+        conv.c2 = c2;
+
+        int nbdown = quad.side[0]->NbPoints();
+        int nbright = quad.side[1]->NbPoints();
+        conv.ia = int (a1);
+        conv.ib = int (b1);
+        conv.ic =
+                int (c1 * a1 * a1) * (nbdown - 1) + int (c1 * b1 * b1) * (nbright - 1);
+        conv.ja = int (a2);
+        conv.jb = int (b2);
+        conv.jc =
+                int (c2 * a2 * a2) * (nbdown - 1) + int (c2 * b2 * b2) * (nbright - 1);
+//      MESSAGE("I " << conv.ia << " " << conv.ib << " " << conv.ic);
+//      MESSAGE("J " << conv.ja << " " << conv.jb << " " << conv.jc);
 }
 
 //================================================================================
@@ -1189,8 +1189,8 @@ SMESH_ComputeErrorPtr ComputePentahedralMesh(SMESH_Mesh &         aMesh,
 //=======================================================================
 
 bool EvaluatePentahedralMesh(SMESH_Mesh & aMesh,
-                            const TopoDS_Shape & aShape,
-                            MapShapeNbElems& aResMap)
+                             const TopoDS_Shape & aShape,
+                             MapShapeNbElems& aResMap)
 {
   StdMeshers_Penta_3D anAlgo;
   bool bOK = anAlgo.Evaluate(aMesh, aShape, aResMap);
index 23582d72eda627e1dcbccb2159afea69092876f5..ca1ef9e11f6bae347de3ed8a7b4339c47a7dee02 100644 (file)
@@ -53,6 +53,7 @@
 #include <Geom_Curve.hxx>
 #include <Geom2d_Curve.hxx>
 #include <Geom_Surface.hxx>
+#include <Precision.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
@@ -303,7 +304,7 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh,
   TopoDS_Face F = TopoDS::Face(aShape.Oriented(TopAbs_FORWARD));
 
   double aLen = 0.0;
-  double NbSeg = 0;
+  int NbSeg = 0;
   bool IsQuadratic = false;
   bool IsFirst = true;
   TopExp_Explorer exp(F,TopAbs_EDGE);
@@ -331,16 +332,27 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh,
       P1 = P2;
     }
   }
+  if(NbSeg<1) {
+    std::vector<int> aResVec(SMDSEntity_Last);
+    for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
+    SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
+    aResMap.insert(std::make_pair(sm,aResVec));
+    SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
+    smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
+                                          "Submesh can not be evaluated",this));
+    return false;
+  }
   aLen = aLen/NbSeg; // middle length
 
-  _edgeLength = DBL_MAX;
+  _edgeLength = Precision::Infinite();
   double tmpLength = Min( _edgeLength, aLen );
 
   GProp_GProps G;
   BRepGProp::SurfaceProperties(aShape,G);
   double anArea = G.Mass();
 
-  int nbFaces = (int) ( anArea/(tmpLength*tmpLength*sqrt(3.)/4) );
+  int nbFaces = Precision::IsInfinite( tmpLength ) ? 0 :
+    (int)( anArea/(tmpLength*tmpLength*sqrt(3.)/4) );
   int nbNodes = (int) ( nbFaces*3 - (NbSeg-1)*2 ) / 6;
 
   std::vector<int> aVec(SMDSEntity_Last);
index e03a921e85db59d00dd55e409503ec1082e36980..ce4876ee3b779cda81f06acdee94178b5c84b5b3 100644 (file)
@@ -49,6 +49,8 @@
 #include <Standard_ErrorHandler.hxx>
 #endif
 
+#include <Basics_Utils.hxx>
+
 using namespace std;
 
 const double PRECISION = 1e-7;
@@ -233,11 +235,11 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
 #ifdef NO_CAS_CATCH
         OCC_CATCH_SIGNALS;
 #endif
-       val = pow( 10.0, val );
+        val = pow( 10.0, val );
       } catch(Standard_Failure) {
-       Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-       throw SALOME_Exception( LOCALIZED( "invalid value"));
-       return;
+        Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+        throw SALOME_Exception( LOCALIZED( "invalid value"));
+        return;
       }
     }
     else if( _convMode==1 && val<0.0 )
@@ -303,7 +305,7 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
     if( !name.IsNull() )
     {
       if( name->GetName()!="t" )
-       res = false;
+        res = false;
     }
     else
       res = isCorrectArg( sub );
@@ -317,10 +319,12 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
  */
 //================================================================================
 bool process( const TCollection_AsciiString& str, int convMode,
-             bool& syntax, bool& args,
-             bool& non_neg, bool& non_zero,
-             bool& singulars, double& sing_point )
+              bool& syntax, bool& args,
+              bool& non_neg, bool& non_zero,
+              bool& singulars, double& sing_point )
 {
+  Kernel_Utils::Localizer loc;
+
   bool parsed_ok = true;
   Handle( ExprIntrp_GenExp ) myExpr;
   try {
@@ -359,19 +363,20 @@ bool process( const TCollection_AsciiString& str, int convMode,
       double t = double(i)/double(max), val;
       if( !f.value( t, val ) )
       {
-       sing_point = t;
-       singulars = true;
-       break;
+        sing_point = t;
+        singulars = true;
+        break;
       }
       if( val<0 )
       {
-       non_neg = false;
-       break;
+        non_neg = false;
+        break;
       }
       if( val>PRECISION )
-       non_zero = true;
+        non_zero = true;
     }
   }
+
   return res && non_neg && non_zero && ( !singulars );
 }
 
index 8ae77c241d3968fa04d16c571a46148cd28d843e..5019156769d9747f0372e96d151feaf9c78e7b4c 100644 (file)
@@ -77,7 +77,7 @@ typedef SMESH_Comment TComm;
 //=============================================================================
 
 StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId,
-                                                   SMESH_Gen* gen)
+                                                    SMESH_Gen* gen)
      : SMESH_2D_Algo(hypId, studyId, gen)
 {
   MESSAGE("StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D");
@@ -123,7 +123,7 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis
     theHyp = hyps.front();
     if(strcmp("QuadrangleParams", theHyp->GetName()) == 0) {
       const StdMeshers_QuadrangleParams* theHyp1 = 
-       (const StdMeshers_QuadrangleParams*)theHyp;
+        (const StdMeshers_QuadrangleParams*)theHyp;
       myTriaVertexID = theHyp1->GetTriaVertex();
       myQuadranglePreference= false;
       myTrianglePreference= false; 
@@ -144,29 +144,29 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis
     theHyp = hyps.front();
     if(strcmp("QuadrangleParams", theHyp->GetName()) == 0) {
       const StdMeshers_QuadrangleParams* theHyp1 = 
-       (const StdMeshers_QuadrangleParams*)theHyp;
+        (const StdMeshers_QuadrangleParams*)theHyp;
       myTriaVertexID = theHyp1->GetTriaVertex();
       theHyp = hyps.back();
       if(strcmp("QuadranglePreference", theHyp->GetName()) == 0) {
-       myQuadranglePreference= true;
-       myTrianglePreference= false; 
+        myQuadranglePreference= true;
+        myTrianglePreference= false; 
       }
       else if(strcmp("TrianglePreference", theHyp->GetName()) == 0){
-       myQuadranglePreference= false;
-       myTrianglePreference= true; 
+        myQuadranglePreference= false;
+        myTrianglePreference= true; 
       }
     }
     else {
       if(strcmp("QuadranglePreference", theHyp->GetName()) == 0) {
-       myQuadranglePreference= true;
-       myTrianglePreference= false; 
+        myQuadranglePreference= true;
+        myTrianglePreference= false; 
       }
       else if(strcmp("TrianglePreference", theHyp->GetName()) == 0){
-       myQuadranglePreference= false;
-       myTrianglePreference= true; 
+        myQuadranglePreference= false;
+        myTrianglePreference= true; 
       }
       const StdMeshers_QuadrangleParams* theHyp2 = 
-       (const StdMeshers_QuadrangleParams*)hyps.back();
+        (const StdMeshers_QuadrangleParams*)hyps.back();
       myTriaVertexID = theHyp2->GetTriaVertex();
     }
   }
@@ -286,7 +286,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
       d = quad->uv_grid[(j + 1) * nbhoriz + i].node;
       SMDS_MeshFace* face = myTool->AddFace(a, b, c, d);
       if(face) {
-       meshDS->SetMeshElementOnShape(face, geomFaceID);
+        meshDS->SetMeshElementOnShape(face, geomFaceID);
       }
     }
   }
@@ -638,7 +638,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
 
 bool StdMeshers_Quadrangle_2D::Evaluate(SMESH_Mesh& aMesh,
                                         const TopoDS_Shape& aShape,
-                                       MapShapeNbElems& aResMap)
+                                        MapShapeNbElems& aResMap)
 
 {
   aMesh.GetSubMesh(aShape);
@@ -778,31 +778,31 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh &         aMes
       SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
       TopoDS_Vertex V = TopoDS::Vertex(meshDS->IndexToShape(myTriaVertexID));
       if(!V.IsNull()) {
-       TopoDS_Edge E1,E2,E3;
-       for(; edgeIt != edges.end(); ++edgeIt) {
-         TopoDS_Edge E =  TopoDS::Edge(*edgeIt);
-         TopoDS_Vertex VF, VL;
-         TopExp::Vertices(E, VF, VL, true);
-         if( VF.IsSame(V) )
-           E1 = E;
-         else if( VL.IsSame(V) )
-           E3 = E;
-         else
-           E2 = E;
-       }
-       quad->side.reserve(4);
-       quad->side.push_back( new StdMeshers_FaceSide(F, E1, &aMesh, true, ignoreMediumNodes));
-       quad->side.push_back( new StdMeshers_FaceSide(F, E2, &aMesh, true, ignoreMediumNodes));
-       quad->side.push_back( new StdMeshers_FaceSide(F, E3, &aMesh, false, ignoreMediumNodes));
-       std::vector<UVPtStruct> UVPSleft = quad->side[0]->GetUVPtStruct(true,0);
-       std::vector<UVPtStruct> UVPStop = quad->side[1]->GetUVPtStruct(false,1);
-       std::vector<UVPtStruct> UVPSright = quad->side[2]->GetUVPtStruct(true,1);
-       const SMDS_MeshNode* aNode = UVPSleft[0].node;
-       gp_Pnt2d aPnt2d( UVPSleft[0].u, UVPSleft[0].v );
-       StdMeshers_FaceSide* VertFS =
-         new StdMeshers_FaceSide(aNode, aPnt2d, quad->side[1]);
-       quad->side.push_back(VertFS);
-       return quad;
+        TopoDS_Edge E1,E2,E3;
+        for(; edgeIt != edges.end(); ++edgeIt) {
+          TopoDS_Edge E =  TopoDS::Edge(*edgeIt);
+          TopoDS_Vertex VF, VL;
+          TopExp::Vertices(E, VF, VL, true);
+          if( VF.IsSame(V) )
+            E1 = E;
+          else if( VL.IsSame(V) )
+            E3 = E;
+          else
+            E2 = E;
+        }
+        quad->side.reserve(4);
+        quad->side.push_back( new StdMeshers_FaceSide(F, E1, &aMesh, true, ignoreMediumNodes));
+        quad->side.push_back( new StdMeshers_FaceSide(F, E2, &aMesh, true, ignoreMediumNodes));
+        quad->side.push_back( new StdMeshers_FaceSide(F, E3, &aMesh, false, ignoreMediumNodes));
+        std::vector<UVPtStruct> UVPSleft = quad->side[0]->GetUVPtStruct(true,0);
+        std::vector<UVPtStruct> UVPStop = quad->side[1]->GetUVPtStruct(false,1);
+        std::vector<UVPtStruct> UVPSright = quad->side[2]->GetUVPtStruct(true,1);
+        const SMDS_MeshNode* aNode = UVPSleft[0].node;
+        gp_Pnt2d aPnt2d( UVPSleft[0].u, UVPSleft[0].v );
+        StdMeshers_FaceSide* VertFS =
+          new StdMeshers_FaceSide(aNode, aPnt2d, quad->side[1]);
+        quad->side.push_back(VertFS);
+        return quad;
       }
     }
     return 0;
@@ -900,10 +900,10 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh &         aMes
 //=============================================================================
 
 bool StdMeshers_Quadrangle_2D::CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
-                                                      const TopoDS_Shape & aShape,
-                                                      MapShapeNbElems& aResMap,
-                                                      std::vector<int>& aNbNodes,
-                                                      bool& IsQuadratic)
+                                                       const TopoDS_Shape & aShape,
+                                                       MapShapeNbElems& aResMap,
+                                                       std::vector<int>& aNbNodes,
+                                                       bool& IsQuadratic)
 
 {
   const TopoDS_Face & F = TopoDS::Face(aShape);
@@ -933,45 +933,45 @@ bool StdMeshers_Quadrangle_2D::CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
       SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
       TopoDS_Vertex V = TopoDS::Vertex(meshDS->IndexToShape(myTriaVertexID));
       if(!V.IsNull()) {
-       TopoDS_Edge E1,E2,E3;
-       for(; edgeIt != edges.end(); ++edgeIt) {
-         TopoDS_Edge E =  TopoDS::Edge(*edgeIt);
-         TopoDS_Vertex VF, VL;
-         TopExp::Vertices(E, VF, VL, true);
-         if( VF.IsSame(V) )
-           E1 = E;
-         else if( VL.IsSame(V) )
-           E3 = E;
-         else
-           E2 = E;
-       }
-       SMESH_subMesh * sm = aMesh.GetSubMesh(E1);
-       MapShapeNbElemsItr anIt = aResMap.find(sm);
-       if(anIt==aResMap.end()) return false;
-       std::vector<int> aVec = (*anIt).second;
-       if(IsQuadratic)
-         aNbNodes[0] = (aVec[SMDSEntity_Node]-1)/2 + 2;
-       else
-         aNbNodes[0] = aVec[SMDSEntity_Node] + 2;
-       sm = aMesh.GetSubMesh(E2);
-       anIt = aResMap.find(sm);
-       if(anIt==aResMap.end()) return false;
-       aVec = (*anIt).second;
-       if(IsQuadratic)
-         aNbNodes[1] = (aVec[SMDSEntity_Node]-1)/2 + 2;
-       else
-         aNbNodes[1] = aVec[SMDSEntity_Node] + 2;
-       sm = aMesh.GetSubMesh(E3);
-       anIt = aResMap.find(sm);
-       if(anIt==aResMap.end()) return false;
-       aVec = (*anIt).second;
-       if(IsQuadratic)
-         aNbNodes[2] = (aVec[SMDSEntity_Node]-1)/2 + 2;
-       else
-         aNbNodes[2] = aVec[SMDSEntity_Node] + 2;
-       aNbNodes[3] = aNbNodes[1];
-       aNbNodes.resize(5);
-       nbSides = 4;
+        TopoDS_Edge E1,E2,E3;
+        for(; edgeIt != edges.end(); ++edgeIt) {
+          TopoDS_Edge E =  TopoDS::Edge(*edgeIt);
+          TopoDS_Vertex VF, VL;
+          TopExp::Vertices(E, VF, VL, true);
+          if( VF.IsSame(V) )
+            E1 = E;
+          else if( VL.IsSame(V) )
+            E3 = E;
+          else
+            E2 = E;
+        }
+        SMESH_subMesh * sm = aMesh.GetSubMesh(E1);
+        MapShapeNbElemsItr anIt = aResMap.find(sm);
+        if(anIt==aResMap.end()) return false;
+        std::vector<int> aVec = (*anIt).second;
+        if(IsQuadratic)
+          aNbNodes[0] = (aVec[SMDSEntity_Node]-1)/2 + 2;
+        else
+          aNbNodes[0] = aVec[SMDSEntity_Node] + 2;
+        sm = aMesh.GetSubMesh(E2);
+        anIt = aResMap.find(sm);
+        if(anIt==aResMap.end()) return false;
+        aVec = (*anIt).second;
+        if(IsQuadratic)
+          aNbNodes[1] = (aVec[SMDSEntity_Node]-1)/2 + 2;
+        else
+          aNbNodes[1] = aVec[SMDSEntity_Node] + 2;
+        sm = aMesh.GetSubMesh(E3);
+        anIt = aResMap.find(sm);
+        if(anIt==aResMap.end()) return false;
+        aVec = (*anIt).second;
+        if(IsQuadratic)
+          aNbNodes[2] = (aVec[SMDSEntity_Node]-1)/2 + 2;
+        else
+          aNbNodes[2] = aVec[SMDSEntity_Node] + 2;
+        aNbNodes[3] = aNbNodes[1];
+        aNbNodes.resize(5);
+        nbSides = 4;
       }
     }
   }
@@ -980,13 +980,13 @@ bool StdMeshers_Quadrangle_2D::CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
       SMESH_subMesh * sm = aMesh.GetSubMesh( *edgeIt );
       MapShapeNbElemsItr anIt = aResMap.find(sm);
       if(anIt==aResMap.end()) {
-       return false;
+        return false;
       }
       std::vector<int> aVec = (*anIt).second;
       if(IsQuadratic)
-       aNbNodes[nbSides] = (aVec[SMDSEntity_Node]-1)/2 + 2;
+        aNbNodes[nbSides] = (aVec[SMDSEntity_Node]-1)/2 + 2;
       else
-       aNbNodes[nbSides] = aVec[SMDSEntity_Node] + 2;
+        aNbNodes[nbSides] = aVec[SMDSEntity_Node] + 2;
       nbSides++;
     }
   }
@@ -1012,16 +1012,16 @@ bool StdMeshers_Quadrangle_2D::CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
       list<TopoDS_Edge>::iterator ite = sideEdges.begin();
       aNbNodes[nbSides] = 1;
       for(; ite!=sideEdges.end(); ite++) {
-       SMESH_subMesh * sm = aMesh.GetSubMesh( *ite );
-       MapShapeNbElemsItr anIt = aResMap.find(sm);
-       if(anIt==aResMap.end()) {
-         return false;
-       }
-       std::vector<int> aVec = (*anIt).second;
-       if(IsQuadratic)
-         aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
-       else
-         aNbNodes[nbSides] += aVec[SMDSEntity_Node] + 1;
+        SMESH_subMesh * sm = aMesh.GetSubMesh( *ite );
+        MapShapeNbElemsItr anIt = aResMap.find(sm);
+        if(anIt==aResMap.end()) {
+          return false;
+        }
+        std::vector<int> aVec = (*anIt).second;
+        if(IsQuadratic)
+          aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
+        else
+          aNbNodes[nbSides] += aVec[SMDSEntity_Node] + 1;
       }
       ++nbSides;
     }
@@ -1050,20 +1050,20 @@ bool StdMeshers_Quadrangle_2D::CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
               sideEdges.splice( sideEdges.begin(), edges, --edges.end());
           }
         }
-       list<TopoDS_Edge>::iterator ite = sideEdges.begin();
-       aNbNodes[nbSides] = 1;
-       for(; ite!=sideEdges.end(); ite++) {
-         SMESH_subMesh * sm = aMesh.GetSubMesh( *ite );
-         MapShapeNbElemsItr anIt = aResMap.find(sm);
-         if(anIt==aResMap.end()) {
-           return false;
-         }
-         std::vector<int> aVec = (*anIt).second;
-         if(IsQuadratic)
-           aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
-         else
-           aNbNodes[nbSides] += aVec[SMDSEntity_Node] + 1;
-       }
+        list<TopoDS_Edge>::iterator ite = sideEdges.begin();
+        aNbNodes[nbSides] = 1;
+        for(; ite!=sideEdges.end(); ite++) {
+          SMESH_subMesh * sm = aMesh.GetSubMesh( *ite );
+          MapShapeNbElemsItr anIt = aResMap.find(sm);
+          if(anIt==aResMap.end()) {
+            return false;
+          }
+          std::vector<int> aVec = (*anIt).second;
+          if(IsQuadratic)
+            aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
+          else
+            aNbNodes[nbSides] += aVec[SMDSEntity_Node] + 1;
+        }
         ++nbSides;
       }
     }
@@ -1221,11 +1221,11 @@ bool StdMeshers_Quadrangle_2D::SetNormalizedGrid (SMESH_Mesh & aMesh,
     for (int j = 0; j < nbvertic; j++) {
       int ij = j * nbhoriz + i;
       // --- droite i cste : x = x0 + y(x1-x0)
-      double x0 = uv_e0[i].normParam;  // bas - sud
-      double x1 = uv_e2[i].normParam;  // haut - nord
+      double x0 = uv_e0[i].normParam;   // bas - sud
+      double x1 = uv_e2[i].normParam;   // haut - nord
       // --- droite j cste : y = y0 + x(y1-y0)
-      double y0 = uv_e3[j].normParam;  // gauche-ouest
-      double y1 = uv_e1[j].normParam;  // droite - est
+      double y0 = uv_e3[j].normParam;   // gauche-ouest
+      double y1 = uv_e1[j].normParam;   // droite - est
       // --- intersection : x=x0+(y0+x(y1-y0))(x1-x0)
       double x = (x0 + y0 * (x1 - x0)) / (1 - (y1 - y0) * (x1 - x0));
       double y = y0 + x * (y1 - y0);
@@ -1754,7 +1754,7 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref (SMESH_Mesh &        aMesh,
     int nbf=0;
     for(j=1; j<nnn-1; j++) {
       for(i=1; i<nb; i++) {
-       nbf++;
+        nbf++;
         if(WisF) {
           SMDS_MeshFace* F =
             myTool->AddFace(NodesBRD.Value(i,j), NodesBRD.Value(i+1,j),
@@ -1867,7 +1867,7 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref (SMESH_Mesh &        aMesh,
       // create faces
       for(j=1; j<=drl+addv; j++) {
         for(i=1; i<nb; i++) {
-         nbf++;
+          nbf++;
           if(WisF) {
             SMDS_MeshFace* F =
               myTool->AddFace(NodesC.Value(i,j), NodesC.Value(i+1,j),
@@ -1901,7 +1901,7 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref (SMESH_Mesh &        aMesh,
         NodesLast.SetValue(nnn,1,NodesC.Value(nb,i));
       }
       for(i=1; i<nt; i++) {
-       nbf++;
+        nbf++;
         if(WisF) {
           SMDS_MeshFace* F =
             myTool->AddFace(NodesLast.Value(i,1), NodesLast.Value(i+1,1),
@@ -1933,8 +1933,8 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref (SMESH_Mesh &        aMesh,
 bool StdMeshers_Quadrangle_2D::EvaluateQuadPref(SMESH_Mesh &        aMesh,
                                                 const TopoDS_Shape& aShape,
                                                 std::vector<int>& aNbNodes,
-                                               MapShapeNbElems& aResMap,
-                                               bool IsQuadratic)
+                                                MapShapeNbElems& aResMap,
+                                                bool IsQuadratic)
 {
   // Auxilary key in order to keep old variant
   // of meshing after implementation new variant
index 95423e861795c5e0a07542c5d66bf2aa99a26033..8d21195dbcebf9f0e134f2647215287fa16d7089 100644 (file)
 
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
-//#include <BRepTools.hxx>
 #include <BRep_Tool.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-//#include <TopoDS_Shell.hxx>
-//#include <TopoDS_Solid.hxx>
-//#include <TopTools_MapOfShape.hxx>
-//#include <gp.hxx>
-//#include <gp_Pnt.hxx>
-
-
-#include <Geom_TrimmedCurve.hxx>
+#include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Geom_Circle.hxx>
 #include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
 #include <TColgp_SequenceOfPnt.hxx>
 #include <TColgp_SequenceOfPnt2d.hxx>
-#include <GeomAPI_ProjectPointOnSurf.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
 
 
 using namespace std;
@@ -148,13 +140,167 @@ bool StdMeshers_RadialQuadrangle_1D2D::CheckHypothesis
   return true;
 }
 
+namespace
+{
+  // ------------------------------------------------------------------------------
+  /*!
+   * \brief Listener used to mark edges meshed by StdMeshers_RadialQuadrangle_1D2D
+   */
+  class TLinEdgeMarker : public SMESH_subMeshEventListener
+  {
+    TLinEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false) {}
+  public:
+    static SMESH_subMeshEventListener* getListener()
+    {
+      static TLinEdgeMarker theEdgeMarker;
+      return &theEdgeMarker;
+    }
+  };
+  
+  // ------------------------------------------------------------------------------
+  /*!
+   * \brief Mark an edge as computed by StdMeshers_RadialQuadrangle_1D2D
+   */
+  void markLinEdgeAsComputedByMe(const TopoDS_Edge& edge, SMESH_subMesh* faceSubMesh)
+  {
+    if ( SMESH_subMesh* edgeSM = faceSubMesh->GetFather()->GetSubMeshContaining( edge ))
+    {
+      if ( !edgeSM->GetEventListenerData( TLinEdgeMarker::getListener() ))
+        faceSubMesh->SetEventListener( TLinEdgeMarker::getListener(),
+                                       SMESH_subMeshEventListenerData::MakeData(faceSubMesh),
+                                       edgeSM);
+    }
+  }
+  // ------------------------------------------------------------------------------
+  /*!
+   * \brief Return true if a radial edge was meshed with StdMeshers_RadialQuadrangle_1D2D with
+   * the same radial distribution
+   */
+  bool isEdgeCompitaballyMeshed(const TopoDS_Edge& edge, SMESH_subMesh* faceSubMesh)
+  {
+    if ( SMESH_subMesh* edgeSM = faceSubMesh->GetFather()->GetSubMeshContaining( edge ))
+    {
+      if ( SMESH_subMeshEventListenerData* otherFaceData =
+           edgeSM->GetEventListenerData( TLinEdgeMarker::getListener() ))
+      {
+        // compare hypothesis aplied to two disk faces sharing radial edges
+        SMESH_Mesh& mesh = *faceSubMesh->GetFather();
+        SMESH_Algo* radialQuadAlgo = mesh.GetGen()->GetAlgo(mesh, faceSubMesh->GetSubShape() );
+        SMESH_subMesh* otherFaceSubMesh = otherFaceData->mySubMeshes.front();
+        const list <const SMESHDS_Hypothesis *> & hyps1 =
+          radialQuadAlgo->GetUsedHypothesis( mesh, faceSubMesh->GetSubShape());
+        const list <const SMESHDS_Hypothesis *> & hyps2 =
+          radialQuadAlgo->GetUsedHypothesis( mesh, otherFaceSubMesh->GetSubShape());
+        if( hyps1.empty() && hyps2.empty() )
+          return true; // defaul hyps
+        if ( hyps1.size() != hyps2.size() ||
+             strcmp( hyps1.front()->GetName(), hyps2.front()->GetName() ))
+          return false;
+        ostringstream hypDump1, hypDump2;
+        list <const SMESHDS_Hypothesis*>::const_iterator hyp1 = hyps1.begin();
+        for ( ; hyp1 != hyps1.end(); ++hyp1 )
+          const_cast<SMESHDS_Hypothesis*>(*hyp1)->SaveTo( hypDump1 );
+        list <const SMESHDS_Hypothesis*>::const_iterator hyp2 = hyps2.begin();
+        for ( ; hyp2 != hyps2.end(); ++hyp2 )
+          const_cast<SMESHDS_Hypothesis*>(*hyp2)->SaveTo( hypDump2 );
+        return hypDump1.str() == hypDump2.str();
+      }
+    }
+    return false;
+  }
+
+  //================================================================================
+  /*!
+   * \brief Return base curve of the edge and extremum parameters
+   */
+  //================================================================================
+
+  Handle(Geom_Curve) getCurve(const TopoDS_Edge& edge, double* f=0, double* l=0)
+  {
+    Handle(Geom_Curve) C;
+    if ( !edge.IsNull() )
+    {
+      double first = 0., last = 0.;
+      C = BRep_Tool::Curve(edge, first, last);
+      if ( !C.IsNull() )
+      {
+        Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C);
+        while( !tc.IsNull() ) {
+          C = tc->BasisCurve();
+          tc = Handle(Geom_TrimmedCurve)::DownCast(C);
+        }
+        if ( f ) *f = first;
+        if ( l ) *l = last;
+      }
+    }
+    return C;
+  }
+
+  //================================================================================
+  /*!
+   * \brief Return edges of the face
+   *  \retval int - nb of edges
+   */
+  //================================================================================
+
+  int analyseFace(const TopoDS_Shape& face,
+                  TopoDS_Edge&        CircEdge,
+                  TopoDS_Edge&        LinEdge1,
+                  TopoDS_Edge&        LinEdge2)
+  {
+    CircEdge.Nullify(); LinEdge1.Nullify(); LinEdge2.Nullify();
+    int nbe = 0;
+
+    for ( TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next(), ++nbe )
+    {
+      const TopoDS_Edge& E = TopoDS::Edge( exp.Current() );
+      double f,l;
+      Handle(Geom_Curve) C = getCurve(E,&f,&l);
+      if ( !C.IsNull() )
+      {
+        if ( C->IsKind( STANDARD_TYPE(Geom_Circle)))
+        {
+          if ( CircEdge.IsNull() )
+            CircEdge = E;
+          else
+            return 0;
+        }
+        else if ( LinEdge1.IsNull() )
+          LinEdge1 = E;
+        else
+          LinEdge2 = E;
+      }
+    }
+    return nbe;
+  }
+}
+
+//=======================================================================
+/*!
+ * \brief Allow algo to do something after persistent restoration
+ * \param subMesh - restored submesh
+ *
+ * call markLinEdgeAsComputedByMe()
+ */
+//=======================================================================
+
+void StdMeshers_RadialQuadrangle_1D2D::SubmeshRestored(SMESH_subMesh* faceSubMesh)
+{
+  if ( !faceSubMesh->IsEmpty() )
+  {
+    TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
+    analyseFace( faceSubMesh->GetSubShape(), CircEdge, LinEdge1, LinEdge2 );
+    if ( !LinEdge1.IsNull() ) markLinEdgeAsComputedByMe( LinEdge1, faceSubMesh );
+    if ( !LinEdge2.IsNull() ) markLinEdgeAsComputedByMe( LinEdge2, faceSubMesh );
+  }
+}
 
 //=======================================================================
 //function : Compute
 //purpose  : 
 //=======================================================================
 
-bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
+bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
                                                const TopoDS_Shape& aShape)
 {
   TopExp_Explorer exp;
@@ -162,33 +308,16 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
 
   myHelper = new SMESH_MesherHelper( aMesh );
   myHelper->IsQuadraticSubMesh( aShape );
+  // to delete helper at exit from Compute()
+  auto_ptr<SMESH_MesherHelper> helperDeleter( myHelper );
 
   myLayerPositions.clear();
 
-  TopoDS_Edge E1,E2,E3;
-  Handle(Geom_Curve) C1,C2,C3;
-  double f1,l1,f2,l2,f3,l3;
-  int nbe = 0;
-  for ( exp.Init( aShape, TopAbs_EDGE ); exp.More(); exp.Next() ) {
-    nbe++;
-    TopoDS_Edge E = TopoDS::Edge( exp.Current() );
-    if(nbe==1) {
-      E1 = E;
-      C1 = BRep_Tool::Curve(E,f1,l1);
-    }
-    else if(nbe==2) {
-      E2 = E;
-      C2 = BRep_Tool::Curve(E,f2,l2);
-    }
-    else if(nbe==3) {
-      E3 = E;
-      C3 = BRep_Tool::Curve(E,f3,l3);
-    }
-  }
-
-  if(nbe>3)
+  TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
+  int nbe = analyseFace( aShape, CircEdge, LinEdge1, LinEdge2 );
+  if( nbe>3 || nbe < 1 || CircEdge.IsNull() )
     return error(COMPERR_BAD_SHAPE);
-
+  
   gp_Pnt P0,P1;
   // points for rotation
   TColgp_SequenceOfPnt Points;
@@ -196,42 +325,40 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
   TColStd_SequenceOfReal Angles;
   // Nodes1 and Nodes2 - nodes along radiuses
   // CNodes - nodes on circle edge
-  std::vector< const SMDS_MeshNode* > Nodes1, Nodes2, CNodes;
+  vector< const SMDS_MeshNode* > Nodes1, Nodes2, CNodes;
   SMDS_MeshNode * NC;
   // parameters edge nodes on face
-  TColgp_SequenceOfPnt2d Pnts2d1, Pnts2d2;
+  TColgp_SequenceOfPnt2d Pnts2d1;
   gp_Pnt2d PC;
 
   int faceID = meshDS->ShapeToIndex(aShape);
   TopoDS_Face F = TopoDS::Face(aShape);
   Handle(Geom_Surface) S = BRep_Tool::Surface(F);
 
-  //cout<<"RadialQuadrangle_1D2D::Compute   nbe = "<<nbe<<endl;
-  TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
-  if(nbe==1) {
-    // C1 must be a circle
-    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(C1);
-    if( aCirc.IsNull() )
-      return error(COMPERR_BAD_SHAPE);
-    CircEdge = E1;
+  if(nbe==1)
+  {
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
 
-    bool ok = _gen->Compute( aMesh, CircEdge, false, MeshDim_1D );
+    bool ok = _gen->Compute( aMesh, CircEdge );
+    if( !ok ) return false;
+    map< double, const SMDS_MeshNode* > theNodes;
+    ok = GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
     if( !ok ) return false;
-    std::map< double, const SMDS_MeshNode* > theNodes;
-    GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
 
     CNodes.clear();
-    std::map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
+    map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
     const SMDS_MeshNode* NF = (*itn).second;
     CNodes.push_back( (*itn).second );
     double fang = (*itn).first;
-    itn++;
-    for(; itn != theNodes.end(); itn++ ) {
-      CNodes.push_back( (*itn).second );
-      double ang = (*itn).first - fang;
-      if( ang>PI ) ang = ang - 2*PI;
-      if( ang<-PI ) ang = ang + 2*PI;
-      Angles.Append( ang );
+    if ( itn != theNodes.end() ) {
+      itn++;
+      for(; itn != theNodes.end(); itn++ ) {
+        CNodes.push_back( (*itn).second );
+        double ang = (*itn).first - fang;
+        if( ang>PI ) ang = ang - 2*PI;
+        if( ang<-PI ) ang = ang + 2*PI;
+        Angles.Append( ang ); 
+      }
     }
     P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() );
     P0 = aCirc->Location();
@@ -267,88 +394,53 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
       double V = PC.Y() + aVec2d.Y()*myLayerPositions[i];
       meshDS->SetNodeOnFace( node, faceID, U, V );
       Pnts2d1.Append(gp_Pnt2d(U,V));
-      Pnts2d2.Append(gp_Pnt2d(U,V));
     }
     Nodes1[Nodes1.size()-1] = NF;
     Nodes2[Nodes1.size()-1] = NF;
   }
-  else if(nbe==2) {
+  else if(nbe==2 && LinEdge1.Orientation() != TopAbs_INTERNAL )
+  {
     // one curve must be a half of circle and other curve must be
     // a segment of line
-    Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
-    while( !tc.IsNull() ) {
-      C1 = tc->BasisCurve();
-      tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
-    }
-    tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
-    while( !tc.IsNull() ) {
-      C2 = tc->BasisCurve();
-      tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
-    }
-
-    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(C1);
-    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(C2);
-    CircEdge = E1;
-    LinEdge1 = E2;
-    double fp = f1;
-    double lp = l1;
-    if( aCirc.IsNull() ) {
-      aCirc = Handle(Geom_Circle)::DownCast(C2);
-      CircEdge = E2;
-      LinEdge1 = E1;
-      fp = f2;
-      lp = l2;
-      aLine = Handle(Geom_Line)::DownCast(C3);
-    }
-    if( aCirc.IsNull() ) {
-      // not circle
-      return error(COMPERR_BAD_SHAPE);
-    }
+    double fp, lp;
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge, &fp, &lp ));
     if( fabs(fabs(lp-fp)-PI) > Precision::Confusion() ) {
       // not half of circle
       return error(COMPERR_BAD_SHAPE);
     }
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast( getCurve( LinEdge1 ));
     if( aLine.IsNull() ) {
       // other curve not line
       return error(COMPERR_BAD_SHAPE);
     }
-    SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1);
-    if( sm1 ) {
-      SMESHDS_SubMesh* sdssm1 = sm1->GetSubMeshDS();
-      if( sdssm1 ) {
-        if( sm1->GetSubMeshDS()->NbNodes()>0 ) {
-          SMESH_subMesh* sm = aMesh.GetSubMesh(F);
-          SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
-          smError.reset(new SMESH_ComputeError(COMPERR_ALGO_FAILED,
-                                               "Invalid set of hypothesises",this));
-          return false;
-        }
-      }
+    bool linEdgeComputed = false;
+    if( SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1) ) {
+      if( !sm1->IsEmpty() )
+        if( isEdgeCompitaballyMeshed( LinEdge1, aMesh.GetSubMesh(F) ))
+          linEdgeComputed = true;
+        else
+          return error("Invalid set of hypotheses");
     }
 
-    bool ok = _gen->Compute( aMesh, CircEdge, false, MeshDim_1D );
+    bool ok = _gen->Compute( aMesh, CircEdge );
     if( !ok ) return false;
-    std::map< double, const SMDS_MeshNode* > theNodes;
+    map< double, const SMDS_MeshNode* > theNodes;
     GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
 
     CNodes.clear();
-    std::map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
-    const SMDS_MeshNode* NF = (*itn).second;
-    CNodes.push_back( (*itn).second );
+    map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
     double fang = (*itn).first;
     itn++;
-    const SMDS_MeshNode* NL;
-    int nbn = 1;
     for(; itn != theNodes.end(); itn++ ) {
-      nbn++;
-      if( nbn == theNodes.size() )
-        NL = (*itn).second;
       CNodes.push_back( (*itn).second );
       double ang = (*itn).first - fang;
       if( ang>PI ) ang = ang - 2*PI;
       if( ang<-PI ) ang = ang + 2*PI;
       Angles.Append( ang );
     }
+    const SMDS_MeshNode* NF = theNodes.begin()->second;
+    const SMDS_MeshNode* NL = theNodes.rbegin()->second;
+    CNodes.push_back( NF );
     P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() );
     gp_Pnt P2( NL->X(), NL->Y(), NL->Z() );
     P0 = aCirc->Location();
@@ -356,164 +448,143 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
     myLayerPositions.clear();
     computeLayerPositions(P0,P1);
 
-    gp_Vec aVec(P0,P1);
-    int edgeID = meshDS->ShapeToIndex(LinEdge1);
-    // check orientation
-    Handle(Geom_Curve) Crv = BRep_Tool::Curve(LinEdge1,fp,lp);
-    gp_Pnt Ptmp;
-    Crv->D0(fp,Ptmp);
-    bool ori = true;
-    if( P1.Distance(Ptmp) > Precision::Confusion() )
-      ori = false;
-    // get UV points for edge
-    gp_Pnt2d PF,PL;
-    BRep_Tool::UVPoints( LinEdge1, TopoDS::Face(aShape), PF, PL );
-    PC = gp_Pnt2d( (PF.X()+PL.X())/2, (PF.Y()+PL.Y())/2 );
-    gp_Vec2d V2d;
-    if(ori) V2d = gp_Vec2d(PC,PF);
-    else V2d = gp_Vec2d(PC,PL);
-    // add nodes on edge
-    double cp = (fp+lp)/2;
-    double dp2 = (lp-fp)/2;
-    NC = meshDS->AddNode(P0.X(), P0.Y(), P0.Z());
-    meshDS->SetNodeOnEdge(NC, edgeID, cp);
-    Nodes1.resize( myLayerPositions.size()+1 );
-    Nodes2.resize( myLayerPositions.size()+1 );
-    int i = 0;
-    for(; i<myLayerPositions.size(); i++) {
-      gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
-                P0.Y() + aVec.Y()*myLayerPositions[i],
-                P0.Z() + aVec.Z()*myLayerPositions[i] );
-      Points.Append(P);
-      SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
-      Nodes1[i] = node;
-      double param;
-      if(ori)
-        param = fp + dp2*(1-myLayerPositions[i]);
-      else
-        param = cp + dp2*myLayerPositions[i];
-      meshDS->SetNodeOnEdge(node, edgeID, param);
-      P = gp_Pnt( P0.X() - aVec.X()*myLayerPositions[i],
-                  P0.Y() - aVec.Y()*myLayerPositions[i],
-                  P0.Z() - aVec.Z()*myLayerPositions[i] );
-      node = meshDS->AddNode(P.X(), P.Y(), P.Z());
-      Nodes2[i] = node;
-      if(!ori)
-        param = fp + dp2*(1-myLayerPositions[i]);
-      else
-        param = cp + dp2*myLayerPositions[i];
-      meshDS->SetNodeOnEdge(node, edgeID, param);
-      // parameters on face
-      gp_Pnt2d P2d( PC.X() + V2d.X()*myLayerPositions[i],
-                    PC.Y() + V2d.Y()*myLayerPositions[i] );
-      Pnts2d1.Append(P2d);
-      P2d = gp_Pnt2d( PC.X() - V2d.X()*myLayerPositions[i],
-                      PC.Y() - V2d.Y()*myLayerPositions[i] );
-      Pnts2d2.Append(P2d);
+    if ( linEdgeComputed )
+    {
+      if (!GetSortedNodesOnEdge(aMesh.GetMeshDS(),LinEdge1,true,theNodes))
+        return error("Invalid mesh on a straight edge");
+
+      vector< const SMDS_MeshNode* > *pNodes1 = &Nodes1, *pNodes2 = &Nodes2;
+      bool nodesFromP0ToP1 = ( theNodes.rbegin()->second == NF );
+      if ( !nodesFromP0ToP1 ) std::swap( pNodes1, pNodes2 );
+
+      map< double, const SMDS_MeshNode* >::reverse_iterator ritn = theNodes.rbegin();
+      itn = theNodes.begin();
+      for ( int i = Nodes1.size()-1; i > -1; ++itn, ++ritn, --i )
+      {
+        (*pNodes1)[i] = ritn->second;
+        (*pNodes2)[i] =  itn->second;
+        Points.Append( gpXYZ( Nodes1[i]));
+        Pnts2d1.Append( myHelper->GetNodeUV( F, Nodes1[i]));
+      }
+      NC = const_cast<SMDS_MeshNode*>( itn->second );
+      Points.Remove( Nodes1.size() );
     }
-    Nodes1[ myLayerPositions.size() ] = NF;
-    Nodes2[ myLayerPositions.size() ] = NL;
-    // create 1D elements on edge
-    std::vector< const SMDS_MeshNode* > tmpNodes;
-    tmpNodes.resize(2*Nodes1.size()+1);
-    for(i=0; i<Nodes2.size(); i++)
-      tmpNodes[Nodes2.size()-i-1] = Nodes2[i];
-    tmpNodes[Nodes2.size()] = NC;
-    for(i=0; i<Nodes1.size(); i++)
-      tmpNodes[Nodes2.size()+1+i] = Nodes1[i];
-    for(i=1; i<tmpNodes.size(); i++) {
-      SMDS_MeshEdge* ME = myHelper->AddEdge( tmpNodes[i-1], tmpNodes[i] );
-      if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
+    else
+    {
+      gp_Vec aVec(P0,P1);
+      int edgeID = meshDS->ShapeToIndex(LinEdge1);
+      // check orientation
+      Handle(Geom_Curve) Crv = BRep_Tool::Curve(LinEdge1,fp,lp);
+      gp_Pnt Ptmp;
+      Crv->D0(fp,Ptmp);
+      bool ori = true;
+      if( P1.Distance(Ptmp) > Precision::Confusion() )
+        ori = false;
+      // get UV points for edge
+      gp_Pnt2d PF,PL;
+      BRep_Tool::UVPoints( LinEdge1, TopoDS::Face(aShape), PF, PL );
+      PC = gp_Pnt2d( (PF.X()+PL.X())/2, (PF.Y()+PL.Y())/2 );
+      gp_Vec2d V2d;
+      if(ori) V2d = gp_Vec2d(PC,PF);
+      else V2d = gp_Vec2d(PC,PL);
+      // add nodes on edge
+      double cp = (fp+lp)/2;
+      double dp2 = (lp-fp)/2;
+      NC = meshDS->AddNode(P0.X(), P0.Y(), P0.Z());
+      meshDS->SetNodeOnEdge(NC, edgeID, cp);
+      Nodes1.resize( myLayerPositions.size()+1 );
+      Nodes2.resize( myLayerPositions.size()+1 );
+      int i = 0;
+      for(; i<myLayerPositions.size(); i++) {
+        gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
+                  P0.Y() + aVec.Y()*myLayerPositions[i],
+                  P0.Z() + aVec.Z()*myLayerPositions[i] );
+        Points.Append(P);
+        SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
+        Nodes1[i] = node;
+        double param;
+        if(ori)
+          param = fp + dp2*(1-myLayerPositions[i]);
+        else
+          param = cp + dp2*myLayerPositions[i];
+        meshDS->SetNodeOnEdge(node, edgeID, param);
+        P = gp_Pnt( P0.X() - aVec.X()*myLayerPositions[i],
+                    P0.Y() - aVec.Y()*myLayerPositions[i],
+                    P0.Z() - aVec.Z()*myLayerPositions[i] );
+        node = meshDS->AddNode(P.X(), P.Y(), P.Z());
+        Nodes2[i] = node;
+        if(!ori)
+          param = fp + dp2*(1-myLayerPositions[i]);
+        else
+          param = cp + dp2*myLayerPositions[i];
+        meshDS->SetNodeOnEdge(node, edgeID, param);
+        // parameters on face
+        gp_Pnt2d P2d( PC.X() + V2d.X()*myLayerPositions[i],
+                      PC.Y() + V2d.Y()*myLayerPositions[i] );
+        Pnts2d1.Append(P2d);
+      }
+      Nodes1[ myLayerPositions.size() ] = NF;
+      Nodes2[ myLayerPositions.size() ] = NL;
+      // create 1D elements on edge
+      vector< const SMDS_MeshNode* > tmpNodes;
+      tmpNodes.resize(2*Nodes1.size()+1);
+      for(i=0; i<Nodes2.size(); i++)
+        tmpNodes[Nodes2.size()-i-1] = Nodes2[i];
+      tmpNodes[Nodes2.size()] = NC;
+      for(i=0; i<Nodes1.size(); i++)
+        tmpNodes[Nodes2.size()+1+i] = Nodes1[i];
+      for(i=1; i<tmpNodes.size(); i++) {
+        SMDS_MeshEdge* ME = myHelper->AddEdge( tmpNodes[i-1], tmpNodes[i] );
+        if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
+      }
+      markLinEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
     }
   }
-  else { // nbe==3
+  else // nbe==3 or ( nbe==2 && linEdge is INTERNAL )
+  {
+    if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
+      LinEdge2 = LinEdge1;
+
     // one curve must be a part of circle and other curves must be
     // segments of line
-    Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
-    while( !tc.IsNull() ) {
-      C1 = tc->BasisCurve();
-      tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
-    }
-    tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
-    while( !tc.IsNull() ) {
-      C2 = tc->BasisCurve();
-      tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
-    }
-    tc = Handle(Geom_TrimmedCurve)::DownCast(C3);
-    while( !tc.IsNull() ) {
-      C3 = tc->BasisCurve();
-      tc = Handle(Geom_TrimmedCurve)::DownCast(C3);
-    }
-
-    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(C1);
-    Handle(Geom_Line) aLine1 = Handle(Geom_Line)::DownCast(C2);
-    Handle(Geom_Line) aLine2 = Handle(Geom_Line)::DownCast(C3);
-    CircEdge = E1;
-    LinEdge1 = E2;
-    LinEdge2 = E3;
-    double fp = f1;
-    double lp = l1;
-    if( aCirc.IsNull() ) {
-      aCirc = Handle(Geom_Circle)::DownCast(C2);
-      CircEdge = E2;
-      LinEdge1 = E3;
-      LinEdge2 = E1;
-      fp = f2;
-      lp = l2;
-      aLine1 = Handle(Geom_Line)::DownCast(C3);
-      aLine2 = Handle(Geom_Line)::DownCast(C1);
-      if( aCirc.IsNull() ) {
-        aCirc = Handle(Geom_Circle)::DownCast(C3);
-        CircEdge = E3;
-        LinEdge1 = E1;
-        LinEdge2 = E2;
-        fp = f3;
-        lp = l3;
-        aLine1 = Handle(Geom_Line)::DownCast(C1);
-        aLine2 = Handle(Geom_Line)::DownCast(C2);
-      }
-    }
-    if( aCirc.IsNull() ) {
-      // not circle
-      return error(COMPERR_BAD_SHAPE);
-    }
+    double fp, lp;
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
+    Handle(Geom_Line) aLine1 = Handle(Geom_Line)::DownCast( getCurve( LinEdge1 ));
+    Handle(Geom_Line) aLine2 = Handle(Geom_Line)::DownCast( getCurve( LinEdge2 ));
     if( aLine1.IsNull() || aLine2.IsNull() ) {
       // other curve not line
       return error(COMPERR_BAD_SHAPE);
     }
-    SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1);
-    SMESH_subMesh* sm2 = aMesh.GetSubMesh(LinEdge2);
-    if( sm1 && sm2 ) {
-      SMESHDS_SubMesh* sdssm1 = sm1->GetSubMeshDS();
-      SMESHDS_SubMesh* sdssm2 = sm2->GetSubMeshDS();
-      if( sdssm1 && sdssm2 ) {
-        if( sm1->GetSubMeshDS()->NbNodes()>0 || sm2->GetSubMeshDS()->NbNodes()>0 ) {
-          SMESH_subMesh* sm = aMesh.GetSubMesh(F);
-          SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
-          smError.reset(new SMESH_ComputeError(COMPERR_ALGO_FAILED,
-                                               "Invalid set of hypothesises",this));
-          return false;
-        }
-      }
-    }
 
-    bool ok = _gen->Compute( aMesh, CircEdge, false, MeshDim_1D );
+    bool linEdge1Computed = false;
+    if ( SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1))
+      if( !sm1->IsEmpty() )
+        if( isEdgeCompitaballyMeshed( LinEdge1, aMesh.GetSubMesh(F) ))
+          linEdge1Computed = true;
+        else
+          return error("Invalid set of hypotheses");
+
+    bool linEdge2Computed = false;
+    if ( SMESH_subMesh* sm2 = aMesh.GetSubMesh(LinEdge2))
+      if( !sm2->IsEmpty() )
+        if( isEdgeCompitaballyMeshed( LinEdge2, aMesh.GetSubMesh(F)  ))
+          linEdge2Computed = true;
+        else
+          return error("Invalid set of hypotheses");
+
+    bool ok = _gen->Compute( aMesh, CircEdge );
     if( !ok ) return false;
-    std::map< double, const SMDS_MeshNode* > theNodes;
+    map< double, const SMDS_MeshNode* > theNodes;
     GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
 
+    const SMDS_MeshNode* NF = theNodes.begin()->second;
+    const SMDS_MeshNode* NL = theNodes.rbegin()->second;
     CNodes.clear();
-    std::map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
-    const SMDS_MeshNode* NF = (*itn).second;
-    CNodes.push_back( (*itn).second );
+    CNodes.push_back( NF );
+    map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
     double fang = (*itn).first;
     itn++;
-    const SMDS_MeshNode* NL;
-    int nbn = 1;
     for(; itn != theNodes.end(); itn++ ) {
-      nbn++;
-      if( nbn == theNodes.size() )
-        NL = (*itn).second;
       CNodes.push_back( (*itn).second );
       double ang = (*itn).first - fang;
       if( ang>PI ) ang = ang - 2*PI;
@@ -527,6 +598,9 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
     myLayerPositions.clear();
     computeLayerPositions(P0,P1);
 
+    Nodes1.resize( myLayerPositions.size()+1 );
+    Nodes2.resize( myLayerPositions.size()+1 );
+
     exp.Init( LinEdge1, TopAbs_VERTEX );
     TopoDS_Vertex V1 = TopoDS::Vertex( exp.Current() );
     exp.Next();
@@ -534,119 +608,169 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
     gp_Pnt PE1 = BRep_Tool::Pnt(V1);
     gp_Pnt PE2 = BRep_Tool::Pnt(V2);
     if( ( P1.Distance(PE1) > Precision::Confusion() ) &&
-        ( P1.Distance(PE2) > Precision::Confusion() ) ) {
-      TopoDS_Edge E = LinEdge1;
-      LinEdge1 = LinEdge2;
-      LinEdge2 = E;
+        ( P1.Distance(PE2) > Precision::Confusion() ) )
+    {
+      std::swap( LinEdge1, LinEdge2 );
+      std::swap( linEdge1Computed, linEdge2Computed );
     }
-    TopoDS_Vertex VC;
+    TopoDS_Vertex VC = V2;
     if( ( P1.Distance(PE1) > Precision::Confusion() ) &&
-        ( P2.Distance(PE1) > Precision::Confusion() ) ) {
+        ( P2.Distance(PE1) > Precision::Confusion() ) )
       VC = V1;
-    }
-    else VC = V2;
     int vertID = meshDS->ShapeToIndex(VC);
+
     // LinEdge1
-    int edgeID = meshDS->ShapeToIndex(LinEdge1);
-    gp_Vec aVec(P0,P1);
-    // check orientation
-    Handle(Geom_Curve) Crv = BRep_Tool::Curve(LinEdge1,fp,lp);
-    gp_Pnt Ptmp;
-    Crv->D0(fp,Ptmp);
-    bool ori = false;
-    if( P1.Distance(Ptmp) > Precision::Confusion() )
-      ori = true;
-    // get UV points for edge
-    gp_Pnt2d PF,PL;
-    BRep_Tool::UVPoints( LinEdge1, TopoDS::Face(aShape), PF, PL );
-    gp_Vec2d V2d;
-    if(ori) {
-      V2d = gp_Vec2d(PF,PL);
-      PC = PF;
-    }
-    else {
-      V2d = gp_Vec2d(PL,PF);
-      PC = PL;
-    }
-    NC = meshDS->AddNode(P0.X(), P0.Y(), P0.Z());
-    meshDS->SetNodeOnVertex(NC, vertID);
-    double dp = lp-fp;
-    Nodes1.resize( myLayerPositions.size()+1 );
-    int i = 0;
-    for(; i<myLayerPositions.size(); i++) {
-      gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
-                P0.Y() + aVec.Y()*myLayerPositions[i],
-                P0.Z() + aVec.Z()*myLayerPositions[i] );
-      Points.Append(P);
-      SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
-      Nodes1[i] = node;
-      double param;
-      if(!ori)
-        param = fp + dp*(1-myLayerPositions[i]);
-      else
-        param = fp + dp*myLayerPositions[i];
-      meshDS->SetNodeOnEdge(node, edgeID, param);
-      // parameters on face
-      gp_Pnt2d P2d( PC.X() + V2d.X()*myLayerPositions[i],
-                    PC.Y() + V2d.Y()*myLayerPositions[i] );
-      Pnts2d1.Append(P2d);
+    if ( linEdge1Computed )
+    {
+      if (!GetSortedNodesOnEdge(aMesh.GetMeshDS(),LinEdge1,true,theNodes))
+        return error("Invalid mesh on a straight edge");
+
+      bool nodesFromP0ToP1 = ( theNodes.rbegin()->second == NF );
+      NC = const_cast<SMDS_MeshNode*>
+        ( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second );
+      int i = 0, ir = Nodes1.size()-1;
+      int * pi = nodesFromP0ToP1 ? &i : &ir;
+      itn = theNodes.begin();
+      if ( nodesFromP0ToP1 ) ++itn;
+      for ( ; i < Nodes1.size(); ++i, --ir, ++itn )
+      {
+        Nodes1[*pi] = itn->second;
+      }
+      for ( i = 0; i < Nodes1.size()-1; ++i )
+      {
+        Points.Append( gpXYZ( Nodes1[i]));
+        Pnts2d1.Append( myHelper->GetNodeUV( F, Nodes1[i]));
+      }
     }
-    Nodes1[ myLayerPositions.size() ] = NF;
-    // create 1D elements on edge
-    SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] );
-    if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
-    for(i=1; i<Nodes1.size(); i++) {
-      SMDS_MeshEdge* ME = myHelper->AddEdge( Nodes1[i-1], Nodes1[i] );
+    else
+    {
+      int edgeID = meshDS->ShapeToIndex(LinEdge1);
+      gp_Vec aVec(P0,P1);
+      // check orientation
+      Handle(Geom_Curve) Crv = BRep_Tool::Curve(LinEdge1,fp,lp);
+      gp_Pnt Ptmp = Crv->Value(fp);
+      bool ori = false;
+      if( P1.Distance(Ptmp) > Precision::Confusion() )
+        ori = true;
+      // get UV points for edge
+      gp_Pnt2d PF,PL;
+      BRep_Tool::UVPoints( LinEdge1, TopoDS::Face(aShape), PF, PL );
+      gp_Vec2d V2d;
+      if(ori) {
+        V2d = gp_Vec2d(PF,PL);
+        PC = PF;
+      }
+      else {
+        V2d = gp_Vec2d(PL,PF);
+        PC = PL;
+      }
+      NC = const_cast<SMDS_MeshNode*>( VertexNode( VC, meshDS ));
+      if ( !NC )
+      {
+        NC = meshDS->AddNode(P0.X(), P0.Y(), P0.Z());
+        meshDS->SetNodeOnVertex(NC, vertID);
+      }
+      double dp = lp-fp;
+      int i = 0;
+      for(; i<myLayerPositions.size(); i++) {
+        gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
+                  P0.Y() + aVec.Y()*myLayerPositions[i],
+                  P0.Z() + aVec.Z()*myLayerPositions[i] );
+        Points.Append(P);
+        SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
+        Nodes1[i] = node;
+        double param;
+        if(!ori)
+          param = fp + dp*(1-myLayerPositions[i]);
+        else
+          param = fp + dp*myLayerPositions[i];
+        meshDS->SetNodeOnEdge(node, edgeID, param);
+        // parameters on face
+        gp_Pnt2d P2d( PC.X() + V2d.X()*myLayerPositions[i],
+                      PC.Y() + V2d.Y()*myLayerPositions[i] );
+        Pnts2d1.Append(P2d);
+      }
+      Nodes1[ myLayerPositions.size() ] = NF;
+      // create 1D elements on edge
+      SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] );
       if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
+      for(i=1; i<Nodes1.size(); i++) {
+        ME = myHelper->AddEdge( Nodes1[i-1], Nodes1[i] );
+        if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
+      }
+      if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
+        Nodes2 = Nodes1;
     }
+    markLinEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
+
     // LinEdge2
-    edgeID = meshDS->ShapeToIndex(LinEdge1);
-    aVec = gp_Vec(P0,P2);
-    // check orientation
-    Crv = BRep_Tool::Curve(LinEdge2,fp,lp);
-    Crv->D0(fp,Ptmp);
-    ori = false;
-    if( P2.Distance(Ptmp) > Precision::Confusion() )
-      ori = true;
-    // get UV points for edge
-    BRep_Tool::UVPoints( LinEdge2, TopoDS::Face(aShape), PF, PL );
-    if(ori) {
-      V2d = gp_Vec2d(PF,PL);
-      PC = PF;
-    }
-    else {
-      V2d = gp_Vec2d(PL,PF);
-      PC = PL;
-    }
-    dp = lp-fp;
-    Nodes2.resize( myLayerPositions.size()+1 );
-    for(i=0; i<myLayerPositions.size(); i++) {
-      gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
-                P0.Y() + aVec.Y()*myLayerPositions[i],
-                P0.Z() + aVec.Z()*myLayerPositions[i] );
-      SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
-      Nodes2[i] = node;
-      double param;
-      if(!ori)
-        param = fp + dp*(1-myLayerPositions[i]);
-      else
-        param = fp + dp*myLayerPositions[i];
-      meshDS->SetNodeOnEdge(node, edgeID, param);
-      // parameters on face
-      gp_Pnt2d P2d( PC.X() + V2d.X()*myLayerPositions[i],
-                    PC.Y() + V2d.Y()*myLayerPositions[i] );
-      Pnts2d2.Append(P2d);
+    if ( linEdge2Computed )
+    {
+      if (!GetSortedNodesOnEdge(aMesh.GetMeshDS(),LinEdge2,true,theNodes))
+        return error("Invalid mesh on a straight edge");
+
+      bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL );
+      int i = 0, ir = Nodes1.size()-1;
+      int * pi = nodesFromP0ToP2 ? &i : &ir;
+      itn = theNodes.begin();
+      if ( nodesFromP0ToP2 ) ++itn;
+      for ( ; i < Nodes2.size(); ++i, --ir, ++itn )
+        Nodes2[*pi] = itn->second;
     }
-    Nodes2[ myLayerPositions.size() ] = NL;
-    // create 1D elements on edge
-    ME = myHelper->AddEdge( NC, Nodes2[0] );
-    if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
-    for(i=1; i<Nodes2.size(); i++) {
-      SMDS_MeshEdge* ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] );
+    else
+    {
+      int edgeID = meshDS->ShapeToIndex(LinEdge2);
+      gp_Vec aVec = gp_Vec(P0,P2);
+      // check orientation
+      Handle(Geom_Curve) Crv = BRep_Tool::Curve(LinEdge2,fp,lp);
+      gp_Pnt Ptmp = Crv->Value(fp);
+      bool ori = false;
+      if( P2.Distance(Ptmp) > Precision::Confusion() )
+        ori = true;
+      // get UV points for edge
+      gp_Pnt2d PF,PL;
+      BRep_Tool::UVPoints( LinEdge2, TopoDS::Face(aShape), PF, PL );
+      gp_Vec2d V2d;
+      if(ori) {
+        V2d = gp_Vec2d(PF,PL);
+        PC = PF;
+      }
+      else {
+        V2d = gp_Vec2d(PL,PF);
+        PC = PL;
+      }
+      double dp = lp-fp;
+      for(int i=0; i<myLayerPositions.size(); i++) {
+        gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
+                  P0.Y() + aVec.Y()*myLayerPositions[i],
+                  P0.Z() + aVec.Z()*myLayerPositions[i] );
+        SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
+        Nodes2[i] = node;
+        double param;
+        if(!ori)
+          param = fp + dp*(1-myLayerPositions[i]);
+        else
+          param = fp + dp*myLayerPositions[i];
+        meshDS->SetNodeOnEdge(node, edgeID, param);
+        // parameters on face
+        gp_Pnt2d P2d( PC.X() + V2d.X()*myLayerPositions[i],
+                      PC.Y() + V2d.Y()*myLayerPositions[i] );
+      }
+      Nodes2[ myLayerPositions.size() ] = NL;
+      // create 1D elements on edge
+      SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes2[0] );
       if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
+      for(int i=1; i<Nodes2.size(); i++) {
+        ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] );
+        if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
+      }
     }
+    markLinEdgeAsComputedByMe( LinEdge2, aMesh.GetSubMesh( F ));
   }
 
+  // orientation
+  bool IsForward = ( CircEdge.Orientation()==TopAbs_FORWARD );
+
   // create nodes and mesh elements on face
   // find axis of rotation
   gp_Pnt P2 = gp_Pnt( CNodes[1]->X(), CNodes[1]->Y(), CNodes[1]->Z() );
@@ -658,7 +782,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
   //cout<<"Angles.Length() = "<<Angles.Length()<<"   Points.Length() = "<<Points.Length()<<endl;
   //cout<<"Nodes1.size() = "<<Nodes1.size()<<"   Pnts2d1.Length() = "<<Pnts2d1.Length()<<endl;
   for(; i<Angles.Length(); i++) {
-    std::vector< const SMDS_MeshNode* > tmpNodes;
+    vector< const SMDS_MeshNode* > tmpNodes;
     tmpNodes.reserve(Nodes1.size());
     gp_Trsf aTrsf;
     gp_Ax1 theAxis(P0,gp_Dir(Axis));
@@ -683,12 +807,21 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
     tmpNodes[Points.Length()] = CNodes[i];
     // quad
     for(j=0; j<Nodes1.size()-1; j++) {
-      SMDS_MeshFace* MF = myHelper->AddFace( tmpNodes[j], Nodes1[j],
-                                             Nodes1[j+1], tmpNodes[j+1] );
+      SMDS_MeshFace* MF;
+      if(IsForward)
+        MF = myHelper->AddFace( tmpNodes[j], Nodes1[j],
+                                Nodes1[j+1], tmpNodes[j+1] );
+      else
+        MF = myHelper->AddFace( tmpNodes[j], tmpNodes[j+1],
+                                Nodes1[j+1], Nodes1[j] );
       if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
     }
     // tria
-    SMDS_MeshFace* MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] );
+    SMDS_MeshFace* MF;
+    if(IsForward)
+      MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] );
+    else
+      MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] );
     if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
     for(j=0; j<Nodes1.size(); j++) {
       Nodes1[j] = tmpNodes[j];
@@ -697,18 +830,23 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
   // create last faces
   // quad
   for(i=0; i<Nodes1.size()-1; i++) {
-    SMDS_MeshFace* MF = myHelper->AddFace( Nodes2[i], Nodes1[i],
-                                           Nodes1[i+1], Nodes2[i+1] );
+    SMDS_MeshFace* MF;
+    if(IsForward)
+      MF = myHelper->AddFace( Nodes2[i], Nodes1[i],
+                              Nodes1[i+1], Nodes2[i+1] );
+    else
+      MF = myHelper->AddFace( Nodes2[i],  Nodes2[i+1],
+                              Nodes1[i+1], Nodes1[i] );
     if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
   }
   // tria
-  SMDS_MeshFace* MF = myHelper->AddFace( NC, Nodes1[0], Nodes2[0] );
+  SMDS_MeshFace* MF;
+  if(IsForward)
+    MF = myHelper->AddFace( NC, Nodes1[0], Nodes2[0] );
+  else
+    MF = myHelper->AddFace( NC, Nodes2[0], Nodes1[0] );
   if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
 
-
-  // to delete helper at exit from Compute()
-  std::auto_ptr<SMESH_MesherHelper> helperDeleter( myHelper );
-
   return true;
 }
 
@@ -871,7 +1009,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
       if(ok) {
         SMESH_subMesh * sm = aMesh.GetSubMesh(CircEdge);
         MapShapeNbElemsItr anIt = aResMap.find(sm);
-        std::vector<int> aVec = (*anIt).second;
+        vector<int> aVec = (*anIt).second;
         isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
         if(isQuadratic) {
           // main nodes
@@ -932,7 +1070,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
     if(ok) {
       SMESH_subMesh * sm = aMesh.GetSubMesh(CircEdge);
       MapShapeNbElemsItr anIt = aResMap.find(sm);
-      std::vector<int> aVec = (*anIt).second;
+      vector<int> aVec = (*anIt).second;
       isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
       if(isQuadratic) {
         // main nodes
@@ -948,7 +1086,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
       nb2d_tria = aVec[SMDSEntity_Node] + 1;
       nb2d_quad = nb2d_tria * myLayerPositions.size();
       // add evaluation for edges
-      std::vector<int> aResVec(SMDSEntity_Last);
+      vector<int> aResVec(SMDSEntity_Last);
       for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
       if(isQuadratic) {
         aResVec[SMDSEntity_Node] = 4*myLayerPositions.size() + 3;
@@ -959,7 +1097,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
         aResVec[SMDSEntity_Edge] = 2*myLayerPositions.size() + 2;
       }
       sm = aMesh.GetSubMesh(LinEdge1);
-      aResMap.insert(std::make_pair(sm,aResVec));
+      aResMap.insert(make_pair(sm,aResVec));
     }
   }
   else { // nbe==3
@@ -1025,7 +1163,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
     if(ok) {
       SMESH_subMesh * sm = aMesh.GetSubMesh(CircEdge);
       MapShapeNbElemsItr anIt = aResMap.find(sm);
-      std::vector<int> aVec = (*anIt).second;
+      vector<int> aVec = (*anIt).second;
       isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
       if(isQuadratic) {
         // main nodes
@@ -1041,7 +1179,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
       nb2d_tria = aVec[SMDSEntity_Node] + 1;
       nb2d_quad = nb2d_tria * myLayerPositions.size();
       // add evaluation for edges
-      std::vector<int> aResVec(SMDSEntity_Last);
+      vector<int> aResVec(SMDSEntity_Last);
       for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
       if(isQuadratic) {
         aResVec[SMDSEntity_Node] = 2*myLayerPositions.size() + 1;
@@ -1052,13 +1190,13 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
         aResVec[SMDSEntity_Edge] = myLayerPositions.size() + 1;
       }
       sm = aMesh.GetSubMesh(LinEdge1);
-      aResMap.insert(std::make_pair(sm,aResVec));
+      aResMap.insert(make_pair(sm,aResVec));
       sm = aMesh.GetSubMesh(LinEdge2);
-      aResMap.insert(std::make_pair(sm,aResVec));
+      aResMap.insert(make_pair(sm,aResVec));
     }
   }
 
-  std::vector<int> aResVec(SMDSEntity_Last);
+  vector<int> aResVec(SMDSEntity_Last);
   for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
   SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
 
@@ -1073,12 +1211,12 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
       aResVec[SMDSEntity_Triangle] = nb2d_tria;
       aResVec[SMDSEntity_Quadrangle] = nb2d_quad;
     }
-    aResMap.insert(std::make_pair(sm,aResVec));
+    aResMap.insert(make_pair(sm,aResVec));
     return true;
   }
 
   // invalid case
-  aResMap.insert(std::make_pair(sm,aResVec));
+  aResMap.insert(make_pair(sm,aResVec));
   SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
   smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
                                         "Submesh can not be evaluated",this));
index 07d6b8a752247b1cecd00c439bf3739181fab636..10a1203651e6e5fc318177d0513cc0520587df73 100644 (file)
@@ -53,7 +53,14 @@ public:
 
   virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
                         MapShapeNbElems& aResMap);
-
+  /*!
+   * \brief Allow algo to do something after persistent restoration
+    * \param subMesh - restored submesh
+   *
+   * This method is called only if a submesh has HYP_OK algo_state.
+   */
+  virtual void SubmeshRestored(SMESH_subMesh* subMesh);
+  
 protected:
 
   bool computeLayerPositions(const gp_Pnt& pIn,
index 8e50b059ba88c416dbc24ed7be91199d7e6b5f79..c3e86a98d8607b1622cb8cf38d71790c07e38aa5 100644 (file)
@@ -63,6 +63,7 @@
 #include <TopoDS_Edge.hxx>
 
 #include <string>
+#include <limits>
 
 using namespace std;
 
@@ -757,7 +758,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
     double an = _value[ END_LENGTH_IND ];
 
     double  q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 );
-    int     n = int( 1 + ( an - a1 ) / q );
+    int n = int(fabs(q) > numeric_limits<double>::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 ));
 
     double U1 = theReverse ? l : f;
     double Un = theReverse ? f : l;
@@ -1032,7 +1033,7 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh,
   if ( _hypType == NONE )
     return false;
 
-  SMESHDS_Mesh * meshDS = theMesh.GetMeshDS();
+  //SMESHDS_Mesh * meshDS = theMesh.GetMeshDS();
 
   const TopoDS_Edge & EE = TopoDS::Edge(theShape);
   TopoDS_Edge E = TopoDS::Edge(EE.Oriented(TopAbs_FORWARD));
index fbc244b0f8a70f3bbe2f4ef2851f8a6c7ced2ca4..e8a1947716c6efc147f04e5d2beb131a059f083b 100644 (file)
@@ -96,8 +96,7 @@ libStdMeshersGUI_la_LDFLAGS  = \
        ../SMESHGUI/libSMESH.la \
        ../OBJECT/libSMESHObject.la \
        $(GUI_LDFLAGS) -lSalomeApp \
-       $(CAS_LDPATH) -lTKernel -lTKBO -lTKAdvTools \
-       $(QWT_LIBS)
+       $(CAS_LDPATH) -lTKernel -lTKBO -lTKAdvTools
 
 # resources files
 nodist_salomeres_DATA= \
index ead8d1c3d72d7dea4eed6032a2de6896501cfebe..e26ffd7e18bbd40e2c5e753c0a0e47734e69bf88 100644 (file)
@@ -50,6 +50,8 @@
 # include <algorithm>
 #endif
 
+#include <Basics_Utils.hxx>
+
 StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
 : QwtPlot( p ),
   myPoints( 50 ),
@@ -60,6 +62,7 @@ StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::
   myIsDone( true ),
   myNbSeg( 1 )
 {
+  Kernel_Utils::Localizer loc;
   myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
   myVars.ChangeValue( 1 ) = new Expr_NamedUnknown( "t" );
   myDensity = new QwtPlotCurve( QString() );
@@ -200,6 +203,7 @@ bool StdMeshersGUI_DistrPreview::createTable( SMESH::double_array& func )
 
 void StdMeshersGUI_DistrPreview::update()
 {
+  Kernel_Utils::Localizer loc;
   SMESH::double_array graph, distr;
   if( isTableFunc() )
   {
@@ -343,6 +347,7 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
 
 bool StdMeshersGUI_DistrPreview::init( const QString& str )
 {
+  Kernel_Utils::Localizer loc;
   bool parsed_ok = true;
   try {
 #ifdef NO_CAS_CATCH
index 51685c37054b55dfdfbf477cceabdfc7c6979de8..c5c228bc74bc7f7e733c2e4eb2c024128d35ca0e 100644 (file)
@@ -25,6 +25,9 @@
 //
 #include "StdMeshersGUI_FixedPointsParamWdg.h"
 
+#include <QtxIntSpinBox.h>
+#include <QtxDoubleSpinBox.h>
+
 // Qt includes
 #include <QPushButton>
 #include <QIntValidator>
@@ -36,7 +39,6 @@
 #include <QTreeWidgetItem>
 #include <QCheckBox>
 #include <QLineEdit>
-#include <QDoubleSpinBox>
 #include <QItemDelegate>
 #include <QKeyEvent>
 
 #define MARGIN 0
 #define SAME_TEXT "-/-"
 
+#define TOLERANCE 1e-7
+#define EQUAL_DBL(a,b) (fabs(a-b)<TOLERANCE)
+#define LT_DBL(a,b) ((a<b)&&!EQUAL_DBL(a,b))
+#define GT_DBL(a,b) ((a>b)&&!EQUAL_DBL(a,b))
+
 /*
- * function : Tree Widget Item Delegate
+ * class : Tree Widget Item Delegate
  * purpose  : Custom item delegate
  */
 
@@ -74,7 +81,7 @@ QWidget* StdMeshersGUI_FixedPointsParamWdg::LineDelegate::createEditor( QWidget*
 {
   QWidget* w = 0;
   if ( (index.column() == 1 ) ) {
-    QSpinBox* sb = new QSpinBox( parent );
+    QtxIntSpinBox* sb = new QtxIntSpinBox( parent );
     sb->setFrame( false );
     sb->setRange( 1, 999);
     w = sb;
@@ -87,8 +94,8 @@ void StdMeshersGUI_FixedPointsParamWdg::LineDelegate::setModelData( QWidget* edi
                                                                    QAbstractItemModel* model, 
                                                                    const QModelIndex& index ) const
 {
-  model->setData( index, qobject_cast<QSpinBox*>( editor )->value(), Qt::EditRole );
-  model->setData( index, qobject_cast<QSpinBox*>( editor )->value(), Qt::UserRole );
+  model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::EditRole );
+  model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::UserRole );
 }
 
 //================================================================================
@@ -107,7 +114,7 @@ StdMeshersGUI_FixedPointsParamWdg
   
   myListWidget   = new QListWidget( this );
   myTreeWidget   = new QTreeWidget( this );
-  mySpinBox      = new QDoubleSpinBox( this );
+  mySpinBox      = new QtxDoubleSpinBox( this );
   myAddButton    = new QPushButton( tr( "SMESH_BUT_ADD" ),    this );
   myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );      
   mySameValues   = new QCheckBox( tr("SMESH_SAME_NB_SEGMENTS"), this);
@@ -136,10 +143,15 @@ StdMeshersGUI_FixedPointsParamWdg
 
   mySpinBox->setRange( 0, 1 );
   mySpinBox->setSingleStep( 0.1 );
-
-  connect( myAddButton,    SIGNAL(clicked()), SLOT(onAdd()));
-  connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
-  connect( mySameValues,   SIGNAL(stateChanged(int)), SLOT(onCheckBoxChanged()));
+  mySpinBox->setDecimals( 4 );
+  mySpinBox->setPrecision( 4 );
+  myListWidget->setMinimumWidth( 70 );
+
+  connect( myAddButton,    SIGNAL( clicked() ),              SLOT( onAdd() ) );
+  connect( myRemoveButton, SIGNAL( clicked() ),              SLOT( onRemove() ) );
+  connect( mySameValues,   SIGNAL( stateChanged( int ) ),    SLOT( onCheckBoxChanged() ) );
+  connect( mySpinBox,      SIGNAL( valueChanged( double ) ), SLOT( updateState() ) );
+  connect( myListWidget,   SIGNAL( itemSelectionChanged() ), SLOT( updateState() ) );
   myListWidget->installEventFilter( this );
 
   clear();
@@ -182,6 +194,7 @@ void StdMeshersGUI_FixedPointsParamWdg::clear()
   myTreeWidget->addTopLevelItem( newTreeItem( 0, 1 ) );
   mySpinBox->setValue( 0. );
   onCheckBoxChanged();
+  updateState();
 }
 
 //=================================================================================
@@ -244,13 +257,13 @@ QString StdMeshersGUI_FixedPointsParamWdg::treeItemText( double v1, double v2 )
 //=================================================================================
 void StdMeshersGUI_FixedPointsParamWdg::addPoint( double v)
 {
-  if ( v > 0 && v < 1) {
+  if ( GT_DBL(v, 0.0) && LT_DBL(v, 1.0)) {
     bool toInsert = true;
     int idx = myTreeWidget->topLevelItemCount()-1;
     for ( int i = 0 ; i < myListWidget->count(); i++ ) {
       double lv = point( i );
-      if ( lv == v ) { toInsert = false; break; }
-      else if ( lv > v ) {
+      if ( EQUAL_DBL(lv, v) ) { toInsert = false; break; }
+      else if ( GT_DBL(lv, v) ) {
        idx = i; break;
       }
     }
@@ -263,6 +276,7 @@ void StdMeshersGUI_FixedPointsParamWdg::addPoint( double v)
       onCheckBoxChanged();
     }
   }
+  updateState();
 }
 
 //=================================================================================
@@ -281,6 +295,7 @@ void StdMeshersGUI_FixedPointsParamWdg::removePoints()
                                                                 idx > myListWidget->count()-1 ? 1 : point( idx ) ) );
   }
   onCheckBoxChanged();
+  updateState();
 }
 
 double StdMeshersGUI_FixedPointsParamWdg::point( int idx ) const
@@ -314,6 +329,17 @@ void StdMeshersGUI_FixedPointsParamWdg::onCheckBoxChanged()
   }
 }
 
+//=================================================================================
+// function : updateState()
+// purpose  : Update widgets state
+//=================================================================================
+void StdMeshersGUI_FixedPointsParamWdg::updateState()
+{
+  double v = mySpinBox->value();
+  myAddButton->setEnabled( GT_DBL(v, 0.0) && LT_DBL(v, 1.0) );
+  myRemoveButton->setEnabled( myListWidget->selectedItems().count() > 0 );
+}
+
 //=================================================================================
 // function : GetListOfPoints
 // purpose  : Called to get the list of Edges IDs
@@ -325,7 +351,6 @@ SMESH::double_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfPoints()
   anArray->length( size );
   for (int i = 0; i < size; i++) {
     anArray[i] = point(i);
-    //    printf ("Point %f \n", anArray[i]);
   }
   return anArray;
 }
@@ -339,7 +364,6 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var
   clear();
   for ( int i = 0; i < thePoints->length(); i++ ) {
     addPoint( thePoints[ i ] );
-    //    printf ("Add Point %f \n", thePoints[ i ]);
   }
 }
 
@@ -354,7 +378,6 @@ SMESH::long_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments()
   anArray->length( size );
   for (int i = 0; i < size; i++) {
     anArray[i] = nbSegments( i );
-    //    printf ("Segments %d \n", anArray[i] );
   }
   return anArray;
 }
@@ -369,6 +392,5 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var
     mySameValues->setChecked(true);
   for ( int i = 0; i < theSegments->length(); i++ ) {
     setNbSegments( i, theSegments[i] );
-    //    printf ("\nadd Segment = %d\n", theSegments[i]);
   }
 }
index b96806de46216fb436c5110c8f986615fd54d980..273781d34aa85661e7d816d8a290a32bc372fd3e 100644 (file)
 #include <QStringList>
 
 class SMESHGUI;
+class QtxDoubleSpinBox;
 class QPushButton;
 class QLineEdit;
 class QCheckBox;
-class QDoubleSpinBox;
 class QListWidget;
 class QListWidgetItem;
 class QTreeWidget;
@@ -67,6 +67,7 @@ private slots:
   void                           onAdd(); 
   void                           onRemove(); 
   void                           onCheckBoxChanged();
+  void                           updateState();
 
 private:
   void                           clear();
@@ -83,7 +84,7 @@ private:
 private:
   QListWidget*                   myListWidget;
   QTreeWidget*                   myTreeWidget;
-  QDoubleSpinBox*                mySpinBox;
+  QtxDoubleSpinBox*              mySpinBox;
   QPushButton*                   myAddButton;
   QPushButton*                   myRemoveButton;
   QCheckBox*                     mySameValues;
index 93b3ca60a161b865b9f8463aa958a004a90638e9..2ee5473af34992aee5ac4cc34109832b0a7490d9 100644 (file)
@@ -197,14 +197,16 @@ QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
   row++;
 
   // 8) reverce edge parameters
-  myReversedEdgesBox = new QGroupBox(tr( "SMESH_REVERCE_EDGES" ), fr);
+  myReversedEdgesBox = new QGroupBox(tr( "SMESH_REVERSED_EDGES" ), fr);
   QHBoxLayout* edgeLay = new QHBoxLayout( myReversedEdgesBox );
 
   myDirectionWidget = new StdMeshersGUI_SubShapeSelectorWdg();
-  QString anEntry = getShapeEntry();
-  if ( anEntry == "" )
-    anEntry = h->GetObjectEntry();
-  myDirectionWidget->SetMainShapeEntry( anEntry );
+  QString aGeomEntry = getShapeEntry();
+  QString aMainEntry = getMainShapeEntry();
+  if ( aGeomEntry == "" )
+    aGeomEntry = h->GetObjectEntry();
+  myDirectionWidget->SetGeomShapeEntry( aGeomEntry );
+  myDirectionWidget->SetMainShapeEntry( aMainEntry );
   myDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
   edgeLay->addWidget( myDirectionWidget );
 
@@ -377,7 +379,7 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
     //the function will be checked with old conversion mode, so that it may occurs
     //unexpected errors for user
 
-    h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+    h->SetParameters(aVariablesList.join(":").toLatin1().constData());
   }
   catch(const SALOME::SALOME_Exception& ex)
   {
index 35231586df87fcede0dcdf3d1adc19ea7065e77b..0d72900dcb875cbf6ecfc46cd1fd23039d8a8d01 100644 (file)
@@ -384,6 +384,12 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
       widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
     ok = ( w && w->IsOk() );
   }
+  else if ( hypType() == "QuadrangleParams" )
+  {
+    StdMeshersGUI_SubShapeSelectorWdg* w = 
+      widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 );
+    ok = ( w->GetListSize() > 0 );
+  }
   return ok;
 }
 
@@ -415,9 +421,9 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         StdMeshers::StdMeshers_LocalLength::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       h->SetPrecision( params[1].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
     }
     else if( hypType()=="MaxLength" )
     {
@@ -425,7 +431,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         StdMeshers::StdMeshers_MaxLength::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       h->SetUsePreestimatedLength( widget< QCheckBox >( 1 )->isChecked() );
       if ( !h->HavePreestimatedLength() && !h->_is_equivalent( initParamsHypothesis() )) {
         StdMeshers::StdMeshers_MaxLength_var hInit =
@@ -439,7 +445,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
     }
     else if( hypType()=="Arithmetic1D" )
     {
@@ -450,13 +456,12 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
 
       h->SetStartLength( params[0].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       h->SetEndLength( params[1].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       if (w) {
         h->SetReversedEdges( w->GetListOfIDs() );
-        const char * entry = w->GetMainShapeEntry();
-        h->SetObjectEntry( entry );
+        h->SetObjectEntry( w->GetMainShapeEntry() );
       }
     }
     else if( hypType()=="FixedPoints1D" )
@@ -471,21 +476,20 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         widget< StdMeshersGUI_SubShapeSelectorWdg >( 1 );
 
       if (w1) {
-        h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+        h->SetParameters(aVariablesList.join(":").toLatin1().constData());
         h->SetPoints( w1->GetListOfPoints() );
         h->SetNbSegments( w1->GetListOfSegments() );
       }
       if (w2) {
         h->SetReversedEdges( w2->GetListOfIDs() );
-        const char * entry = w2->GetMainShapeEntry();
-        h->SetObjectEntry( entry );
+        h->SetObjectEntry( w2->GetMainShapeEntry() );
       }
     }
     else if( hypType()=="MaxElementArea" )
     {
       StdMeshers::StdMeshers_MaxElementArea_var h =
         StdMeshers::StdMeshers_MaxElementArea::_narrow( hypothesis() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       h->SetMaxElementArea( params[0].myValue.toDouble() );
     }
     else if( hypType()=="MaxElementVolume" )
@@ -494,7 +498,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() );
 
       h->SetMaxElementVolume( params[0].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
     }
     else if( hypType()=="StartEndLength" )
     {
@@ -505,9 +509,9 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
 
       h->SetStartLength( params[0].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       h->SetEndLength( params[1].myValue.toDouble() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       if (w) {
         h->SetReversedEdges( w->GetListOfIDs() );
         h->SetObjectEntry( w->GetMainShapeEntry() );
@@ -517,7 +521,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
     {
       StdMeshers::StdMeshers_Deflection1D_var h =
         StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
       h->SetDeflection( params[0].myValue.toDouble() );
     }
     else if( hypType()=="AutomaticLength" )
@@ -533,7 +537,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         StdMeshers::StdMeshers_NumberOfLayers::_narrow( hypothesis() );
 
       h->SetNumberOfLayers( params[0].myValue.toInt() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
     }
     else if( hypType()=="LayerDistribution" )
     {
@@ -552,7 +556,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
         StdMeshers::StdMeshers_NumberOfLayers2D::_narrow( hypothesis() );
 
       h->SetNumberOfLayers( params[0].myValue.toInt() );
-      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      h->SetParameters(aVariablesList.join(":").toLatin1().constData());
     }
     else if( hypType()=="LayerDistribution2D" )
     {
@@ -606,11 +610,11 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
       StdMeshersGUI_SubShapeSelectorWdg* w = 
         widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 );
       if (w) {
-        if( w->GetListOfIDs()->length()>0 ) {
-          h->SetTriaVertex( w->GetListOfIDs()[0] );
+        if( w->GetListSize() > 0 ) {
+          h->SetTriaVertex( w->GetListOfIDs()[0] ); // getlist must be called once
+          const char * entry = w->GetMainShapeEntry();
+          h->SetObjectEntry( entry );
         }
-        const char * entry = w->GetMainShapeEntry();
-        h->SetObjectEntry( entry );
       }
     }
   }
@@ -736,10 +740,13 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
 
     StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
       new StdMeshersGUI_SubShapeSelectorWdg();
-    QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
-    if ( anEntry == "" )
-      anEntry = h->GetObjectEntry();
-    aDirectionWidget->SetMainShapeEntry( anEntry );
+    QString aGeomEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+    if ( aGeomEntry == "" )
+      aGeomEntry = h->GetObjectEntry();
+
+    aDirectionWidget->SetGeomShapeEntry( aGeomEntry );
+    aDirectionWidget->SetMainShapeEntry( aMainEntry );
     aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
     aDirectionWidget->showPreview( true );
     customWidgets()->append ( aDirectionWidget );
@@ -769,9 +776,11 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
       new StdMeshersGUI_SubShapeSelectorWdg();
     QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
     if ( anEntry == "" )
       anEntry = h->GetObjectEntry();
-    aDirectionWidget->SetMainShapeEntry( anEntry );
+    aDirectionWidget->SetGeomShapeEntry( anEntry );
+    aDirectionWidget->SetMainShapeEntry( aMainEntry );
     aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
     aDirectionWidget->showPreview( true );
     customWidgets()->append ( aDirectionWidget );
@@ -823,11 +832,12 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
       new StdMeshersGUI_SubShapeSelectorWdg();
     QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
     if ( anEntry == "" )
       anEntry = h->GetObjectEntry();
-    aDirectionWidget->SetMainShapeEntry( anEntry );
+    aDirectionWidget->SetGeomShapeEntry( anEntry );
+    aDirectionWidget->SetMainShapeEntry( aMainEntry );
     aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
-    aDirectionWidget->SetMainShapeEntry( h->GetObjectEntry() );
     aDirectionWidget->showPreview( true );
     customWidgets()->append ( aDirectionWidget );
   }
@@ -874,7 +884,7 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       aLastVarsList.append(QString(aParameters[i].in()));
 
     if(!aLastVarsList.isEmpty())
-      h->GetLayerDistribution()->SetLastParameters(SMESHGUI::JoinObjectParameters(aLastVarsList));
+      h->GetLayerDistribution()->SetLastParameters(aLastVarsList.join(":").toLatin1().constData());
     
     customWidgets()->append
       ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));
@@ -900,7 +910,7 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       aLastVarsList.append(QString(aParameters[i].in()));
 
     if(!aLastVarsList.isEmpty())
-      h->GetLayerDistribution()->SetLastParameters(SMESHGUI::JoinObjectParameters(aLastVarsList));
+      h->GetLayerDistribution()->SetLastParameters(aLastVarsList.join(":").toLatin1().constData());
     
     customWidgets()->append
       ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));
@@ -984,9 +994,11 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     aDirectionWidget->SetMaxSize(1);
     aDirectionWidget->SetSubShType(TopAbs_VERTEX);
     QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
     if ( anEntry == "" )
       anEntry = h->GetObjectEntry();
-    aDirectionWidget->SetMainShapeEntry( anEntry );
+    aDirectionWidget->SetGeomShapeEntry( anEntry );
+    aDirectionWidget->SetMainShapeEntry( aMainEntry );
     SMESH::long_array_var aVec = new SMESH::long_array;
     int vertID = h->GetTriaVertex();
     if(vertID>0) {
@@ -1116,7 +1128,7 @@ QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) cons
     types.insert( "ProjectionSource3D", "PROJECTION_SOURCE_3D" );
     types.insert( "NumberOfLayers", "NUMBER_OF_LAYERS" );
     types.insert( "LayerDistribution", "LAYER_DISTRIBUTION" );
-    types.insert( "NumberOfLayers2D", "NUMBER_OF_LAYERS" );
+    types.insert( "NumberOfLayers2D", "NUMBER_OF_LAYERS_2D" );
     types.insert( "LayerDistribution2D", "LAYER_DISTRIBUTION" );
     types.insert( "SegmentLengthAroundVertex", "SEGMENT_LENGTH_AROUND_VERTEX" );
     types.insert( "MaxLength", "MAX_LENGTH" );
index 0d0a79ca0b3cad675acd49567ed93ea1e71b4d0b..65b99514eb16932813be6ffc1e6a08a158ae94ab 100644 (file)
@@ -23,6 +23,7 @@
 // Author : Open CASCADE S.A.S. (dmv)
 // SMESH includes
 //
+
 #include "StdMeshersGUI_SubShapeSelectorWdg.h"
 
 // SMESH Includes
@@ -81,7 +82,8 @@
 StdMeshersGUI_SubShapeSelectorWdg
 ::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent ): 
   QWidget( parent ),
-  myPreviewActor( 0 )
+  myPreviewActor( 0 ),
+  myMaxSize( 0 )
 {
   QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
 
@@ -104,7 +106,6 @@ StdMeshersGUI_SubShapeSelectorWdg
   setLayout( edgesLayout );
   setMinimumWidth( 300 );
 
-  myMaxSize = 1000;
   mySubShType = TopAbs_EDGE;
 
   init();
@@ -141,6 +142,7 @@ StdMeshersGUI_SubShapeSelectorWdg::~StdMeshersGUI_SubShapeSelectorWdg()
 void StdMeshersGUI_SubShapeSelectorWdg::init()
 {
   myParamValue = "";
+  myIsNotCorrected = true; // to dont call the GetCorrectedValue method twice
   myListOfIDs.clear();
   mySelectedIDs.clear();
 
@@ -268,7 +270,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
     return;
 
   myListWidget->blockSignals( true );
-  for (int i = 0; i < mySelectedIDs.size(); i++) {
+  for (int i = 0; i < mySelectedIDs.size() && (myMaxSize < 1 || myListOfIDs.size() < myMaxSize); i++) {
     if ( myListOfIDs.indexOf( mySelectedIDs.at(i) ) == -1 ) {
       QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
 
@@ -279,11 +281,8 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
     }
   }
   onListSelectionChanged();
-
   myListWidget->blockSignals( false );
-
-  if( myListOfIDs.size() >= myMaxSize )
-    myAddButton->setEnabled( false );
+  myAddButton->setEnabled( myListOfIDs.size() < myMaxSize );
 }
         
 //=================================================================================
@@ -334,13 +333,14 @@ void StdMeshersGUI_SubShapeSelectorWdg::onListSelectionChanged()
 // function : setGeomShape
 // purpose  : Called to set geometry
 //================================================================================
-void StdMeshersGUI_SubShapeSelectorWdg::SetMainShapeEntry( const QString& theEntry )
+void StdMeshersGUI_SubShapeSelectorWdg::SetGeomShapeEntry( const QString& theEntry )
 {
   if ( theEntry != "") {
     myParamValue = theEntry;
     myEntry = theEntry;
-    myMainShape = GetTopoDSByEntry( theEntry );
+    myGeomShape = GetTopoDSByEntry( theEntry );
     updateState();
+    myIsNotCorrected = true;
   }
 }
 
@@ -351,7 +351,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::SetMainShapeEntry( const QString& theEnt
 void StdMeshersGUI_SubShapeSelectorWdg::updateState()
 {
   bool state = false;
-  if ( !myMainShape.IsNull() )
+  if ( !myGeomShape.IsNull() )
     state = true;
   
   myListWidget->setEnabled( state );
@@ -361,8 +361,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState()
   if (state) {
     myPreviewActor = new SMESH_PreviewActorsCollection();
     myPreviewActor->SetSelector( mySelector );
-    //myPreviewActor->Init( myMainShape, TopAbs_EDGE, myEntry );
-    myPreviewActor->Init( myMainShape, mySubShType, myEntry );
+    myPreviewActor->Init( myGeomShape, mySubShType, myEntry );
     myPreviewActor->SetShown( false );
     myIsShown = false;
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
@@ -414,6 +413,10 @@ TopoDS_Shape StdMeshersGUI_SubShapeSelectorWdg::GetTopoDSByEntry( const QString&
 SMESH::long_array_var StdMeshersGUI_SubShapeSelectorWdg::GetListOfIDs()
 {
   SMESH::long_array_var anArray = new SMESH::long_array;
+
+  if ( myMainEntry != "" && myIsNotCorrected )
+    myListOfIDs = GetCorrectedListOfIDs( true );
+
   int size = myListOfIDs.size();
   anArray->length( size );
   if ( size ) {
@@ -435,6 +438,67 @@ void StdMeshersGUI_SubShapeSelectorWdg::SetListOfIDs( SMESH::long_array_var theI
   int size = theIds->length();
   for ( int i = 0; i < size; i++ )
     mySelectedIDs.append( theIds[ i ] );
+
+  mySelectedIDs = GetCorrectedListOfIDs( false );
   onAdd();
 }
 
+//=================================================================================
+// function : SetMainShapeEntry
+// purpose  : Called to set the Main Object Entry
+//=================================================================================
+void StdMeshersGUI_SubShapeSelectorWdg::SetMainShapeEntry( const QString& theEntry )
+{
+  myMainEntry = theEntry;
+  myMainShape = GetTopoDSByEntry( theEntry );
+  myIsNotCorrected = true;
+}
+
+//=================================================================================
+// function : GetMainShapeEntry
+// purpose  : Called to get the Main Object Entry
+//=================================================================================
+const char* StdMeshersGUI_SubShapeSelectorWdg::GetMainShapeEntry()
+{
+  if ( myMainEntry == "")
+    return myEntry.toLatin1().data();
+
+  return myMainEntry.toLatin1().data();
+}
+
+//=================================================================================
+// function : GetCorrectedListOfIds
+// purpose  : Called to convert the list of IDs from subshape IDs to main shape IDs
+//=================================================================================
+QList<int> StdMeshersGUI_SubShapeSelectorWdg::GetCorrectedListOfIDs( bool fromSubshapeToMainshape )
+{
+  if ( ( myMainShape.IsNull() || myGeomShape.IsNull() ) &&  fromSubshapeToMainshape )
+    return myListOfIDs;
+  else   if ( ( myMainShape.IsNull() || myGeomShape.IsNull() ) &&  !fromSubshapeToMainshape )
+    return mySelectedIDs;
+
+  QList<int> aList;
+  TopTools_IndexedMapOfShape   aGeomMap;
+  TopTools_IndexedMapOfShape   aMainMap;
+  TopExp::MapShapes(myGeomShape, aGeomMap);
+  TopExp::MapShapes(myMainShape, aMainMap);
+
+  if ( fromSubshapeToMainshape ) { // convert indexes from subshape to mainshape
+    int size = myListOfIDs.size();
+    for (int i = 0; i < size; i++) {
+      TopoDS_Shape aSubShape = aGeomMap.FindKey( myListOfIDs.at(i) );
+      int index = aMainMap.FindIndex( aSubShape );
+      aList.append( index );
+    }
+    myIsNotCorrected = false;
+  } else { // convert indexes from main shape to subshape
+    int size = mySelectedIDs.size();
+    for (int i = 0; i < size; i++) {
+      TopoDS_Shape aSubShape = aMainMap.FindKey( mySelectedIDs.at(i) );
+      int index = aGeomMap.FindIndex( aSubShape );
+      aList.append( index );
+    }
+  }
+
+  return aList;
+}
index 6447516fba2406ef1d0ce95fb13369c944495499..49e49e82a4950ab672cbb4f42454c098cb4adb5e 100644 (file)
@@ -59,11 +59,17 @@ public:
   SMESH::long_array_var          GetListOfIDs();
   void                           SetListOfIDs( SMESH::long_array_var );
 
+  void                           SetGeomShapeEntry( const QString& theEntry );
+  const char*                    GetGeomShapeEntry() { return myEntry.toLatin1().data();}
+
   void                           SetMainShapeEntry( const QString& theEntry );
-  const char*                    GetMainShapeEntry() { return myEntry.toLatin1().data();}
+  const char*                    GetMainShapeEntry();
 
+  TopoDS_Shape                   GetGeomShape() { return myGeomShape; }
   TopoDS_Shape                   GetMainShape() { return myMainShape; }
 
+  QList<int>                     GetCorrectedListOfIDs( bool fromSubshapeToMainshape = true );
+
   static GEOM::GEOM_Object_var   GetGeomObjectByEntry( const QString& );
   static TopoDS_Shape            GetTopoDSByEntry( const QString& );
 
@@ -71,6 +77,8 @@ public:
 
   void                           showPreview ( bool );
 
+  int                            GetListSize() { return myListOfIDs.size(); }
+
   void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
   void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
 
@@ -91,8 +99,10 @@ private:
   LightApp_SelectionMgr*         mySelectionMgr;          /* User shape selection */
   SVTK_Selector*                 mySelector;
   SMESH::SMESH_Mesh_var          myMesh;
+  TopoDS_Shape                   myGeomShape;
   TopoDS_Shape                   myMainShape;
   QString                        myEntry;
+  QString                        myMainEntry;
   vtkRenderer*                   myRenderer;
   
   QListWidget*                   myListWidget;
@@ -103,6 +113,7 @@ private:
   
   QString                        myParamValue;
   bool                           myIsShown;
+  bool                           myIsNotCorrected;
 
   // for manage possible size of myListOfIDs
   int                            myMaxSize;
index 7dc80991b716b25fd65bc4ef17641bda5ab404a2..7438aa85e39e92a6b67324a1febdcd35a00b9e0a 100644 (file)
             <source>ICON_DLG_NUMBER_OF_LAYERS</source>
             <translation>mesh_hypo_layer_distribution.png</translation>
         </message>
+       <message>
+            <source>ICON_DLG_NUMBER_OF_LAYERS_2D</source>
+            <translation>mesh_hypo_layer_distribution.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_PROJECTION_SOURCE_1D</source>
             <translation>mesh_hypo_source_edge.png</translation>
index caabb7f5436ead43d870bb8e16ad9de54f992527..0a8ca42f4bf603edd02965203d5b8042e5af340f 100644 (file)
             <source>SMESH_NUMBER_OF_LAYERS_HYPOTHESIS</source>
             <translation>Radial Prism Parameter</translation>
         </message>
+       <message>
+            <source>SMESH_NUMBER_OF_LAYERS_2D_HYPOTHESIS</source>
+            <translation>Radial Quadrangle Parameter</translation>
+        </message>
         <message>
             <source>SMESH_NUMBER_OF_LAYERS_TITLE</source>
             <translation>Hypothesis Construction</translation>
         </message>
+       <message>
+            <source>SMESH_NUMBER_OF_LAYERS_2D_TITLE</source>
+            <translation>Hypothesis Construction</translation>
+        </message>
         <message>
             <source>SMESH_PROJECTION_SOURCE_1D_HYPOTHESIS</source>
             <translation>Projection Source 1D</translation>