Salome HOME
Merge Python 3 porting.
authorrnv <rnv@opencascade.com>
Thu, 22 Jun 2017 15:09:29 +0000 (18:09 +0300)
committerrnv <rnv@opencascade.com>
Tue, 27 Jun 2017 16:23:43 +0000 (19:23 +0300)
537 files changed:
CMakeLists.txt
doc/salome/examples/3dmesh.py
doc/salome/examples/CMakeLists.txt
doc/salome/examples/CTestTestfileInstall.cmake
doc/salome/examples/a3DmeshOnModified2Dmesh.py
doc/salome/examples/cartesian_algo.py
doc/salome/examples/creating_meshes_ex01.py
doc/salome/examples/creating_meshes_ex02.py
doc/salome/examples/creating_meshes_ex03.py
doc/salome/examples/creating_meshes_ex04.py
doc/salome/examples/creating_meshes_ex05.py
doc/salome/examples/creating_meshes_ex06.py
doc/salome/examples/creating_meshes_ex07.py
doc/salome/examples/creating_meshes_ex08.py
doc/salome/examples/defining_hypotheses_adaptive1d.py
doc/salome/examples/defining_hypotheses_ex01.py
doc/salome/examples/defining_hypotheses_ex02.py
doc/salome/examples/defining_hypotheses_ex03.py
doc/salome/examples/defining_hypotheses_ex04.py
doc/salome/examples/defining_hypotheses_ex05.py
doc/salome/examples/defining_hypotheses_ex06.py
doc/salome/examples/defining_hypotheses_ex07.py
doc/salome/examples/defining_hypotheses_ex08.py
doc/salome/examples/defining_hypotheses_ex09.py
doc/salome/examples/defining_hypotheses_ex10.py
doc/salome/examples/defining_hypotheses_ex11.py
doc/salome/examples/defining_hypotheses_ex12.py
doc/salome/examples/defining_hypotheses_ex13.py
doc/salome/examples/defining_hypotheses_ex14.py
doc/salome/examples/defining_hypotheses_ex15.py
doc/salome/examples/defining_hypotheses_ex16.py
doc/salome/examples/defining_hypotheses_ex17.py
doc/salome/examples/filters_ex09.py
doc/salome/examples/filters_ex10.py
doc/salome/examples/filters_ex16.py
doc/salome/examples/filters_ex17.py
doc/salome/examples/filters_ex18.py
doc/salome/examples/filters_ex39.py
doc/salome/examples/generate_flat_elements.py
doc/salome/examples/grouping_elements_ex01.py
doc/salome/examples/grouping_elements_ex02.py
doc/salome/examples/grouping_elements_ex03.py
doc/salome/examples/grouping_elements_ex04.py
doc/salome/examples/grouping_elements_ex05.py
doc/salome/examples/grouping_elements_ex06.py
doc/salome/examples/grouping_elements_ex07.py
doc/salome/examples/grouping_elements_ex08.py
doc/salome/examples/measurements_ex01.py
doc/salome/examples/measurements_ex02.py
doc/salome/examples/measurements_ex03.py
doc/salome/examples/modifying_meshes_ex01.py
doc/salome/examples/modifying_meshes_ex02.py
doc/salome/examples/modifying_meshes_ex03.py
doc/salome/examples/modifying_meshes_ex09.py
doc/salome/examples/modifying_meshes_ex10.py
doc/salome/examples/modifying_meshes_ex15.py
doc/salome/examples/modifying_meshes_ex16.py
doc/salome/examples/modifying_meshes_ex17.py
doc/salome/examples/modifying_meshes_ex18.py
doc/salome/examples/modifying_meshes_ex19.py
doc/salome/examples/modifying_meshes_ex21.py
doc/salome/examples/modifying_meshes_ex22.py
doc/salome/examples/modifying_meshes_ex23.py
doc/salome/examples/modifying_meshes_ex25.py
doc/salome/examples/modifying_meshes_ex26.py
doc/salome/examples/notebook_smesh.py
doc/salome/examples/prism_3d_algo.py
doc/salome/examples/quality_controls_ex01.py
doc/salome/examples/quality_controls_ex02.py
doc/salome/examples/quality_controls_ex03.py
doc/salome/examples/quality_controls_ex04.py
doc/salome/examples/quality_controls_ex05.py
doc/salome/examples/quality_controls_ex06.py
doc/salome/examples/quality_controls_ex07.py
doc/salome/examples/quality_controls_ex08.py
doc/salome/examples/quality_controls_ex09.py
doc/salome/examples/quality_controls_ex10.py
doc/salome/examples/quality_controls_ex11.py
doc/salome/examples/quality_controls_ex12.py
doc/salome/examples/quality_controls_ex13.py
doc/salome/examples/quality_controls_ex14.py
doc/salome/examples/quality_controls_ex15.py
doc/salome/examples/quality_controls_ex16.py
doc/salome/examples/quality_controls_ex17.py
doc/salome/examples/quality_controls_ex18.py
doc/salome/examples/quality_controls_ex19.py
doc/salome/examples/quality_controls_ex20.py
doc/salome/examples/quality_controls_ex21.py
doc/salome/examples/quality_controls_ex22.py
doc/salome/examples/split_biquad.py
doc/salome/examples/tests.set [new file with mode: 0644]
doc/salome/examples/transforming_meshes_ex03.py
doc/salome/examples/transforming_meshes_ex06.py
doc/salome/examples/transforming_meshes_ex07.py
doc/salome/examples/transforming_meshes_ex08.py
doc/salome/examples/transforming_meshes_ex09.py
doc/salome/examples/transforming_meshes_ex10.py
doc/salome/examples/transforming_meshes_ex11.py
doc/salome/examples/transforming_meshes_ex12.py
doc/salome/examples/transforming_meshes_ex13.py
doc/salome/examples/use_existing_faces.py
doc/salome/examples/viewing_meshes_ex01.py
doc/salome/examples/viewing_meshes_ex02.py
doc/salome/gui/SMESH/images/prism_mesh.png [new file with mode: 0644]
doc/salome/gui/SMESH/input/constructing_meshes.doc
doc/salome/gui/SMESH/input/prism_3d_algo.doc
doc/salome/gui/SMESH/input/smesh_migration.doc
doc/salome/gui/SMESH/input/smeshpy_interface.doc
idl/SMESH_Gen.idl
idl/SMESH_Mesh.idl
resources/SMESHCatalog.xml.in
src/OBJECT/SMESH_ScalarBarActor.cxx
src/OBJECT/SMESH_ScalarBarActor.h
src/PluginUtils/GeomSelectionTools.cxx
src/PluginUtils/GeomSelectionTools.h
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_Mesh.hxx
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Algo.hxx
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Gen.hxx
src/SMESH/SMESH_Hypothesis.cxx
src/SMESH/SMESH_Hypothesis.hxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_Pattern.cxx
src/SMESHDS/SMESHDS_Document.cxx
src/SMESHDS/SMESHDS_Document.hxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx
src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx
src/SMESHGUI/SMESHGUI_Displayer.cxx
src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MergeDlg.cxx
src/SMESHGUI/SMESHGUI_MeshInfo.cxx
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/SMESHGUI/SMESHGUI_MeshOrderOp.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshUtils.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_Operation.cxx
src/SMESHGUI/SMESHGUI_Operation.h
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_Selection.h
src/SMESHGUI/SMESHGUI_SelectionOp.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_Utils.cxx
src/SMESHGUI/SMESHGUI_Utils.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.h
src/SMESHUtils/CMakeLists.txt
src/SMESHUtils/SMESH_Delaunay.cxx [new file with mode: 0644]
src/SMESHUtils/SMESH_Delaunay.hxx [new file with mode: 0644]
src/SMESHUtils/SMESH_MAT2d.cxx
src/SMESH_I/CMakeLists.txt
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_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_Hypothesis_i.cxx
src/SMESH_I/SMESH_Hypothesis_i.hxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx
src/SMESH_I/SMESH_NoteBook.cxx
src/SMESH_I/SMESH_PreMeshInfo.cxx
src/SMESH_I/SMESH_PythonDump.hxx
src/SMESH_PY/smeshstudytools.py
src/SMESH_SWIG/CMakeLists.txt
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_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/StdMeshersBuilder.py
src/SMESH_SWIG/batchmode_mefisto.py [deleted file]
src/SMESH_SWIG/batchmode_smesh.py [deleted file]
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/smeshBuilder.py
src/SMESH_SWIG/smesh_algorithm.py
src/SMESH_SWIG/smesh_selection.py
src/SMESH_SWIG_WITHIHM/CMakeLists.txt
src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx
src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h
src/SMESH_SWIG_WITHIHM/libSMESH_Swig.i
src/StdMeshers/StdMeshers_Adaptive1D.cxx
src/StdMeshers/StdMeshers_Adaptive1D.hxx
src/StdMeshers/StdMeshers_Arithmetic1D.cxx
src/StdMeshers/StdMeshers_Arithmetic1D.hxx
src/StdMeshers/StdMeshers_AutomaticLength.cxx
src/StdMeshers/StdMeshers_AutomaticLength.hxx
src/StdMeshers/StdMeshers_CartesianParameters3D.cxx
src/StdMeshers/StdMeshers_CartesianParameters3D.hxx
src/StdMeshers/StdMeshers_Cartesian_3D.cxx
src/StdMeshers/StdMeshers_Cartesian_3D.hxx
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx
src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx
src/StdMeshers/StdMeshers_CompositeSegment_1D.hxx
src/StdMeshers/StdMeshers_Deflection1D.cxx
src/StdMeshers/StdMeshers_Deflection1D.hxx
src/StdMeshers/StdMeshers_FaceSide.cxx
src/StdMeshers/StdMeshers_FaceSide.hxx
src/StdMeshers/StdMeshers_FixedPoints1D.cxx
src/StdMeshers/StdMeshers_FixedPoints1D.hxx
src/StdMeshers/StdMeshers_Geometric1D.cxx
src/StdMeshers/StdMeshers_Geometric1D.hxx
src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx
src/StdMeshers/StdMeshers_HexaFromSkin_3D.hxx
src/StdMeshers/StdMeshers_Hexa_3D.cxx
src/StdMeshers/StdMeshers_Hexa_3D.hxx
src/StdMeshers/StdMeshers_ImportSource.cxx
src/StdMeshers/StdMeshers_ImportSource.hxx
src/StdMeshers/StdMeshers_Import_1D.cxx
src/StdMeshers/StdMeshers_Import_1D.hxx
src/StdMeshers/StdMeshers_Import_1D2D.cxx
src/StdMeshers/StdMeshers_Import_1D2D.hxx
src/StdMeshers/StdMeshers_LayerDistribution.cxx
src/StdMeshers/StdMeshers_LayerDistribution.hxx
src/StdMeshers/StdMeshers_LayerDistribution2D.cxx
src/StdMeshers/StdMeshers_LayerDistribution2D.hxx
src/StdMeshers/StdMeshers_LengthFromEdges.cxx
src/StdMeshers/StdMeshers_LengthFromEdges.hxx
src/StdMeshers/StdMeshers_LocalLength.cxx
src/StdMeshers/StdMeshers_LocalLength.hxx
src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
src/StdMeshers/StdMeshers_MEFISTO_2D.hxx
src/StdMeshers/StdMeshers_MaxElementArea.cxx
src/StdMeshers/StdMeshers_MaxElementArea.hxx
src/StdMeshers/StdMeshers_MaxElementVolume.cxx
src/StdMeshers/StdMeshers_MaxElementVolume.hxx
src/StdMeshers/StdMeshers_MaxLength.cxx
src/StdMeshers/StdMeshers_MaxLength.hxx
src/StdMeshers/StdMeshers_NotConformAllowed.cxx
src/StdMeshers/StdMeshers_NotConformAllowed.hxx
src/StdMeshers/StdMeshers_NumberOfLayers.cxx
src/StdMeshers/StdMeshers_NumberOfLayers.hxx
src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx
src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx
src/StdMeshers/StdMeshers_NumberOfSegments.cxx
src/StdMeshers/StdMeshers_NumberOfSegments.hxx
src/StdMeshers/StdMeshers_PolygonPerFace_2D.cxx
src/StdMeshers/StdMeshers_PolygonPerFace_2D.hxx
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_Prism_3D.hxx
src/StdMeshers/StdMeshers_ProjectionSource1D.cxx
src/StdMeshers/StdMeshers_ProjectionSource1D.hxx
src/StdMeshers/StdMeshers_ProjectionSource2D.cxx
src/StdMeshers/StdMeshers_ProjectionSource2D.hxx
src/StdMeshers/StdMeshers_ProjectionSource3D.cxx
src/StdMeshers/StdMeshers_ProjectionSource3D.hxx
src/StdMeshers/StdMeshers_ProjectionUtils.cxx
src/StdMeshers/StdMeshers_ProjectionUtils.hxx
src/StdMeshers/StdMeshers_Projection_1D.cxx
src/StdMeshers/StdMeshers_Projection_1D.hxx
src/StdMeshers/StdMeshers_Projection_1D2D.cxx
src/StdMeshers/StdMeshers_Projection_1D2D.hxx
src/StdMeshers/StdMeshers_Projection_2D.cxx
src/StdMeshers/StdMeshers_Projection_2D.hxx
src/StdMeshers/StdMeshers_Projection_3D.cxx
src/StdMeshers/StdMeshers_Projection_3D.hxx
src/StdMeshers/StdMeshers_Propagation.cxx
src/StdMeshers/StdMeshers_Propagation.hxx
src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx
src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.hxx
src/StdMeshers/StdMeshers_QuadrangleParams.cxx
src/StdMeshers/StdMeshers_QuadrangleParams.hxx
src/StdMeshers/StdMeshers_QuadranglePreference.cxx
src/StdMeshers/StdMeshers_QuadranglePreference.hxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
src/StdMeshers/StdMeshers_QuadraticMesh.cxx
src/StdMeshers/StdMeshers_QuadraticMesh.hxx
src/StdMeshers/StdMeshers_RadialPrism_3D.cxx
src/StdMeshers/StdMeshers_RadialPrism_3D.hxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshers/StdMeshers_Regular_1D.hxx
src/StdMeshers/StdMeshers_Reversible1D.cxx
src/StdMeshers/StdMeshers_Reversible1D.hxx
src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx
src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.hxx
src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx
src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.hxx
src/StdMeshers/StdMeshers_StartEndLength.cxx
src/StdMeshers/StdMeshers_StartEndLength.hxx
src/StdMeshers/StdMeshers_UseExisting_1D2D.cxx
src/StdMeshers/StdMeshers_UseExisting_1D2D.hxx
src/StdMeshers/StdMeshers_ViscousLayers.cxx
src/StdMeshers/StdMeshers_ViscousLayers.hxx
src/StdMeshers/StdMeshers_ViscousLayers2D.cxx
src/StdMeshers/StdMeshers_ViscousLayers2D.hxx
src/StdMeshersGUI/CMakeLists.txt
src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
src/StdMeshers_I/StdMeshers_Adaptive1D_i.cxx
src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx
src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx
src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx
src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx
src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx
src/StdMeshers_I/StdMeshers_Cartesian_3D_i.cxx
src/StdMeshers_I/StdMeshers_Cartesian_3D_i.hxx
src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.cxx
src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.hxx
src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx
src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx
src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx
src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx
src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx
src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx
src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx
src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx
src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx
src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx
src/StdMeshers_I/StdMeshers_Import_1D2D_i.cxx
src/StdMeshers_I/StdMeshers_Import_1D2D_i.hxx
src/StdMeshers_I/StdMeshers_Import_1D_i.cxx
src/StdMeshers_I/StdMeshers_Import_1D_i.hxx
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx
src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx
src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx
src/StdMeshers_I/StdMeshers_LocalLength_i.cxx
src/StdMeshers_I/StdMeshers_LocalLength_i.hxx
src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx
src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx
src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx
src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx
src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx
src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx
src/StdMeshers_I/StdMeshers_MaxLength_i.cxx
src/StdMeshers_I/StdMeshers_MaxLength_i.hxx
src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx
src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx
src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx
src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx
src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.cxx
src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.hxx
src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx
src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx
src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx
src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx
src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx
src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx
src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx
src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx
src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx
src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx
src/StdMeshers_I/StdMeshers_Propagation_i.cxx
src/StdMeshers_I/StdMeshers_Propagation_i.hxx
src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx
src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx
src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx
src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx
src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx
src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx
src/StdMeshers_I/StdMeshers_QuadraticMesh_i.cxx
src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx
src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx
src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx
src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx
src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx
src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.cxx
src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.hxx
src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.cxx
src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx
src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.cxx
src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.hxx
src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx
src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx
src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx
src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx
src/StdMeshers_I/StdMeshers_i.cxx
src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py
src/Tools/MGCleanerPlug/MGCleanerplug_plugin.py
src/Tools/MacMesh/MacMesh/CutnGroup.py
src/Tools/MacMesh/MacMesh/GenFunctions.py
src/Tools/MacMesh/MacMesh/PublishGroups.py
src/Tools/MeshCut/meshcut_plugin.py
src/Tools/Verima/Doc/usage_outil.rst
src/Tools/Verima/Stats/getCritere.py
src/Tools/YamsPlug/monYamsPlugDialog.py
src/Tools/YamsPlug/yamsplug_plugin.py
src/Tools/blocFissure/AREextradosLauncher.py
src/Tools/blocFissure/AREintradosLauncher.py
src/Tools/blocFissure/exemple2.py
src/Tools/blocFissure/fissureLauncher.py
src/Tools/blocFissure/gmu/construitFissureGenerale.py
src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py
src/Tools/blocFissure/gmu/geomsmesh.py
src/Tools/blocFissure/gmu/insereFissureElliptique.py
src/Tools/blocFissure/gmu/insereFissureGenerale.py
src/Tools/blocFissure/gmu/insereFissureLongue.py
src/Tools/blocFissure/ihm/fissureCoude_plugin.py
src/Tools/blocFissure/ihm/fissureGenerale_plugin.py
src/Tools/blocFissure/lanceurSoudureArrondieTest.py
src/Tools/blocFissure/lanceurSoudureViveTest.py
src/Tools/blocFissure/lanceurTestAubry.py
src/Tools/blocFissure/materielCasTests/cubeAngle.py
src/Tools/blocFissure/materielCasTests/cubeFin.py
src/Tools/blocFissure/materielCasTests/decoupeCylindre.py
src/Tools/blocFissure/materielCasTests/disque_perce.py
src/Tools/blocFissure/materielCasTests/ellipse.py
src/Tools/blocFissure/materielCasTests/ellipse_disque.py
src/Tools/blocFissure/materielCasTests/ellipse_probleme.py
src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py
src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py
src/Tools/blocFissure/materielCasTests/fissureGauche.py
src/Tools/blocFissure/materielCasTests/fissureGauche2.py
src/Tools/blocFissure/materielCasTests/vis.py
src/Tools/padder/meshjob/idl/SPADDERPluginTest.idl
src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.cxx
src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.hxx
src/Tools/padder/resources/testdata/buildparticules.py
src/Tools/padder/spadderpy/gui/inputdialog.py
src/Tools/padder/spadderpy/gui/plugindialog.py
src/Tools/padder/unittests/usecase_spadderPluginTester.py

index ef42ec11a15c27be58e43f59c1df56dc18f78d42..b3e766d8d9fe73c26e53dc99534b3d8a10f3f6da 100755 (executable)
@@ -35,7 +35,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Common CMake macros
 # ===================
index 47383fee949f4dd77b97f7b85292073caff4e7e3..04d6073bdb2adb486e8850e0ff6338214ac9c90d 100644 (file)
@@ -3,11 +3,11 @@
 import salome
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 ###
 # Geometry: an assembly of a box, a cylinder and a truncated cone
index 2dfdf7bcfc79b696ef3d1148c0c848fe6f5ef706..01ed3f5aca924bcc614c9f3bae08b6fadd23afc3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2017  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-# examples that can't be used for testing because they use external mesher plug-ins
-SET(BAD_TESTS
-  3dmesh.py
-  a3DmeshOnModified2Dmesh.py
-  creating_meshes_ex01.py
-  creating_meshes_ex03.py
-  creating_meshes_ex05.py
-  defining_hypotheses_ex06.py
-  defining_hypotheses_ex09.py
-  defining_hypotheses_ex17.py
-  filters_ex02.py
-  filters_ex08.py
-  filters_ex23.py
-  filters_ex24.py
-  filters_ex25.py
-  filters_ex32.py
-  filters_ex35.py
-  generate_flat_elements.py
-  modifying_meshes_ex26.py
-  notebook_smesh.py
-  quality_controls_ex06.py
-  quality_controls_ex20.py
-  quality_controls_ex21.py
-  quality_controls_ex22.py
-  viewing_meshes_ex01.py
-  )
-
-SET(GOOD_TESTS
-  cartesian_algo.py
-  creating_meshes_ex02.py
-  creating_meshes_ex04.py
-  creating_meshes_ex06.py
-  creating_meshes_ex07.py
-  creating_meshes_ex08.py
-  defining_hypotheses_ex01.py
-  defining_hypotheses_ex02.py
-  defining_hypotheses_ex03.py
-  defining_hypotheses_ex04.py
-  defining_hypotheses_ex05.py
-  defining_hypotheses_ex07.py
-  defining_hypotheses_ex08.py
-  defining_hypotheses_ex10.py
-  defining_hypotheses_ex11.py
-  defining_hypotheses_ex12.py
-  defining_hypotheses_ex13.py
-  defining_hypotheses_ex14.py
-  defining_hypotheses_ex15.py
-  defining_hypotheses_ex16.py
-  defining_hypotheses_adaptive1d.py
-  filters_ex01.py
-  filters_ex03.py
-  filters_ex04.py
-  filters_ex05.py
-  filters_ex06.py
-  filters_ex07.py
-  filters_ex09.py
-  filters_ex10.py
-  filters_ex11.py
-  filters_ex12.py
-  filters_ex13.py
-  filters_ex14.py
-  filters_ex15.py
-  filters_ex16.py
-  filters_ex17.py
-  filters_ex18.py
-  filters_ex19.py
-  filters_ex20.py
-  filters_ex21.py
-  filters_ex22.py
-  filters_ex26.py
-  filters_ex27.py
-  filters_ex28.py
-  filters_ex29.py
-  filters_ex30.py
-  filters_ex31.py
-  filters_ex33.py
-  filters_ex34.py
-  filters_ex36.py
-  filters_ex37.py
-  filters_ex38.py
-  filters_ex39.py
-  filters_node_nb_conn.py
-  filters_belong2group.py
-  grouping_elements_ex01.py
-  grouping_elements_ex02.py
-  grouping_elements_ex03.py
-  grouping_elements_ex04.py
-  grouping_elements_ex05.py
-  grouping_elements_ex06.py
-  grouping_elements_ex07.py
-  grouping_elements_ex08.py
-  measurements_ex01.py
-  measurements_ex02.py
-  measurements_ex03.py
-  modifying_meshes_ex01.py
-  modifying_meshes_ex02.py
-  modifying_meshes_ex03.py
-  modifying_meshes_ex04.py
-  modifying_meshes_ex05.py
-  modifying_meshes_ex06.py
-  modifying_meshes_ex07.py
-  modifying_meshes_ex08.py
-  modifying_meshes_ex09.py
-  modifying_meshes_ex10.py
-  modifying_meshes_ex11.py
-  modifying_meshes_ex12.py
-  modifying_meshes_ex13.py
-  modifying_meshes_ex14.py
-  modifying_meshes_ex15.py
-  modifying_meshes_ex16.py
-  modifying_meshes_ex17.py
-  modifying_meshes_ex18.py
-  modifying_meshes_ex19.py
-  modifying_meshes_ex20.py
-  modifying_meshes_ex21.py
-  modifying_meshes_ex22.py
-  modifying_meshes_ex23.py
-  modifying_meshes_ex24.py
-  modifying_meshes_ex25.py
-  prism_3d_algo.py
-  quality_controls_ex01.py
-  quality_controls_ex02.py
-  quality_controls_ex03.py
-  quality_controls_ex04.py
-  quality_controls_ex05.py
-  quality_controls_ex07.py
-  quality_controls_ex08.py
-  quality_controls_ex09.py
-  quality_controls_ex10.py
-  quality_controls_ex11.py
-  quality_controls_ex12.py
-  quality_controls_ex13.py
-  quality_controls_ex14.py
-  quality_controls_ex15.py
-  quality_controls_ex16.py
-  quality_controls_ex17.py
-  quality_controls_ex18.py
-  quality_controls_ex19.py
-  transforming_meshes_ex01.py
-  transforming_meshes_ex02.py
-  transforming_meshes_ex03.py
-  transforming_meshes_ex04.py
-  transforming_meshes_ex05.py
-  transforming_meshes_ex06.py
-  transforming_meshes_ex07.py
-  transforming_meshes_ex08.py
-  transforming_meshes_ex09.py
-  transforming_meshes_ex10.py
-  transforming_meshes_ex11.py
-  transforming_meshes_ex12.py
-  transforming_meshes_ex13.py
-  use_existing_faces.py
-  viewing_meshes_ex02.py
-  split_biquad.py
-)
-
-SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py)
+INCLUDE(tests.set)
 
 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 
@@ -195,3 +39,4 @@ INSTALL(FILES ${GOOD_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
 INSTALL(FILES CTestTestfileInstall.cmake
         DESTINATION ${TEST_INSTALL_DIRECTORY}
         RENAME CTestTestfile.cmake)
+INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
index d56f4206547f05f41cef0d90bba4afee19e04a47..c44ec0c5738b30c701bd412a612b7ac9ce1f35e8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2015-2017  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(tests.set)
+
 SET(SALOME_TEST_DRIVER "$ENV{ABSOLUTE_APPLI_PATH}/bin/salome/appliskel/salome_test_driver.py")
 SET(COMPONENT_NAME SMESH)
 SET(TIMEOUT        300)
 
-SET(GOOD_TESTS
-  cartesian_algo
-  creating_meshes_ex02
-  creating_meshes_ex04
-  creating_meshes_ex06
-  creating_meshes_ex07
-  creating_meshes_ex08
-  defining_hypotheses_ex01
-  defining_hypotheses_ex02
-  defining_hypotheses_ex03
-  defining_hypotheses_ex04
-  defining_hypotheses_ex05
-  defining_hypotheses_ex07
-  defining_hypotheses_ex08
-  defining_hypotheses_ex10
-  defining_hypotheses_ex11
-  defining_hypotheses_ex12
-  defining_hypotheses_ex13
-  defining_hypotheses_ex14
-  defining_hypotheses_ex15
-  defining_hypotheses_ex16
-  defining_hypotheses_adaptive1d
-  filters_ex01
-  filters_ex03
-  filters_ex04
-  filters_ex05
-  filters_ex06
-  filters_ex07
-  filters_ex09
-  filters_ex10
-  filters_ex11
-  filters_ex12
-  filters_ex13
-  filters_ex14
-  filters_ex15
-  filters_ex16
-  filters_ex17
-  filters_ex18
-  filters_ex19
-  filters_ex20
-  filters_ex21
-  filters_ex22
-  filters_ex26
-  filters_ex27
-  filters_ex28
-  filters_ex29
-  filters_ex30
-  filters_ex31
-  filters_ex33
-  filters_ex34
-  filters_ex36
-  grouping_elements_ex01
-  grouping_elements_ex02
-  grouping_elements_ex03
-  grouping_elements_ex04
-  grouping_elements_ex05
-  grouping_elements_ex06
-  grouping_elements_ex07
-  grouping_elements_ex08
-  measurements_ex01
-  measurements_ex02
-  modifying_meshes_ex01
-  modifying_meshes_ex02
-  modifying_meshes_ex03
-  modifying_meshes_ex04
-  modifying_meshes_ex05
-  modifying_meshes_ex06
-  modifying_meshes_ex07
-  modifying_meshes_ex08
-  modifying_meshes_ex09
-  modifying_meshes_ex10
-  modifying_meshes_ex11
-  modifying_meshes_ex12
-  modifying_meshes_ex13
-  modifying_meshes_ex14
-  modifying_meshes_ex15
-  modifying_meshes_ex16
-  modifying_meshes_ex17
-  modifying_meshes_ex18
-  modifying_meshes_ex19
-  modifying_meshes_ex20
-  modifying_meshes_ex21
-  modifying_meshes_ex22
-  modifying_meshes_ex23
-  modifying_meshes_ex24
-  modifying_meshes_ex25
-  prism_3d_algo
-  quality_controls_ex01
-  quality_controls_ex02
-  quality_controls_ex03
-  quality_controls_ex04
-  quality_controls_ex05
-  quality_controls_ex07
-  quality_controls_ex08
-  quality_controls_ex09
-  quality_controls_ex10
-  quality_controls_ex11
-  quality_controls_ex12
-  quality_controls_ex13
-  quality_controls_ex14
-  quality_controls_ex15
-  quality_controls_ex16
-  quality_controls_ex17
-  quality_controls_ex18
-  quality_controls_ex19
-  transforming_meshes_ex01
-  transforming_meshes_ex02
-  transforming_meshes_ex03
-  transforming_meshes_ex04
-  transforming_meshes_ex05
-  transforming_meshes_ex06
-  transforming_meshes_ex07
-  transforming_meshes_ex08
-  transforming_meshes_ex09
-  transforming_meshes_ex10
-  transforming_meshes_ex11
-  transforming_meshes_ex12
-  transforming_meshes_ex13
-  use_existing_faces
-  viewing_meshes_ex02
-)
-
 FOREACH(tfile ${GOOD_TESTS})
-  SET(TEST_NAME SMESH_${tfile})
-  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py)
+  GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
+  SET(TEST_NAME SMESH_${BASE_NAME})
+  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile})
   SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
 ENDFOREACH()
index 5520d7afe9089ca3660ff1f3b031a5828debb274..ae03906c89068e7861633390ead318d182009078 100644 (file)
@@ -2,7 +2,7 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 # This script demonstrates generation of 3D mesh basing on a modified 2D mesh
 #
@@ -31,7 +31,7 @@ Sph_Face = geompy.GetInPlace(Cut_1, Sph_Face, isNewImplementation=True, theName=
 
 import  SMESH
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
 
 Mesh_1 = smesh.Mesh(Cut_1)
 
@@ -59,4 +59,4 @@ Mesh_1.Tetrahedron()
 Mesh_1.Compute()
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 179b9bb3f5f1c15fc047786d09ab542965098fe4..e9d7748c7319a8ce0b0f620b753492ac0b1d6038 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index 1d0d94f7690c36e5f9b5ca3bc78767a83de7cf05..110f6269a74f09e989e2ce0c5f45812af502f25e 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
index 230e67a00f8f9ec9886c5288fc37d5941c5d3677..522f72bf4c1d05a2d0fd6e7d27618766e5d7ccb7 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index fbc0eca24934d3f51d1e0b7aaaa3f043e9e71b4a..bb647c370fbd4e4980b65dab7d987227eadd4493 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
 [Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["FACE"])
index b0db4bdb7038d3d8a79a8cc4b5a5d38cb8b4d166..0a3cc9faf13f710919c02622eb7f73b3124a7028 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 def PrintMeshInfo(theMesh):
     aMesh = theMesh.GetMesh()
index fbafc4b11062769522732d5db260a83deb1f73ec..6eb550c9ce338e741509375d91016471a6af7ed8 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
index 90fe2765e5b6b636bfedc6d5eb8ded6fd86eb14a..3cc4dc1023d98decd129ae2f8b66bf58b4ed444f 100644 (file)
@@ -8,11 +8,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -84,7 +84,7 @@ geompy.DifferenceList(group_1, [group_1_box])
 # Mesh the blocks with hexahedral
 # -------------------------------
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 def discretize(x, y, z,  nbSeg, shape=blocks):
     vert = geompy.MakeVertex( x, y, z )
index 4ddb69702ac8697566ef2d860b3353d0d890deec..db825507bef1abb08950b2c1c542778596744d81 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 ## create a bottom box
 Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
@@ -39,7 +39,7 @@ geompy.addToStudy(Box_sup, "Box_sup")
 geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
 geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 ## create a bottom mesh
 Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
@@ -78,4 +78,4 @@ Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True,
                               name='Compound with UniteGrps and GrpsOfAllElems')
 
 if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
index 0cb4b229f54375aa01601e9d9bf1a6260e84d118..7fa7a7dcffc3161a293aa5e6a3624c2c5608166e 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # make geometry of a box
 box = geompy.MakeBoxDXDYDZ(100,100,100)
index 96e2fabfe1912ce45ff7bcdad8640cd474d92771..579d14de5fc5eb1b7db98e7c1c76160f73ede789 100644 (file)
@@ -1,9 +1,9 @@
 import salome, math
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 box   = geompy.MakeBoxDXDYDZ( 100, 100, 100 )
index c9f02bc12a2a7a1ac717e974c5bc72245cb6abbf..a4083ba4934b66f69906f097d3c8b50f7930e2fd 100644 (file)
@@ -4,10 +4,10 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index 572404569d8f53c16feb88a1eb40316e787f574c..9473354b3733b2a868c419dba5ea758f85a2400d 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a face from arc and straight segment
 px = geompy.MakeVertex(100., 0.  , 0.  )
index 05a984b77d2f68cf296e6ccfd5dff0959c1cf3cd..3e0a5a7defa0305b8bcab7b0047620395c899adf 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index 8ebddfc5c3fd32d58a57fd9d9902ced2ddd71cf1..c15e4421bf2fc0cc7efb69216994f9e43b379fcb 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index 204496ce039b7803cfda6d7611052b4ce996b094..d998447184cc5e6efb400c60ddd83273584d5ac9 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a face
 px   = geompy.MakeVertex(100., 0.  , 0.  )
index 6fd5e021029f6c82d697e8df3e38daad872cd043..f0a02aee40a678cce4934509b6c000e6fe425ef7 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a cylinder
 cyl = geompy.MakeCylinderRH(30., 50.)
index 1630a9047e757f61e3c2b606c565c7de857f12f9..a8a8e9fd2ef9041241ca9c921836f87fd4b4a952 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create sketchers
 sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
index 3c877f3dae45e8a6edf4e58273178c8c17725508..285eae2ad63f29e0c67f65e220dfad39d51f241f 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 base = geompy.MakeSketcher("Sketcher:F 0 0:TT 10 0:TT 20 10:TT 0 10:WF", theName="F")
index 8490a4b8c753ba679727cab2ec80da62818640b8..6e86cc95ea7c7bf6d955c4a5a94610d500cb713e 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index 6e6bf84bbc185d38dc8616ec9143a892d4055822..9fea80b144c82531ea5b1b7cff2e98cfa8b3bfe3 100644 (file)
@@ -6,11 +6,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Prepare geometry
 
index 2510ed6f0b75275e70dd9dd6196aaaee79dc203f..a57d0781dd5784c335893ca02d172433589e2f43 100644 (file)
@@ -6,11 +6,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Prepare geometry
 
index 827c4c5e2d4d02d6d6205c7573ccf60af2dca203..7ead18cbf3b81ea45db38ee1e4afdaf27c683198 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 
 # Create face and explode it on edges
index 339cd200d4e62d56127d5036b2838726dbfdb5b8..0bcdcf60a2bc2b777cf8576d8c4fdcf2f743b0fd 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create face from the wire and add to study
 Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1])
index 3f55844cff79e68af6171aa669e98dcff52a7b0b..b0ef9f6af9b8f0054d65f6d70dd033ca5fc64fba 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Get 1/4 part from the disk face.
 Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100)
index 2e01e1b323114c76c004d8f1a136b0aa4ef38e8c..80b430e2a608a90c328942e91ceccc238227d192 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 
 # Make quadrangle face and explode it on edges.
index ce11e3e400821e463ca833a689a03736e202757f..575601f1ef18da00b548e86878f3112c6ef8ad9d 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Make a patritioned box
 
index 36d8f6c1f4f2e091cd456e00e7a7a9c23f21e147..f2b7d8c20f4f21207ef87ac3a0e2c92ddcb80820 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 X = geompy.MakeVectorDXDYDZ( 1,0,0 )
 O = geompy.MakeVertex( 100,50,50 )
index 8f00c7f8dd623a00cdf533a68cabf50f7f1677e3..21c1d6c94795c94b828fc8b1e1c75b238c366528 100644 (file)
@@ -4,9 +4,9 @@
 import salome, SMESH
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create mesh
 face = geompy.MakeFaceHW(100, 100, 1, theName="quadrangle")
index 0cba34f163099f933104747a29747aa8805f92fa..d1f5023eb70ad4b36ea6b7600a54946da225fdf6 100644 (file)
@@ -4,9 +4,9 @@
 import salome, SMESH
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create mesh
 face = geompy.MakeFaceHW(100, 100, 1)
index e549a14f0874921c88d8fa44b56e102343f6a32a..e417ca2fa31d8d08a0335f8f4ee115b50ca503ea 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 # make a mesh on a box
index 7398b5ac77b13975eefe3a0ed661d501abf38b10..a05fbaa210792c2386ba139c3efd56e3eab5df11 100644 (file)
@@ -3,10 +3,10 @@
 import salome
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # make a mesh on a box
 box = geompy.MakeBoxDXDYDZ(100,100,100)
index ea436f4781262dd26a57e5d0ae08386f3994b9e1..6fcba2650c1bc4c0f2f038d4153bdfc8e49eb5f1 100644 (file)
@@ -3,10 +3,10 @@
 import salome
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # make a mesh on a box
 box = geompy.MakeBoxDXDYDZ(100,100,100)
index 7f956785f8ca8de060645509994d1c268eecb725..2d3c907d680ea0ded5c26b849be95fc55ad3d6ca 100644 (file)
@@ -3,9 +3,9 @@
 import salome, SMESH
 salome.salome_init()
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create two boxes to have two domains in the mesh
 
index df187188b8d9399d9fd703e9fc3660fead430691..b81d80155179a2c85d7036a1003020c1853c5f25 100644 (file)
@@ -8,11 +8,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # geometry 
index bb97b024a1f18b63f3223fba52ab1bdc01a61c0e..c35de336b5124323d641857e1bb1a7f17042f69c 100644 (file)
@@ -77,4 +77,4 @@ aGroup.Remove( [2,3,4] )
 
 
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 84150125395d82cef55866fbdaee70042cda101a..4e2a4957f763ca1625c2312af6b021bcfc599a04 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBox(0., 0., 0., 100., 100., 100.)
@@ -43,4 +43,4 @@ aSmeshGroup1 = quadra.GroupOnGeom(face, "SMESHGroup1")
 # create SMESH group on <aGeomGroupE> with default name
 aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE) 
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 928b495633db31170d14184d3e7580ad83406252..19ce71311d9849a602d621246d5cb48a4d461d0c 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
@@ -46,4 +46,4 @@ filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70"
 filtIDs3 = filtGroup.GetIDs()
 print("After filter modification, group on filter contains %s elemens" % filtGroup.Size())
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index a7b26c4e5b69165d509352296c1fc3cdfb078b9b..e0e58acc9e2829472c1a94b9212b01e61428f943 100644 (file)
@@ -42,4 +42,4 @@ for i in range(len(aGroupElemIDs)):
   pass
 print("")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 23e1abf87a3a1a8267e1d6ad875b5035b61b9966..96aa7fa5688081721bfa6e64e9b51033a73c34f7 100644 (file)
@@ -52,4 +52,4 @@ aGroup4.SetColor( SALOMEDS.Color(1.,0.,0.));
 aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")
 print("Criterion: Any Area, Nb = ", len(aGroup5.GetListOfID()))
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index a5b2c3ffb25fcc3111559a2cb7db116400721198..9423cf7d402ac8a271741086ac224b03fabaf9f0 100644 (file)
@@ -34,4 +34,4 @@ aGroup3 = mesh.IntersectListOfGroups([aGroup1, aGroup2], "20 < Area < 60")
 print("Criterion: 20 < Area < 60, Nb = ", len(aGroup3.GetListOfID()))
 # Please note that also there is IntersectGroups() method which works with two groups only
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index eb288de24db4c4fb551ef5354ae587fb7dc19a6c..800e8e80abfa5dbf572e383aa058326392740baa 100644 (file)
@@ -32,4 +32,4 @@ aGroupRes = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")
 print("Criterion: Area >= 60, Nb = ", len(aGroupRes.GetListOfID()))
 # Please note that also there is CutListOfGroups() method which works with lists of groups of any lengths
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 9447f98ec043d45e00781f2045efab4633de1b12..76dc93fcc32d432ae76159b8a7c0f8a80b3eb49e 100644 (file)
@@ -30,4 +30,4 @@ aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" )
 # Create group of nodes using source groups of faces
 aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.NODE, "Nodes" )
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index d8a5bd71c02764351d7c231ad175c41c42be0dc4..b94f59cbb8d5411fb9ecb9942966a1c855202e29 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 from SMESH_mechanic import mesh as mesh1
index b5fbf8b1f3e929ca7c3842f9b829acfaf426c505..a11a47dfb5a98f24d9d6c420df51385730c4f262 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 from SMESH_mechanic import mesh as mesh1
index f788c56db58bda438bffc57da2dcd94bd9f816ed..d936878835d43670e5d6ad16572b900e5089c9b9 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(100,100,100)
index e58950bb30ae068c7fdc7e4bcfe081611cd56ee0..5950a00cf209b292b0df13f6b50bc7914a341d02 100644 (file)
@@ -4,7 +4,7 @@ import salome
 salome.salome_init()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 mesh = smesh.Mesh()
index b54a90988346b0d32b278056905203353806e519..78aff713cea8aac31396febc5023f18023115f70 100644 (file)
@@ -4,7 +4,7 @@ import salome
 salome.salome_init()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 mesh = smesh.Mesh()
index 2416baf4d9e716dea130191f569f8f665e792563..46df84e8f84176444d451100e1e188c49986189d 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # create a geometry
index c09cb62c6b97293d11f577fae191f9debc710344..401fda8d6edc6feb88305aeb0e666a8eb185d1a1 100644 (file)
@@ -7,7 +7,7 @@ salome.salome_init()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # create an empty mesh structure
@@ -34,4 +34,4 @@ f1 = MakePolygon(mesh, 0, 0,  0, 30, 13)
 f2 = MakePolygon(mesh, 0, 0, 10, 21,  9)
 f3 = MakePolygon(mesh, 0, 0, 20, 13,  6)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index bf13423ed898c3075aca7d19f092b3d765480453..fe8ec68c6d887954a4dcc65744e531705d8e9a19 100644 (file)
@@ -5,7 +5,7 @@ import salome
 salome.salome_init()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -60,4 +60,4 @@ mesh.AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4],  # top
                          [5,5,5,5,5,5,5,5,5,5,5,5])
 
 if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
index 9141e5c8c8947ebf4521cf38b0e48ee42d58e83c..2656ea300bc2d625d2cb0ca2cc4ccfece26793ca 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
index 8b958f95bc55790d64c25564f3a48301214b07f1..2ecc4ed079a6690efc2d11050f9083ed5521340c 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
@@ -51,4 +51,4 @@ res = mesh.InverseDiag(bb[1], tt[2])
 if not res: print("failed!")
 else:       print("done.")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 7cd708158f5c89f619e2ac1c1fcf4490fbf2f9e7..1fe0c466bf63780b0a2316fdd73475aa178ffa1b 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
@@ -51,4 +51,4 @@ res = mesh.DeleteDiag(bb[1], tt[2])
 if not res: print("failed!")
 else:       print("done.")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index b44dde891fe2abc6408d8bb2a10b23f41234db61..fd21b376e0919185c8604365e73584a33b463c7b 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
@@ -51,4 +51,4 @@ res = mesh.TriToQuad([ff[2], ff[3], ff[4], ff[5]], SMESH.FT_MinimumAngle, 60.)
 if not res: print("failed!")
 else:       print("done.")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 8ef2c7c8a581fd56ad21bf6582e194068b888849..7e3c723c52ea956c7da551804b924b0e0f0f7da2 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
@@ -42,4 +42,4 @@ f5 = mesh.AddFace([n5, n6, n12, n11])
 # Change the orientation of the second and the fourth faces.
 mesh.Reorient([2, 4])
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index e9afc8e485a08eb6c6e69a1a6697b07d41b9b252..a2b92a9f9015419f7f2cff1e00e84c8a8f4ecf9d 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import SMESH_mechanic
 
@@ -32,4 +32,4 @@ print("\nSmoothing ... ", end=' ')
 if not res: print("failed!")
 else:       print("done.")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index b4f5f3cd3da60168d479bb0c0d69d946704358d5..32466ccf0d6c96a56b050062e55df2569a10548f 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import SMESH_mechanic
 
@@ -31,4 +31,4 @@ GroupTri = mesh.GroupOnGeom(face, "Group of faces (extrusion)", SMESH.FACE)
 # perform extrusion of the group
 mesh.ExtrusionSweepObject(GroupTri, vector, 5)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 350cc3482b605296be2053dd7a1138e97bb2e118..ac8556262d0f21cf97065a290c274e701dc88e93 100644 (file)
@@ -6,11 +6,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # 1. Create points
 points = [[0, 0], [50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]]
@@ -128,4 +128,4 @@ error = quad_6.ExtrusionAlongPath(ff_6 , Edge_Circle_mesh, Edge_Circle, 1,
 error = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1,
                                   1, [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 8f0b06796cf1b381a774b3e20377258028f70980..82af9b1874cb5b465cec59dc243c908c930b1ba0 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # define the geometry
 Box_1 = geompy.MakeBoxDXDYDZ(200., 200., 200.)
index 4a8eba75ee35a8e86c469753fecdeb50040cf6bf..53059ff96c9f7f7c7edba2ae0b2649264511809e 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create sphere of radius 100
 
index e52ef1b540def8dbac9bf39224465d343ac69837..376e511634196636a6b61f2bb1a6e53e0a1d0e83 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 # set variables
index 5aa283edf05d352b2efae68d455fc9b10ff49beb..6c2a9d6d4bdef5762011b559d796a4d767b08c79 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 OX = geompy.MakeVectorDXDYDZ(1,0,0)
 OY = geompy.MakeVectorDXDYDZ(0,1,0)
index a64a1f07343296a9b2c659a8d5f7f08183f57f05..30648a3ce6fcd3aab297c29f5743fa7be0c8f991 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create open shell: a box without one plane
 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
@@ -44,4 +44,4 @@ print("")
 aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Free borders")
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 8b6be1c73015e1c7e4427ef23e001d20f6011ad5..62a312ca7ed293bae7a1fbf5401b63a4f7c2b094 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create open shell: a box without one plane
 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
@@ -46,4 +46,4 @@ print("")
 aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Borders at multi-connections")
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 089341109f1e8d8dcd9cc4681e1306e405372107..fca52fddf3a1b9ad5e7472efdff5aa66b9f8c056 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create open shell: a box without one plane
 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
@@ -46,4 +46,4 @@ print("")
 aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Edges with length > " + repr(length_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 786f0d24f5591f968415b43fe69124384a2309c7..07867cc2f909f120b90fe41477c6dc6f109618d1 100644 (file)
@@ -37,4 +37,4 @@ for i in range(len(aBorders)):
   aGroupF.Add([aBorder.myElemId])
   aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2])
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 7d60b91ac21bc0184b83b109cad072d4a922878b..1ec552f752896f40d3c7bccc26f7ab1a2742cc2d 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create box
 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
@@ -51,4 +51,4 @@ for i in range(len(anNodeIds)):
   pass
 print("")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 0de0911e19c41272a3e3681664c5469f38c76235..8dd8e9cf6b2846c9864ca882eccc5ee0a522cf11 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 ####### GEOM part ########
 
@@ -75,4 +75,4 @@ aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
 aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Shared_faces")
 aGroup.Add(aFaceIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 5e84f2bfce6cd4c0e96ac87444170971eef5e048..e85b27d73c86131637c50a359b4a6969c6457a09 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index 54ed1bfbc8da71143de1031ced43ead758addb35..157bf5f8cafd7ddf592d1ba3ba6c81ce0a615c86 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index aca903ae0112fe7710953ae60ecfbfe8fae30f2b..82050cbc0b6e711546246267aff19e16e4f086f6 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index 041183224a670360309ca0675df25a0c5f16d754..1a4287fc7211463e9c1a46295012263b7cd39227 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index d108ef6d24bc24b5774b149ac0b33d271bebd246..7c00278dcf1e5f112a4c9d21c28936a838733356 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create open shell: a box without one plane
 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
@@ -47,4 +47,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with length 2D > " + repr(length_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 8e81e5130aada8f4b5da561b00402a15cc593266..adedda57db5b67a462ca8f674b8304f6bcaeb43c 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a compound of two glued boxes
 box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
@@ -47,4 +47,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Borders at multi-connection 2D = " + repr(nb_conn))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index f623081e5faa4c6eb8e5431dfb151366c42dc3ba..5cee2a8ddb9fb41625a0c031ab2ea86a761f71d9 100644 (file)
@@ -28,4 +28,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Area > " + repr(area_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 7ed0afcfe7c9a40eb51c02ff006f83e8782023a3..ab939bae8c1cd16ae425cd0c09a8117107390405 100644 (file)
@@ -28,4 +28,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Taper > " + repr(taper_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 7c2029a1e84c84397e3f774ec0cad9ec82081d0a..d7cb29071de0281ccadc0e7093a77990d9a34903 100644 (file)
@@ -28,4 +28,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Aspect Ratio > " + repr(ar_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index e0e59b3cd7660d9490b5df8745cfc27dd2192764..645b2cd237ff96a4fc77de881a0c6fe5a317af70 100644 (file)
@@ -29,4 +29,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Minimum Angle < " + repr(min_angle))
 
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 89c6bfb1e8a26f7acf4053a736f6524e5c5a9da2..a22f5e5ff1c6a50df1134c6867adda5b1ecfc64f 100644 (file)
@@ -29,4 +29,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Warp > " + repr(wa_margin))
 
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 514653527915cc2fa9e0c33c76c8e9eef65cbf25..9f6f7a3f333829dfd0e9f80f205ea364d7cc0a83 100644 (file)
@@ -28,4 +28,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Skew > " + repr(skew_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 5713800c82d20a358cbc8cc079616cd2ce0f0590..62ef71030bad8f9840cdfcd51a1f87856adb2fae 100644 (file)
@@ -28,4 +28,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 2D > " + repr(mel_2d_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index e18332407de5a998982d23b5e3d26fbb877e499b..dd594c1933824dcc9322c7b1439e04d8e9494b77 100644 (file)
@@ -29,4 +29,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Aspect Ratio 3D > " + repr(ar_marg
 
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 0e80e50691faf04040ab1d4d61895dc970d6b3ab..683e314b74ea305812536aaf2088ce274cac8a25 100644 (file)
@@ -30,4 +30,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Volume < " + repr(volume_margin))
 
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index aff8d25d3304b470157e8d21c4d5de4b003fe28d..131091f8cc5ff0e787bf11bbfd97c0ad077d0b6c 100644 (file)
@@ -28,4 +28,4 @@ print("")
 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 3D > " + repr(mel_3d_margin))
 aGroup.Add(anIds)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index e53e7b0b1c7ced203074345d505e31dd8b739a52..235d491578e2221f975263a08a14a2c6d0dfce98 100644 (file)
@@ -4,10 +4,10 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
 
 # make a shape consisting of two quadranges
 OY  = geompy.MakeVectorDXDYDZ(0, 1, 0)
diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set
new file mode 100644 (file)
index 0000000..d7744d4
--- /dev/null
@@ -0,0 +1,175 @@
+# Copyright (C) 2015-2017  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# examples that can't be used for testing because they use external mesher plug-ins
+SET(BAD_TESTS
+  3dmesh.py
+  a3DmeshOnModified2Dmesh.py
+  creating_meshes_ex01.py
+  creating_meshes_ex03.py
+  creating_meshes_ex05.py
+  defining_hypotheses_ex06.py
+  defining_hypotheses_ex09.py
+  defining_hypotheses_ex17.py
+  filters_ex02.py
+  filters_ex08.py
+  filters_ex23.py
+  filters_ex24.py
+  filters_ex25.py
+  filters_ex32.py
+  filters_ex35.py
+  generate_flat_elements.py
+  modifying_meshes_ex26.py
+  notebook_smesh.py
+  quality_controls_ex06.py
+  quality_controls_ex20.py
+  quality_controls_ex21.py
+  quality_controls_ex22.py
+  viewing_meshes_ex01.py
+  )
+
+SET(GOOD_TESTS
+  cartesian_algo.py
+  creating_meshes_ex02.py
+  creating_meshes_ex04.py
+  creating_meshes_ex06.py
+  creating_meshes_ex07.py
+  creating_meshes_ex08.py
+  defining_hypotheses_ex01.py
+  defining_hypotheses_ex02.py
+  defining_hypotheses_ex03.py
+  defining_hypotheses_ex04.py
+  defining_hypotheses_ex05.py
+  defining_hypotheses_ex07.py
+  defining_hypotheses_ex08.py
+  defining_hypotheses_ex10.py
+  defining_hypotheses_ex11.py
+  defining_hypotheses_ex12.py
+  defining_hypotheses_ex13.py
+  defining_hypotheses_ex14.py
+  defining_hypotheses_ex15.py
+  defining_hypotheses_ex16.py
+  defining_hypotheses_adaptive1d.py
+  filters_ex01.py
+  filters_ex03.py
+  filters_ex04.py
+  filters_ex05.py
+  filters_ex06.py
+  filters_ex07.py
+  filters_ex09.py
+  filters_ex10.py
+  filters_ex11.py
+  filters_ex12.py
+  filters_ex13.py
+  filters_ex14.py
+  filters_ex15.py
+  filters_ex16.py
+  filters_ex17.py
+  filters_ex18.py
+  filters_ex19.py
+  filters_ex20.py
+  filters_ex21.py
+  filters_ex22.py
+  filters_ex26.py
+  filters_ex27.py
+  filters_ex28.py
+  filters_ex29.py
+  filters_ex30.py
+  filters_ex31.py
+  filters_ex33.py
+  filters_ex34.py
+  filters_ex36.py
+  filters_ex37.py
+  filters_ex38.py
+  filters_ex39.py
+  filters_node_nb_conn.py
+  filters_belong2group.py
+  grouping_elements_ex01.py
+  grouping_elements_ex02.py
+  grouping_elements_ex03.py
+  grouping_elements_ex04.py
+  grouping_elements_ex05.py
+  grouping_elements_ex06.py
+  grouping_elements_ex07.py
+  grouping_elements_ex08.py
+  measurements_ex01.py
+  measurements_ex02.py
+  modifying_meshes_ex01.py
+  modifying_meshes_ex02.py
+  modifying_meshes_ex03.py
+  modifying_meshes_ex04.py
+  modifying_meshes_ex05.py
+  modifying_meshes_ex06.py
+  modifying_meshes_ex07.py
+  modifying_meshes_ex08.py
+  modifying_meshes_ex09.py
+  modifying_meshes_ex10.py
+  modifying_meshes_ex11.py
+  modifying_meshes_ex12.py
+  modifying_meshes_ex13.py
+  modifying_meshes_ex14.py
+  modifying_meshes_ex15.py
+  modifying_meshes_ex16.py
+  modifying_meshes_ex17.py
+  modifying_meshes_ex18.py
+  modifying_meshes_ex19.py
+  modifying_meshes_ex20.py
+  modifying_meshes_ex21.py
+  modifying_meshes_ex22.py
+  modifying_meshes_ex23.py
+  modifying_meshes_ex24.py
+  modifying_meshes_ex25.py
+  prism_3d_algo.py
+  quality_controls_ex01.py
+  quality_controls_ex02.py
+  quality_controls_ex03.py
+  quality_controls_ex04.py
+  quality_controls_ex05.py
+  quality_controls_ex07.py
+  quality_controls_ex08.py
+  quality_controls_ex09.py
+  quality_controls_ex10.py
+  quality_controls_ex11.py
+  quality_controls_ex12.py
+  quality_controls_ex13.py
+  quality_controls_ex14.py
+  quality_controls_ex15.py
+  quality_controls_ex16.py
+  quality_controls_ex17.py
+  quality_controls_ex18.py
+  quality_controls_ex19.py
+  transforming_meshes_ex01.py
+  transforming_meshes_ex02.py
+  transforming_meshes_ex03.py
+  transforming_meshes_ex04.py
+  transforming_meshes_ex05.py
+  transforming_meshes_ex06.py
+  transforming_meshes_ex07.py
+  transforming_meshes_ex08.py
+  transforming_meshes_ex09.py
+  transforming_meshes_ex10.py
+  transforming_meshes_ex11.py
+  transforming_meshes_ex12.py
+  transforming_meshes_ex13.py
+  use_existing_faces.py
+  viewing_meshes_ex02.py
+  split_biquad.py
+)
+
+SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py)
index a6f7701f841ae862ece320927ae95efadc213e67..8184e24508ec36a7b17c80457c64e5d5bdc4ce58 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
 f = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
index bd1a36f613da7a1f467dfafc00f203e48a0ef360..1d973dadb6546d3272457a48ec50cbe6c555b685 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a face to be meshed
 px = geompy.MakeVertex(100., 0.  , 0.  )
@@ -77,4 +77,4 @@ print("Triangles  : ", trias.NbTriangles())
 print("Quadrangles: ", trias.NbQuadrangles())
 print("Volumes    : ", trias.NbVolumes())
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 227eb636e4da210b060f1c45ecdbb6962214eb44..f14c2ca62be8fa4b3aaf7c1d3325d359a303c719 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create two faces of a box
 box1 = geompy.MakeBox(0., 0., -10., 30., 20., 25.)
index 77042de9981579ca6af4b32dea7dc01088d8d9ab..b593e0ef1864813baad55f4501b7ce3c6a545d00 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index ac2707cccfdcfa15ad79466eb55e4d458fb07fee..59403f7db215d44b7748eae8a2359614c8ba62e5 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # make two not sewed quadranges
 OY0 = geompy.MakeVectorDXDYDZ(0, 1, 0)
index 7f6656135d81f32258f4c265491d253fd6e8e624..af3d9ff8e69e96f9521bbf12c7bfb1317278e062 100644 (file)
@@ -4,11 +4,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create two boxes
 box1 = geompy.MakeBox(0.,  0., 0., 10., 10., 10.)
index d827909adf88b947ec4a69c1c176cf8ae852e785..2e6a8c6d5f8c795a0177fe0fb9a4e2d1b3760fd9 100644 (file)
@@ -6,11 +6,11 @@ salome.salome_init()
 
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create a box
 
@@ -92,4 +92,4 @@ mesh.DoubleElements([ 1, 2 ])
 
 # Update object browser
 if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(False)
+    salome.sg.updateObjBrowser()
index 93c06f998305fdeb0a242ab94e7a15986698d75c..072fc3ca1903f124a3f9de36dc80559224221345 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index dfa412358b68796cbd739d0f039d6b046eda15da..12d03892fa8f5fce8012bf9fe7424fdf4a9e4e0b 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 
index c4b95fdafd945440e9733368422c9f6c32f90760..1af8322e308f5279bf3f5201be1573152f1c1c13 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import salome_notebook
 
 import numpy as np
index f61a59af474956cb94d61cc76dffa229a56d08b7..d90d24a3a8f875508bff279b7947f9482d0aa9d2 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
index 2ed0a214b0e3c5b08bd1e9f98defa8d4d4eca198..0dfa09a8557feed77f5746a8bc64d833208ef44b 100644 (file)
@@ -5,11 +5,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create a geometry to mesh
 box = geompy.MakeBoxDXDYDZ(100,100,100)
diff --git a/doc/salome/gui/SMESH/images/prism_mesh.png b/doc/salome/gui/SMESH/images/prism_mesh.png
new file mode 100644 (file)
index 0000000..95a3121
Binary files /dev/null and b/doc/salome/gui/SMESH/images/prism_mesh.png differ
index 6794b398bea21a50f333c7a54e881af35a9223a5..2481807fd0888fdda36ee1c0c880f28b4a8cb8c0 100644 (file)
@@ -19,7 +19,7 @@ and hypotheses.
 
 Mesh generation on the geometry is performed in the bottom-up
 flow: nodes on vertices are created first, then edges are divided into
-segments using nodes on vertices; the node of segments are then
+segments using nodes on vertices; the nodes of segments are then
 used to mesh faces; then the nodes of faces are used to mesh
 solids. This automatically assures the conformity of the mesh.
 
index 59aee72fa5c19cdb56a4512315a3de867f323f40..6d4be7be89942d9ab1c875301c563827ed834f63 100644 (file)
@@ -6,6 +6,8 @@ Extrusion 3D algorithm can be used for meshing prisms, i.e. 3D shapes
 defined by two opposing faces having the same number of vertices and
 edges. These two faces should be connected by quadrangle "side" faces.
 
+\image html prism_mesh.png "Clipping view of a mesh of a prism with non-planar base and top faces"
+
 The prism is allowed to have sides composed of several faces. (A prism
 side is a row of faces (or one face) connecting the corresponding edges of
 the top and base faces). However, a prism 
index 3713fae3752f9ace9d6ba3d5003cc71eba043e98..cf01817583d8da14181e3068a1af450b89b27d91 100644 (file)
@@ -20,13 +20,13 @@ salome.salome_init()
 \n the old mode (from dump):
 \code
 import smesh, SMESH, SALOMEDS
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 \endcode
 \n the new mode:
 \code
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 \endcode
 
 
index 1dc47c40700a8376a71b6627d82a119e42cafe80..5a24ee76ca5cecd844edb715fc3ccd0845ca58e0 100644 (file)
@@ -2,10 +2,10 @@
 
 \page smeshpy_interface_page Python interface
 
-Python API for SALOME %Mesh module defines several classes that can
+Python API of SALOME %Mesh module defines several classes that can
 be used for easy mesh creation and edition.
 
-Documentation for SALOME %Mesh module Python API is available in two forms:
+Documentation of SALOME %Mesh module Python API is available in two forms:
 - <a href="smeshpy_doc/modules.html">Structured documentation</a>, where all methods and
 classes are grouped by their functionality.
 - <a href="smeshpy_doc/namespaces.html">Linear documentation</a> grouped only by classes, declared
@@ -28,7 +28,7 @@ A usual workflow to generate a mesh on geometry is following:
   <li>Create an instance of \ref smeshBuilder.smeshBuilder "smeshBuilder":
     <pre>
       from salome.smesh import smeshBuilder
-      smesh = smeshBuilder.New( salome.myStudy )
+      smesh = smeshBuilder.New()
     </pre></li>
   <li>Create a \ref smeshBuilder.Mesh "mesh" object:
     <pre>
index 75fbe089438725870291f755776561e9d291be8d..dc943334698ecd3e2cc9aeef8a44208d6834d87a 100644 (file)
@@ -139,14 +139,19 @@ module SMESH
     boolean IsEmbeddedMode();
 
     /*!
-      Set the current study
+      Update the study
      */
-    void SetCurrentStudy( in SALOMEDS::Study theStudy );
-
+    void UpdateStudy();
+    
+    /*!
+      Set enable publishing in the study
+     */
+    void SetEnablePublish( in boolean theIsEnablePublish );
+    
     /*!
-      Get the current study
+      Get enable publishing in the study
      */
-    SALOMEDS::Study GetCurrentStudy();
+    boolean IsEnablePublish();
 
     /*!
      * Create a hypothesis that can be shared by differents parts of the mesh.
index 2246473ead9fd12097744bc7332de2f2f2b708b0..28f0f7e903e18bc04ae9aaa4602b0edbbadf6229 100644 (file)
@@ -597,11 +597,6 @@ module SMESH
      */
     long GetId();
 
-    /*!
-     * Get the study Id
-     */
-    long GetStudyId();
-
     /*!
      * Obtain instance of SMESH_MeshEditor
      */
@@ -975,6 +970,11 @@ module SMESH
      */
     long FindElementByNodes(in long_array nodes);
 
+    /*!
+     * Return elements including all given nodes.
+     */
+    long_array GetElementsByNodes(in long_array nodes, in ElementType elem_type);
+
     /*!
      * Returns true if given element is polygon
      */
index a1d573d7f51c8af47b62f40587d7c53e21a74ccc..3e18f1535d40f54c5ea2475f4ba38018c1b9a25c 100644 (file)
             <service-by-default>0</service-by-default>
             <inParameter-list>
               <inParameter>
-               <inParameter-type>string</inParameter-type>
-               <inParameter-name>anHyp</inParameter-name>
-               <inParameter-comment></inParameter-comment>
-              </inParameter>
-              <inParameter>
-               <inParameter-type>long</inParameter-type>
-               <inParameter-name>studyId</inParameter-name>
-               <inParameter-comment></inParameter-comment>
+                <inParameter-type>string</inParameter-type>
+                <inParameter-name>anHyp</inParameter-name>
+                <inParameter-comment></inParameter-comment>
               </inParameter>
             </inParameter-list>
             <outParameter-list>
               <inParameter-name>geomEngine</inParameter-name>
               <inParameter-comment></inParameter-comment>
             </inParameter>
-            <inParameter>
-              <inParameter-type>long</inParameter-type>
-              <inParameter-name>studyId</inParameter-name>
-              <inParameter-comment></inParameter-comment>
-            </inParameter>
             <inParameter>
               <inParameter-type>GEOM/GEOM_Object</inParameter-type>
               <inParameter-name>aShape</inParameter-name>
index a45696d7e9a4e6059276eb03d76a41930f92f374..8096b1609fbc22ee5829b729af09cd414f5f4c56 100644 (file)
 
 #include <vtkCellArray.h>
 #include <vtkCellData.h>
+#include <vtkLookupTable.h>
 #include <vtkObjectFactory.h>
 #include <vtkPolyData.h>
 #include <vtkPolyDataMapper2D.h>
+#include <vtkProperty2D.h>
 #include <vtkScalarsToColors.h>
 #include <vtkTextMapper.h>
 #include <vtkTextProperty.h>
 #include <vtkViewport.h>
 #include <vtkWindow.h>
-#include <vtkLookupTable.h>
-#include <vtkProperty2D.h>
 
 #define SHRINK_COEF 0.08;
 
@@ -51,13 +51,14 @@ vtkCxxSetObjectMacro(SMESH_ScalarBarActor,TitleTextProperty,vtkTextProperty);
 // Instantiate object with 64 maximum colors; 5 labels; %%-#6.3g label
 // format, no title, and vertical orientation. The initial scalar bar
 // size is (0.05 x 0.8) of the viewport size.
-SMESH_ScalarBarActor::SMESH_ScalarBarActor() {
+SMESH_ScalarBarActor::SMESH_ScalarBarActor()
+{
   this->LookupTable = NULL;
   this->Position2Coordinate->SetValue(0.17, 0.8);
-  
+
   this->PositionCoordinate->SetCoordinateSystemToNormalizedViewport();
   this->PositionCoordinate->SetValue(0.82,0.1);
-  
+
   this->MaximumNumberOfColors = 64;
   this->NumberOfLabels = 5;
   this->NumberOfLabelsBuilt = 0;
@@ -74,7 +75,7 @@ SMESH_ScalarBarActor::SMESH_ScalarBarActor() {
   this->TitleTextProperty = vtkTextProperty::New();
   this->TitleTextProperty->ShallowCopy(this->LabelTextProperty);
 
-  this->LabelFormat = new char[8]; 
+  this->LabelFormat = new char[8];
   sprintf(this->LabelFormat,"%s","%-#6.3g");
 
   this->TitleMapper = vtkTextMapper::New();
@@ -82,7 +83,7 @@ SMESH_ScalarBarActor::SMESH_ScalarBarActor() {
   this->TitleActor->SetMapper(this->TitleMapper);
   this->TitleActor->GetPositionCoordinate()->
     SetReferenceCoordinate(this->PositionCoordinate);
-  
+
   this->TextMappers = NULL;
   this->TextActors = NULL;
 
@@ -104,7 +105,7 @@ SMESH_ScalarBarActor::SMESH_ScalarBarActor() {
   myDistribution = vtkPolyData::New();
   myDistributionMapper = vtkPolyDataMapper2D::New();
   myDistributionMapper->SetInputData(this->myDistribution);
-  
+
   myDistributionActor = vtkActor2D::New();
   myDistributionActor->SetMapper(this->myDistributionMapper);
   myDistributionActor->GetPositionCoordinate()->
@@ -129,12 +130,12 @@ void SMESH_ScalarBarActor::ReleaseGraphicsResources(vtkWindow *win)
 {
   this->TitleActor->ReleaseGraphicsResources(win);
   if (this->TextMappers != NULL )
-    {
+  {
     for (int i=0; i < this->NumberOfLabelsBuilt; i++)
-      {
+    {
       this->TextActors[i]->ReleaseGraphicsResources(win);
-      }
     }
+  }
   this->ScalarBarActor->ReleaseGraphicsResources(win);
   // rnv begin
   // Customization of the vtkScalarBarActor to show distribution histogram.
@@ -143,41 +144,42 @@ void SMESH_ScalarBarActor::ReleaseGraphicsResources(vtkWindow *win)
 
 
 /*--------------------------------------------------------------------------*/
-SMESH_ScalarBarActor::~SMESH_ScalarBarActor() {
-  if (this->LabelFormat) 
-    {
+SMESH_ScalarBarActor::~SMESH_ScalarBarActor()
+{
+  if (this->LabelFormat)
+  {
     delete [] this->LabelFormat;
     this->LabelFormat = NULL;
-    }
+  }
 
   this->TitleMapper->Delete();
   this->TitleActor->Delete();
 
   if (this->TextMappers != NULL )
-    {
+  {
     for (int i=0; i < this->NumberOfLabelsBuilt; i++)
-      {
+    {
       this->TextMappers[i]->Delete();
       this->TextActors[i]->Delete();
-      }
+    }
     delete [] this->TextMappers;
     delete [] this->TextActors;
-    }
+  }
 
   this->ScalarBar->Delete();
   this->ScalarBarMapper->Delete();
   this->ScalarBarActor->Delete();
 
   if (this->Title)
-    {
+  {
     delete [] this->Title;
     this->Title = NULL;
-    }
-  
+  }
+
   this->SetLookupTable(NULL);
   this->SetLabelTextProperty(NULL);
   this->SetTitleTextProperty(NULL);
-  
+
   // rnv begin
   // Customization of the vtkScalarBarActor to show distribution histogram:
   myDistribution->Delete();
@@ -191,26 +193,26 @@ int SMESH_ScalarBarActor::RenderOverlay(vtkViewport *viewport)
 {
   int renderedSomething = 0;
   int i;
-  
+
   // Everything is built, just have to render
   if (this->Title != NULL)
-    {
+  {
     renderedSomething += this->TitleActor->RenderOverlay(viewport);
-    }
-  if (!myTitleOnlyVisibility) {
+  }
+  if ( !myTitleOnlyVisibility ) {
     this->ScalarBarActor->RenderOverlay(viewport);
     this->myDistributionActor->RenderOverlay(viewport);
-    if( this->TextActors == NULL)
-      {
-       vtkWarningMacro(<<"Need a mapper to render a scalar bar");
-       return renderedSomething;
-      }
-  
-    for (i=0; i<this->NumberOfLabels; i++)
-      {
+    if ( this->TextActors == NULL )
+    {
+      vtkWarningMacro(<<"Need a mapper to render a scalar bar");
+      return renderedSomething;
+    }
+
+    for ( i=0; i<this->NumberOfLabels; i++ )
+    {
       renderedSomething += this->TextActors[i]->RenderOverlay(viewport);
-      }
-  }  
+    }
+  }
   renderedSomething = (renderedSomething > 0)?(1):(0);
 
   return renderedSomething;
@@ -223,75 +225,75 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
   int renderedSomething = 0;
   int i;
   int size[2];
-  
+
   if (!this->LookupTable)
-    {
+  {
     vtkWarningMacro(<<"Need a mapper to render a scalar bar");
     return 0;
-    }
+  }
 
   if (!this->TitleTextProperty)
-    {
+  {
     vtkErrorMacro(<<"Need title text property to render a scalar bar");
     return 0;
-    }
+  }
 
   if (!this->LabelTextProperty)
-    {
+  {
     vtkErrorMacro(<<"Need label text property to render a scalar bar");
     return 0;
-    }
+  }
 
   // Check to see whether we have to rebuild everything
   int positionsHaveChanged = 0;
-  if (viewport->GetMTime() > this->BuildTime || 
-      (viewport->GetVTKWindow() && 
+  if (viewport->GetMTime() > this->BuildTime ||
+      (viewport->GetVTKWindow() &&
        viewport->GetVTKWindow()->GetMTime() > this->BuildTime))
-    {
+  {
     // if the viewport has changed we may - or may not need
     // to rebuild, it depends on if the projected coords chage
     int *barOrigin;
     barOrigin = this->PositionCoordinate->GetComputedViewportValue(viewport);
-    size[0] = 
+    size[0] =
       this->Position2Coordinate->GetComputedViewportValue(viewport)[0] -
       barOrigin[0];
-    size[1] = 
+    size[1] =
       this->Position2Coordinate->GetComputedViewportValue(viewport)[1] -
       barOrigin[1];
-    if (this->LastSize[0] != size[0] || 
+    if (this->LastSize[0] != size[0] ||
         this->LastSize[1] != size[1] ||
-        this->LastOrigin[0] != barOrigin[0] || 
+        this->LastOrigin[0] != barOrigin[0] ||
         this->LastOrigin[1] != barOrigin[1])
-      {
+    {
       positionsHaveChanged = 1;
-      }
     }
-  
+  }
+
   // Check to see whether we have to rebuild everything
-  if (positionsHaveChanged ||
-      this->GetMTime() > this->BuildTime || 
-      this->LookupTable->GetMTime() > this->BuildTime ||
-      this->LabelTextProperty->GetMTime() > this->BuildTime ||
-      this->TitleTextProperty->GetMTime() > this->BuildTime)
-    {
+  if ( positionsHaveChanged ||
+       this->GetMTime() > this->BuildTime ||
+       this->LookupTable->GetMTime() > this->BuildTime ||
+       this->LabelTextProperty->GetMTime() > this->BuildTime ||
+       this->TitleTextProperty->GetMTime() > this->BuildTime)
+  {
     vtkDebugMacro(<<"Rebuilding subobjects");
 
     // Delete previously constructed objects
     //
-    if (this->TextMappers != NULL )
+    if ( this->TextMappers != NULL )
+    {
+      for ( i = 0; i < this->NumberOfLabelsBuilt; i++ )
       {
-      for (i=0; i < this->NumberOfLabelsBuilt; i++)
-        {
         this->TextMappers[i]->Delete();
         this->TextActors[i]->Delete();
-        }
+      }
       delete [] this->TextMappers;
       delete [] this->TextActors;
-      }
+    }
 
     // Build scalar bar object; determine its type
     //
-    // is this a vtkLookupTable or a subclass of vtkLookupTable 
+    // is this a vtkLookupTable or a subclass of vtkLookupTable
     // with its scale set to log
     // NOTE: it's possible we could to without the 'lut' variable
     // later in the code, but if the vtkLookupTableSafeDownCast operation
@@ -300,13 +302,13 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     vtkLookupTable *LUT = vtkLookupTable::SafeDownCast( this->LookupTable );
     int isLogTable = 0;
     if ( LUT )
-      {
+    {
       if ( LUT->GetScale() == VTK_SCALE_LOG10 )
-        {
-        isLogTable = 1; 
-        }
+      {
+        isLogTable = 1;
       }
-    
+    }
+
     // we hard code how many steps to display
     vtkScalarsToColors *lut = this->LookupTable;
     int numColors = this->MaximumNumberOfColors;
@@ -332,7 +334,8 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     if(!distrVisibility)
       vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()");
 
-    if ( distrVisibility && GetDistributionVisibility() ) {
+    if ( distrVisibility && GetDistributionVisibility() )
+    {
       for ( i = 0 ; i < (int)myNbValues.size(); i++ ) {
         if ( myNbValues[i] ) {
           numPositiveVal++;
@@ -349,16 +352,21 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       this->myDistribution->SetPolys(distrPolys);
       distrPts->Delete();
       distrPolys->Delete();
-      if ( myDistributionColoringType == SMESH_MULTICOLOR_TYPE ) {
+      if ( myDistributionColoringType == SMESH_MULTICOLOR_TYPE )
+      {
         distColors = vtkUnsignedCharArray::New();
         distColors->SetNumberOfComponents(3);
         distColors->SetNumberOfTuples(numPositiveVal);
         this->myDistribution->GetCellData()->SetScalars(distColors);
         distColors->Delete();
-      } else if( myDistributionColoringType == SMESH_MONOCOLOR_TYPE ){
+      }
+      else if( myDistributionColoringType == SMESH_MONOCOLOR_TYPE )
+      {
         this->myDistribution->GetCellData()->SetScalars(NULL);
       }
-    } else {
+    }
+    else
+    {
       myDistribution->Reset();
     }
     // rnv end
@@ -373,22 +381,22 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     // get the viewport size in display coordinates
     int *barOrigin, barWidth, barHeight, distrHeight;
     barOrigin = this->PositionCoordinate->GetComputedViewportValue(viewport);
-    size[0] = 
+    size[0] =
       this->Position2Coordinate->GetComputedViewportValue(viewport)[0] -
       barOrigin[0];
-    size[1] = 
+    size[1] =
       this->Position2Coordinate->GetComputedViewportValue(viewport)[1] -
       barOrigin[1];
     this->LastOrigin[0] = barOrigin[0];
     this->LastOrigin[1] = barOrigin[1];
     this->LastSize[0] = size[0];
     this->LastSize[1] = size[1];
-    
+
     // Update all the composing objects
     this->TitleActor->SetProperty(this->GetProperty());
     this->TitleMapper->SetInput(this->Title);
     if (this->TitleTextProperty->GetMTime() > this->BuildTime)
-      {
+    {
       // Shallow copy here so that the size of the title prop is not affected
       // by the automatic adjustment of its text mapper's size (i.e. its
       // mapper's text property is identical except for the font size
@@ -397,17 +405,17 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       // the title and label text prop to be the same.
       this->TitleMapper->GetTextProperty()->ShallowCopy(this->TitleTextProperty);
       this->TitleMapper->GetTextProperty()->SetJustificationToCentered();
-      }
-    
+    }
+
     // find the best size for the title font
     int titleSize[2];
     this->SizeTitle(titleSize, size, viewport);
-    
+
     // find the best size for the ticks
     int labelSize[2];
     this->AllocateAndSizeLabels(labelSize, size, viewport,range);
     this->NumberOfLabelsBuilt = this->NumberOfLabels;
-    
+
     // generate points
     double x[3]; x[2] = 0.0;
     double delta, itemH, shrink;
@@ -426,7 +434,7 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
 
       barHeight = (int)(0.86*size[1]);
       delta=(double)barHeight/numColors;
-      
+
       for ( i=0; i<numPts/2; i++ ) {
         x[0] = distrHeight+delimeter/2.0;
         x[1] = i*delta;
@@ -435,22 +443,22 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
         pts->SetPoint(2*i+1,x);
       }
 
-      if(GetDistributionVisibility() && distrVisibility) {
-        // Distribution points 
+      if ( GetDistributionVisibility() && distrVisibility ) {
+        // Distribution points
         shrink = delta*SHRINK_COEF;
         vtkIdType distPtsId=0;
         vtkIdType distPtsIds[4];
-        for(i=0; i<numColors; i++) {
-          if(myNbValues[i]) {
+        for ( i = 0; i < numColors; i++ ) {
+          if ( myNbValues[i] ) {
             itemH = distrHeight*((double)myNbValues[i]/maxValue);
-            
-            if(distrHeight == itemH) 
+
+            if(distrHeight == itemH)
               itemH = itemH - delimeter/2;
 
             x[1] = i*delta+shrink;
 
             // first point of polygon (quadrangle)
-            x[0] = 0; 
+            x[0] = 0;
             distPtsIds[0] = distPtsId;
             distrPts->SetPoint(distPtsId++,x);
 
@@ -462,7 +470,7 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
             x[1] = i*delta+delta-shrink;
 
             // third point of polygon (quadrangle)
-            x[0] = 0; 
+            x[0] = 0;
             distPtsIds[3] = distPtsId;
             distrPts->SetPoint(distPtsId++,x);
 
@@ -475,19 +483,19 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
             distrPolys->InsertNextCell(4,distPtsIds);
           }
         }
-      }    
+      }
     }
     // rnv end
     else {
       barWidth = size[0];
-      
+
       // rnv begin
       // Customization of the vtkScalarBarActor to show distribution histogram.
       double coef1, delimeter=0.0;
-      if(GetDistributionVisibility() && distrVisibility) {
+      if ( GetDistributionVisibility() && distrVisibility ) {
         coef1=0.62;
         distrHeight = (int)((coef1/2)*size[1]);
-        //delimeter between distribution diagram and scalar bar 
+        //delimeter between distribution diagram and scalar bar
         delimeter=0.02*size[1];
       }
       else {
@@ -495,64 +503,64 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
         barHeight = (int)(coef1*size[1]);
         distrHeight = 0;
       }
-      
+
       barHeight = (int)(coef1*size[1]);
-      
+
       delta=(double)barWidth/numColors;
-      for (i=0; i<numPts/2; i++) {
+      for ( i = 0; i < numPts/2; i++ ) {
         x[0] = i*delta;
         x[1] = barHeight;
-        pts->SetPoint(2*i,x);                        
+        pts->SetPoint(2*i,x);
         x[1] = distrHeight + delimeter;
         pts->SetPoint(2*i+1,x);
       }
-      
-      if(GetDistributionVisibility() && distrVisibility) {
-        // Distribution points 
+
+      if ( GetDistributionVisibility() && distrVisibility ) {
+        // Distribution points
         shrink = delta*SHRINK_COEF;
         vtkIdType distPtsId=0;
         vtkIdType distPtsIds[4];
-        for(i=0; i<numColors; i++) {
+        for ( i = 0; i < numColors; i++ ) {
           if(myNbValues[i]) {
             itemH = distrHeight*((double)myNbValues[i]/maxValue);
-            
+
             // first point of polygon (quadrangle)
-            x[0] = i*delta+shrink; 
+            x[0] = i*delta+shrink;
             x[1] = 0;
             distPtsIds[0] = distPtsId;
             distrPts->SetPoint(distPtsId++,x);
-            
+
             // second point of polygon (quadrangle)
-            x[0] = i*delta+shrink; 
+            x[0] = i*delta+shrink;
             x[1] = itemH;
             distPtsIds[3] = distPtsId;
             distrPts->SetPoint(distPtsId++,x);
-            
+
             // third point of polygon (quadrangle)
-            x[0] = i*delta+delta-shrink; 
+            x[0] = i*delta+delta-shrink;
             x[1] = 0;
             distPtsIds[1] = distPtsId;
             distrPts->SetPoint(distPtsId++,x);
-            
+
             // fourth point of polygon (quadrangle)
-            x[0] = i*delta+delta-shrink; 
+            x[0] = i*delta+delta-shrink;
             x[1] = itemH;
             distPtsIds[2] = distPtsId;
             distrPts->SetPoint(distPtsId++,x);
-            
+
             // Add polygon into poly data
             distrPolys->InsertNextCell(4,distPtsIds);
           }
-        } 
+        }
       }
       // rnv end
     }
-    
+
     //polygons & cell colors
     unsigned char *rgba, *rgb;
     vtkIdType ptIds[4], dcCount=0;
-    for (i=0; i<numColors; i++)
-      {
+    for ( i = 0; i < numColors; i++ )
+    {
       ptIds[0] = 2*i;
       ptIds[1] = ptIds[0] + 1;
       ptIds[2] = ptIds[1] + 2;
@@ -560,22 +568,22 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       polys->InsertNextCell(4,ptIds);
 
       if ( isLogTable )
-        {
-        double rgbval = log10(range[0]) + 
+      {
+        double rgbval = log10(range[0]) +
           i*(log10(range[1])-log10(range[0]))/(numColors -1);
         rgba = lut->MapValue(pow(10.0,rgbval));
-        }
+      }
       else
-        {
+      {
         rgba = lut->MapValue(range[0] + (range[1] - range[0])*
                              ((double)i /(numColors-1.0)));
-        }
+      }
 
       rgb = colors->GetPointer(3*i); //write into array directly
       rgb[0] = rgba[0];
       rgb[1] = rgba[1];
       rgb[2] = rgba[2];
-      
+
       // rnv begin
       // Customization of the vtkScalarBarActor to show distribution histogram.
       if ( myDistributionColoringType == SMESH_MULTICOLOR_TYPE &&
@@ -594,62 +602,62 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     // Now position everything properly
     //
     double val;
-    if (this->Orientation == VTK_ORIENT_VERTICAL)
-      {
+    if ( this->Orientation == VTK_ORIENT_VERTICAL )
+    {
       int sizeTextData[2];
-      
+
       // center the title
       this->TitleActor->SetPosition(size[0]/2, 0.9*size[1]);
-      
-      for (i=0; i < this->NumberOfLabels; i++)
+
+      for ( i = 0; i < this->NumberOfLabels; i++ )
+      {
+        if ( this->NumberOfLabels > 1 )
         {
-        if (this->NumberOfLabels > 1)
-          {
           val = (double)i/(this->NumberOfLabels-1) *barHeight;
-          }
-        else 
-          {
+        }
+        else
+        {
           val = 0.5*barHeight;
-          }
+        }
         this->TextMappers[i]->GetSize(viewport,sizeTextData);
         this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft();
         this->TextActors[i]->SetPosition(barWidth+3,
                                          val - sizeTextData[1]/2);
-        }
       }
+    }
     else
-      {
-      this->TitleActor->SetPosition(size[0]/2, 
+    {
+      this->TitleActor->SetPosition(size[0]/2,
                                     barHeight + labelSize[1] + 0.1*size[1]);
-      for (i=0; i < this->NumberOfLabels; i++)
-        {
+      for ( i = 0; i < this->NumberOfLabels; i++ )
+      {
         this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered();
         if (this->NumberOfLabels > 1)
-          {
+        {
           val = (double)i/(this->NumberOfLabels-1) * barWidth;
-          }
+        }
         else
-          {
+        {
           val = 0.5*barWidth;
-          }
-        this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
         }
+        this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
       }
+    }
 
     this->BuildTime.Modified();
-    }
+  }
 
   // Everything is built, just have to render
-  if (this->Title != NULL)
-    {
+  if ( this->Title != NULL )
+  {
     renderedSomething += this->TitleActor->RenderOpaqueGeometry(viewport);
-    }
+  }
   this->ScalarBarActor->RenderOpaqueGeometry(viewport);
   this->myDistributionActor->RenderOpaqueGeometry(viewport);
-  for (i=0; i<this->NumberOfLabels; i++)
-    {
+  for ( i = 0; i < this->NumberOfLabels; i++ )
+  {
     renderedSomething += this->TextActors[i]->RenderOpaqueGeometry(viewport);
-    }
+  }
 
   renderedSomething = (renderedSomething > 0)?(1):(0);
 
@@ -662,50 +670,50 @@ void SMESH_ScalarBarActor::PrintSelf(ostream& os, vtkIndent indent)
   this->Superclass::PrintSelf(os,indent);
 
   if ( this->LookupTable )
-    {
+  {
     os << indent << "Lookup Table:\n";
     this->LookupTable->PrintSelf(os,indent.GetNextIndent());
-    }
+  }
   else
-    {
+  {
     os << indent << "Lookup Table: (none)\n";
-    }
+  }
 
   if (this->TitleTextProperty)
-    {
+  {
     os << indent << "Title Text Property:\n";
     this->TitleTextProperty->PrintSelf(os,indent.GetNextIndent());
-    }
+  }
   else
-    {
+  {
     os << indent << "Title Text Property: (none)\n";
-    }
+  }
 
   if (this->LabelTextProperty)
-    {
+  {
     os << indent << "Label Text Property:\n";
     this->LabelTextProperty->PrintSelf(os,indent.GetNextIndent());
-    }
+  }
   else
-    {
+  {
     os << indent << "Label Text Property: (none)\n";
-    }
+  }
 
   os << indent << "Title: " << (this->Title ? this->Title : "(none)") << "\n";
-  os << indent << "Maximum Number Of Colors: " 
+  os << indent << "Maximum Number Of Colors: "
      << this->MaximumNumberOfColors << "\n";
   os << indent << "Number Of Labels: " << this->NumberOfLabels << "\n";
   os << indent << "Number Of Labels Built: " << this->NumberOfLabelsBuilt << "\n";
 
   os << indent << "Orientation: ";
   if ( this->Orientation == VTK_ORIENT_HORIZONTAL )
-    {
+  {
     os << "Horizontal\n";
-    }
+  }
   else
-    {
+  {
     os << "Vertical\n";
-    }
+  }
 
   os << indent << "Label Format: " << this->LabelFormat << "\n";
 }
@@ -715,7 +723,7 @@ void SMESH_ScalarBarActor::ShallowCopy(vtkProp *prop)
 {
   SMESH_ScalarBarActor *a = SMESH_ScalarBarActor::SafeDownCast(prop);
   if ( a != NULL )
-    {
+  {
     this->SetPosition2(a->GetPosition2());
     this->SetLookupTable(a->GetLookupTable());
     this->SetMaximumNumberOfColors(a->GetMaximumNumberOfColors());
@@ -724,25 +732,25 @@ void SMESH_ScalarBarActor::ShallowCopy(vtkProp *prop)
     this->SetTitleTextProperty(a->GetTitleTextProperty());
     this->SetLabelFormat(a->GetLabelFormat());
     this->SetTitle(a->GetTitle());
-    this->GetPositionCoordinate()->SetCoordinateSystem(
-      a->GetPositionCoordinate()->GetCoordinateSystem());    
-    this->GetPositionCoordinate()->SetValue(
-      a->GetPositionCoordinate()->GetValue());
-    this->GetPosition2Coordinate()->SetCoordinateSystem(
-      a->GetPosition2Coordinate()->GetCoordinateSystem());    
-    this->GetPosition2Coordinate()->SetValue(
-      a->GetPosition2Coordinate()->GetValue());
-    }
+    this->GetPositionCoordinate()->SetCoordinateSystem
+      (a->GetPositionCoordinate()->GetCoordinateSystem());
+    this->GetPositionCoordinate()->SetValue
+      (a->GetPositionCoordinate()->GetValue());
+    this->GetPosition2Coordinate()->SetCoordinateSystem
+      (a->GetPosition2Coordinate()->GetCoordinateSystem());
+    this->GetPosition2Coordinate()->SetValue
+      (a->GetPosition2Coordinate()->GetValue());
+  }
 
   // Now do superclass
   this->vtkActor2D::ShallowCopy(prop);
 }
 
 //----------------------------------------------------------------------------
-void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, 
-                                              int *size,
-                                              vtkViewport *viewport,
-                                              double *range)
+void SMESH_ScalarBarActor::AllocateAndSizeLabels(int         *labelSize,
+                                                 int         *size,
+                                                 vtkViewport *viewport,
+                                                 double      *range)
 {
   labelSize[0] = labelSize[1] = 0;
 
@@ -753,55 +761,55 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize,
 
   double val;
   int i;
-  
+
   // TODO: this should be optimized, maybe by keeping a list of
   // allocated mappers, in order to avoid creation/destruction of
   // their underlying text properties (i.e. each time a mapper is
   // created, text properties are created and shallow-assigned a font size
   // which value might be "far" from the target font size).
 
-  // is this a vtkLookupTable or a subclass of vtkLookupTable 
+  // is this a vtkLookupTable or a subclass of vtkLookupTable
   // with its scale set to log
   vtkLookupTable *LUT = vtkLookupTable::SafeDownCast( this->LookupTable );
   int isLogTable = 0;
   if ( LUT )
-    {
+  {
     if ( LUT->GetScale() == VTK_SCALE_LOG10 )
-      {
-      isLogTable = 1; 
-      }
+    {
+      isLogTable = 1;
     }
+  }
 
-  for (i=0; i < this->NumberOfLabels; i++)
-    {
+  for ( i = 0; i < this->NumberOfLabels; i++ )
+  {
     this->TextMappers[i] = vtkTextMapper::New();
 
     if ( isLogTable )
-      {
+    {
       double lval;
-      if (this->NumberOfLabels > 1)
-        {
+      if ( this->NumberOfLabels > 1 )
+      {
         lval = log10(range[0]) + (double)i/(this->NumberOfLabels-1) *
           (log10(range[1])-log10(range[0]));
-        }
+      }
       else
-        {
+      {
         lval = log10(range[0]) + 0.5*(log10(range[1])-log10(range[0]));
-        }
-      val = pow(10.0,lval);
       }
+      val = pow(10.0,lval);
+    }
     else
+    {
+      if ( this->NumberOfLabels > 1 )
       {
-      if (this->NumberOfLabels > 1)
-        {
-        val = range[0] + 
+        val = range[0] +
           (double)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
-        }
+      }
       else
-        {
+      {
         val = range[0] + 0.5*(range[1]-range[0]);
-        }
       }
+    }
 
     sprintf(string, this->LabelFormat, val);
     this->TextMappers[i]->SetInput(string);
@@ -812,64 +820,63 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize,
     // which will be modified later). This allows text actors to
     // share the same text property, and in that case specifically allows
     // the title and label text prop to be the same.
-    this->TextMappers[i]->GetTextProperty()->ShallowCopy(
-      this->LabelTextProperty);
+    this->TextMappers[i]->GetTextProperty()->ShallowCopy(this->LabelTextProperty);
 
     this->TextActors[i] = vtkActor2D::New();
     this->TextActors[i]->SetMapper(this->TextMappers[i]);
     this->TextActors[i]->SetProperty(this->GetProperty());
     this->TextActors[i]->GetPositionCoordinate()->
       SetReferenceCoordinate(this->PositionCoordinate);
-    }
+  }
 
-  if (this->NumberOfLabels)
-    {
+  if ( this->NumberOfLabels )
+  {
     int targetWidth, targetHeight;
     // rnv begin
     // Customization of the vtkScalarBarActor to show distribution histogram.
     bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() );
     double coef;
-    if( GetDistributionVisibility() && distrVisibility )
-      if(this->Orientation == VTK_ORIENT_VERTICAL)
+    if ( GetDistributionVisibility() && distrVisibility )
+      if ( this->Orientation == VTK_ORIENT_VERTICAL )
         coef = 0.4;
-      else 
+      else
         coef = 0.18;
-    else 
-      if(this->Orientation == VTK_ORIENT_VERTICAL)
+    else
+      if (this->Orientation == VTK_ORIENT_VERTICAL )
         coef = 0.6;
-      else 
+      else
         coef=0.25;
 
 
     if ( this->Orientation == VTK_ORIENT_VERTICAL )
-      {
+    {
       targetWidth = (int)(coef*size[0]);
       targetHeight = (int)(0.86*size[1]/this->NumberOfLabels);
-      }
+    }
     else
-      {
+    {
       targetWidth = (int)(size[0]*0.8/this->NumberOfLabels);
       targetHeight = (int)(coef*size[1]);
-      }
-    // rnv end
-    
-    vtkTextMapper::SetMultipleConstrainedFontSize(viewport, 
-                                                  targetWidth, 
-                                                  targetHeight,
-                                                  this->TextMappers,
-                                                  this->NumberOfLabels,
-                                                  labelSize);
     }
+    // rnv end
+
+    vtkTextMapper::SetMultipleConstrainedFontSize( viewport,
+                                                   targetWidth,
+                                                   targetHeight,
+                                                   this->TextMappers,
+                                                   this->NumberOfLabels,
+                                                   labelSize );
+  }
 }
 
 //----------------------------------------------------------------------------
-void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
-                                     int *size,
+void SMESH_ScalarBarActor::SizeTitle(int         *titleSize,
+                                     int         *size,
                                      vtkViewport *viewport)
 {
   titleSize[0] = titleSize[1] = 0;
 
-  if (this->Title == NULL || !strlen(this->Title))
+  if ( this->Title == NULL || !strlen(this->Title) )
   {
     return;
   }
@@ -902,36 +909,43 @@ void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
 
 
 /*--------------------------------------------------------------------------*/
-void SMESH_ScalarBarActor::SetDistributionVisibility(int flag) {
-  myDistributionActor->SetVisibility(flag);
+void SMESH_ScalarBarActor::SetDistributionVisibility( int flag )
+{
+  myDistributionActor->SetVisibility( flag );
   Modified();
 }
 
 
 /*--------------------------------------------------------------------------*/
-int SMESH_ScalarBarActor::GetDistributionVisibility() {
+int SMESH_ScalarBarActor::GetDistributionVisibility()
+{
   return myDistributionActor->GetVisibility();
 }
 
 
-void SMESH_ScalarBarActor::SetDistribution(std::vector<int> theNbValues) {
+void SMESH_ScalarBarActor::SetDistribution( const std::vector<int>& theNbValues )
+{
   myNbValues = theNbValues;
-} 
+}
 
 
-void SMESH_ScalarBarActor::SetDistributionColor (double rgb[3]) {
+void SMESH_ScalarBarActor::SetDistributionColor( double rgb[3] )
+{
   myDistributionActor->GetProperty()->SetColor(rgb);
   Modified();
 }
 
-void SMESH_ScalarBarActor::GetDistributionColor (double rgb[3]) {
+void SMESH_ScalarBarActor::GetDistributionColor( double rgb[3] )
+{
   myDistributionActor->GetProperty()->GetColor(rgb);
 }
 
-void SMESH_ScalarBarActor::SetTitleOnlyVisibility( bool theTitleOnlyVisibility) {
+void SMESH_ScalarBarActor::SetTitleOnlyVisibility( bool theTitleOnlyVisibility )
+{
   myTitleOnlyVisibility = theTitleOnlyVisibility;
 }
 
-bool SMESH_ScalarBarActor::GetTitleOnlyVisibility() {
+bool SMESH_ScalarBarActor::GetTitleOnlyVisibility()
+{
   return myTitleOnlyVisibility;
 }
index ffc91bb118b54aef89cd046e5d3c5991ad9ef377..c5e721b2374fe5cb47bc942fcb2a44eae628f2a0 100644 (file)
@@ -174,7 +174,7 @@ class SMESHOBJECT_EXPORT SMESH_ScalarBarActor: public vtkActor2D {
   virtual int GetDistributionVisibility();
   // Description:
   // Set distribution
-  virtual void SetDistribution(std::vector<int> theNbValues);
+  virtual void SetDistribution(const std::vector<int>& theNbValues);
   
   // Description: 
   // Set distribution coloring type (SMESH_MONOCOLOR_TYPE or SMESH_MULTICOLOR_TYPE)
index 0a9be930932a69e3e95ac543e7661c1813c439b0..32240fb47e7ad4c531bbe295ee18dd3cbb2776c7 100644 (file)
 
 /*!
  * Constructor
- * @param aStudy pointer to the Study
  *
  */
-GeomSelectionTools::GeomSelectionTools(_PTR(Study) aStudy)
+GeomSelectionTools::GeomSelectionTools()
 {
-  myStudy = aStudy;
-}
-
-/*!
- * Accessor to the Study used by this GeomSelectionTools object
- * @return The study used by the GeomSelectionTools class
- */
-_PTR(Study) GeomSelectionTools::getMyStudy()
-{
-    return myStudy;
 }
 
 /*!
@@ -137,7 +126,7 @@ std::string GeomSelectionTools::getFirstSelectedEntry()
  */
 std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject) anIO){
   std::string entry="";
-  _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+  _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(anIO->getEntry());
   if (aSO){
     _PTR(SObject) aRefSObj;
     // If selected object is a reference
@@ -157,7 +146,7 @@ std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject
  */
 std::string GeomSelectionTools::getNameFromEntry(std::string entry){
   std::string name = "";
-  _PTR(SObject) aSO = myStudy->FindObjectID(entry);
+  _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(entry);
   if (aSO){
     _PTR(SObject) aRefSObj;
     // If selected object is a reference
@@ -180,7 +169,7 @@ std::string GeomSelectionTools::getFirstSelectedComponentDataType()
   Handle(SALOME_InteractiveObject) anIO;
   std::string DataType="";
   anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
-  _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+  _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(anIO->getEntry());
   if (aSO){
     _PTR(SObject) aRefSObj;
     // If selected object is a reference
@@ -201,7 +190,7 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){
 //   MESSAGE("GeomSelectionTools::entryToShapeType"<<entry );
   TopoDS_Shape S = TopoDS_Shape();
   TopAbs_ShapeEnum ShapeType = TopAbs_SHAPE;
-   _PTR(SObject) aSO = myStudy->FindObjectID(entry);
+   _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(entry);
   if (aSO){
     _PTR(SObject) aRefSObj;
     GEOM::GEOM_Object_var aShape;
@@ -225,7 +214,7 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){
         if (aShape->GetType() == GEOM_GROUP){
 //           MESSAGE("It's a group");
           GEOM::GEOM_IGroupOperations_wrap aGroupOp =
-            _geomEngine->GetIGroupOperations(myStudy->StudyId());
+            _geomEngine->GetIGroupOperations();
           ShapeType= (TopAbs_ShapeEnum)aGroupOp->GetType(aShape);
         }
         // if not
index c4013ff99ea1be648e251a9a78ea043a81f92f09..0fc4cbaf36910424fd7e9e40e1e8ee30aeda9898 100644 (file)
@@ -49,13 +49,9 @@ class LightApp_SelectionMgr;
 class PLUGINUTILS_EXPORT GeomSelectionTools
 {
 
-private:
-
-  _PTR(Study) myStudy;
-
 public:
 
-  GeomSelectionTools(_PTR(Study));
+  GeomSelectionTools();
   static SalomeApp_Application*  GetSalomeApplication();
   static LightApp_SelectionMgr* selectionMgr();
   SALOME_ListIO* getSelectedSalomeObjects();
@@ -67,7 +63,6 @@ public:
   TopAbs_ShapeEnum getFirstSelectedShapeType();
   TopAbs_ShapeEnum entryToShapeType(std::string );
   GeomAbs_SurfaceType getFaceInformation(TopoDS_Shape);
-  _PTR(Study) getMyStudy();
 };
 
 //////////////////////////////////////////
index 5d8294700d96607f3d3cd38eb93ad8405dd1e60a..7c8e6632747f0d84552e71e066e6690fd6d1b3e5 100644 (file)
@@ -2458,6 +2458,49 @@ const SMDS_MeshElement* SMDS_Mesh::FindElement (const vector<const SMDS_MeshNode
   return NULL;
 }
 
+//================================================================================
+/*!
+ * \brief Return elements including all given nodes
+ *  \param [in] nodes - nodes to find elements around
+ *  \param [out] foundElems - the found elements
+ *  \param [in] type - type of elements to find
+ *  \return int - a number of found elements
+ */
+//================================================================================
+
+int SMDS_Mesh::GetElementsByNodes(const std::vector<const SMDS_MeshNode *>& nodes,
+                                  std::vector<const SMDS_MeshElement *>&    foundElems,
+                                  const SMDSAbs_ElementType                 type)
+{
+  // chose a node with minimal number of inverse elements
+  const SMDS_MeshNode* n0 = nodes[0];
+  int minNbInverse = n0 ? n0->NbInverseElements( type ) : 1000;
+  for ( size_t i = 1; i < nodes.size(); ++i )
+    if ( nodes[i] && nodes[i]->NbInverseElements( type ) < minNbInverse )
+    {
+      n0 = nodes[i];
+      minNbInverse = n0->NbInverseElements( type );
+    }
+
+  foundElems.clear();
+  if ( n0 )
+  {
+    foundElems.reserve( minNbInverse );
+    SMDS_ElemIteratorPtr eIt = n0->GetInverseElementIterator( type );
+    while ( eIt->more() )
+    {
+      const SMDS_MeshElement* e = eIt->next();
+      bool includeAll = true;
+      for ( size_t i = 0; i < nodes.size() &&  includeAll; ++i )
+        if ( nodes[i] != n0 && e->GetNodeIndex( nodes[i] ) < 0 )
+          includeAll = false;
+      if ( includeAll )
+        foundElems.push_back( e );
+    }
+  }
+  return foundElems.size();
+}
+
 //=======================================================================
 //function : DumpNodes
 //purpose  :
index b1af99a1d1e6c2d0e8f5b8347130ccd2f4328f93..d1d0b1120a83f9c196119639d9fdaf5ca6ed7f9e 100644 (file)
@@ -689,6 +689,9 @@ public:
   static const SMDS_MeshElement* FindElement(const std::vector<const SMDS_MeshNode *>& nodes,
                                              const SMDSAbs_ElementType                 type=SMDSAbs_All,
                                              const bool                                noMedium=true);
+  static int GetElementsByNodes(const std::vector<const SMDS_MeshNode *>& nodes,
+                                std::vector<const SMDS_MeshElement *>&    foundElems,
+                                const SMDSAbs_ElementType                 type=SMDSAbs_All);
 
   /*!
    * \brief Raise an exception if free memory (ram+swap) too low
index 035c23c5919ccc309f758165820aa958c4cdbd78..c4fbb42cfe3a73b423ebda23500bf2a467e04058 100644 (file)
@@ -175,8 +175,8 @@ const SMESH_Algo::Features& SMESH_Algo::GetFeatures( const std::string& algoType
  */
 //=============================================================================
 
-SMESH_Algo::SMESH_Algo (int hypId, int studyId, SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+SMESH_Algo::SMESH_Algo (int hypId, SMESH_Gen * gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _compatibleAllHypFilter = _compatibleNoAuxHypFilter = NULL;
   _onlyUnaryInput = _requireDiscreteBoundary = _requireShape = true;
@@ -204,26 +204,26 @@ SMESH_Algo::~SMESH_Algo()
  */
 //=============================================================================
 
-SMESH_0D_Algo::SMESH_0D_Algo(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Algo(hypId, studyId, gen)
+SMESH_0D_Algo::SMESH_0D_Algo(int hypId, SMESH_Gen* gen)
+  : SMESH_Algo(hypId, gen)
 {
   _shapeType = (1 << TopAbs_VERTEX);
   _type = ALGO_0D;
 }
-SMESH_1D_Algo::SMESH_1D_Algo(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Algo(hypId, studyId, gen)
+SMESH_1D_Algo::SMESH_1D_Algo(int hypId, SMESH_Gen* gen)
+  : SMESH_Algo(hypId, gen)
 {
   _shapeType = (1 << TopAbs_EDGE);
   _type = ALGO_1D;
 }
-SMESH_2D_Algo::SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Algo(hypId, studyId, gen)
+SMESH_2D_Algo::SMESH_2D_Algo(int hypId, SMESH_Gen* gen)
+  : SMESH_Algo(hypId, gen)
 {
   _shapeType = (1 << TopAbs_FACE);
   _type = ALGO_2D;
 }
-SMESH_3D_Algo::SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Algo(hypId, studyId, gen)
+SMESH_3D_Algo::SMESH_3D_Algo(int hypId, SMESH_Gen* gen)
+  : SMESH_Algo(hypId, gen)
 {
   _shapeType = (1 << TopAbs_SOLID);
   _type = ALGO_3D;
@@ -553,28 +553,35 @@ bool SMESH_Algo::IsStraight( const TopoDS_Edge & E,
   case GeomAbs_Hyperbola:
   case GeomAbs_Parabola:
     return false;
-  // case GeomAbs_BezierCurve:
-  // case GeomAbs_BSplineCurve:
-  // case GeomAbs_OtherCurve:
+    // case GeomAbs_BezierCurve:
+    // case GeomAbs_BSplineCurve:
+    // case GeomAbs_OtherCurve:
   default:;
   }
-  const double   f = curve.FirstParameter();
-  const double   l = curve.LastParameter();
-  const gp_Pnt  pf = curve.Value( f );
-  const gp_Pnt  pl = curve.Value( l );
-  const gp_Vec v1( pf, pl );
-  const double v1Len = v1.Magnitude();
-  if ( v1Len < std::numeric_limits< double >::min() )
+
+  // evaluate how far from a straight line connecting the curve ends
+  // stand internal points of the curve
+  double  f = curve.FirstParameter();
+  double  l = curve.LastParameter();
+  gp_Pnt pf = curve.Value( f );
+  gp_Pnt pl = curve.Value( l );
+  gp_Vec lineVec( pf, pl );
+  double lineLen2 = lineVec.SquareMagnitude();
+  if ( lineLen2 < std::numeric_limits< double >::min() )
     return false; // E seems closed
-  const double tol = Min( 10 * curve.Tolerance(), v1Len * 1e-2 );
+
+  double edgeTol = 10 * curve.Tolerance();
+  double lenTol2 = lineLen2 * 1e-4; 
+  double tol2 = Min( edgeTol * edgeTol, lenTol2 );
+
   const double nbSamples = 7;
   for ( int i = 0; i < nbSamples; ++i )
   {
-    const double  r = ( i + 1 ) / nbSamples;
-    const gp_Pnt pi = curve.Value( f * r + l * ( 1 - r ));
-    const gp_Vec vi( pf, pi );
-    const double  h = 0.5 * v1.Crossed( vi ).Magnitude() / v1Len;
-    if ( h > tol )
+    double  r = ( i + 1 ) / nbSamples;
+    gp_Pnt pi = curve.Value( f * r + l * ( 1 - r ));
+    gp_Vec vi( pf, pi );
+    double h2 = lineVec.Crossed( vi ).SquareMagnitude() / lineLen2;
+    if ( h2 > tol2 )
       return false;
   }
   return true;
@@ -852,6 +859,16 @@ bool SMESH_Algo::Compute(SMESH_Mesh & /*aMesh*/, SMESH_MesherHelper* /*aHelper*/
   return error( COMPERR_BAD_INPUT_MESH, "Mesh built on shape expected");
 }
 
+//=======================================================================
+//function : IsApplicableToShape
+//purpose  : Return true if the algorithm can mesh a given shape
+//=======================================================================
+
+bool SMESH_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+{
+  return true;
+}
+
 //=======================================================================
 //function : CancelCompute
 //purpose  : Sets _computeCanceled to true. It's usage depends on
index d4c8f3e877aa50143fae1dc2e54a8b328fa497c4..e35cf6284e37bc31e3c6b68c06666a8ad0c2fee8 100644 (file)
@@ -102,10 +102,9 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
   /*!
    * \brief Creates algorithm
     * \param hypId - algorithm ID
-    * \param studyId - study ID
     * \param gen - SMESH_Gen
    */
-  SMESH_Algo(int hypId, int studyId, SMESH_Gen * gen);
+  SMESH_Algo(int hypId, SMESH_Gen * gen);
 
   /*!
    * \brief Destructor
@@ -165,6 +164,15 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
    */
   virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
 
+  /*!
+   * \brief Return true if the algorithm can mesh a given shape
+   *  \param [in] aShape - shape to check
+   *  \param [in] toCheckAll - if true, this check returns OK if all shapes are OK,
+   *              else, returns OK if at least one shape is OK
+   *  \retval bool - \c true by default
+   */
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const;
+
   /*!
    * \brief Sets _computeCanceled to true. It's usage depends on
    *        implementation of a particular mesher.
@@ -466,19 +474,19 @@ protected:
 class SMESH_EXPORT SMESH_0D_Algo: public SMESH_Algo
 {
 public:
-  SMESH_0D_Algo(int hypId, int studyId,  SMESH_Gen* gen);
+  SMESH_0D_Algo(int hypId, SMESH_Gen* gen);
 };
 
 class SMESH_EXPORT SMESH_1D_Algo: public SMESH_Algo
 {
 public:
-  SMESH_1D_Algo(int hypId, int studyId,  SMESH_Gen* gen);
+  SMESH_1D_Algo(int hypId, SMESH_Gen* gen);
 };
 
 class SMESH_EXPORT SMESH_2D_Algo: public SMESH_Algo
 {
 public:
-  SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen);
+  SMESH_2D_Algo(int hypId, SMESH_Gen* gen);
   /*!
    * \brief Method in which an algorithm generating a structured mesh
    *        fixes positions of in-face nodes after there movement
@@ -491,7 +499,7 @@ public:
 class SMESH_EXPORT SMESH_3D_Algo: public SMESH_Algo
 {
 public:
-  SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen);
+  SMESH_3D_Algo(int hypId, SMESH_Gen* gen);
 };
 
 #endif
index bd5654c89588eb1bd05ddde3ae963e978e7cd8eb..27881281ed5f593b839a0561cdea0d6f2b2e56d1 100644 (file)
@@ -65,6 +65,8 @@ using namespace std;
 
 SMESH_Gen::SMESH_Gen()
 {
+  _studyContext = new StudyContextStruct;
+  _studyContext->myDocument = new SMESHDS_Document();
   _localId = 0;
   _hypId   = 0;
   _segmentation = _nbSegments = 10;
@@ -94,19 +96,14 @@ namespace
 
 SMESH_Gen::~SMESH_Gen()
 {
-  std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
-  for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
-  {
-    StudyContextStruct* context = i_sc->second;
-    std::map < int, SMESH_Hypothesis * >::iterator i_hyp = context->mapHypothesis.begin();
-    for ( ; i_hyp != context->mapHypothesis.end(); ++i_hyp )
+    std::map < int, SMESH_Hypothesis * >::iterator i_hyp = _studyContext->mapHypothesis.begin();
+    for ( ; i_hyp != _studyContext->mapHypothesis.end(); ++i_hyp )
     {
       if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second ))
         h->NullifyGen();
     }
-    delete context->myDocument;
-    delete context;
-  }
+  delete _studyContext->myDocument;
+  delete _studyContext;
 }
 
 //=============================================================================
@@ -116,21 +113,17 @@ SMESH_Gen::~SMESH_Gen()
  */
 //=============================================================================
 
-SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
+SMESH_Mesh* SMESH_Gen::CreateMesh(bool theIsEmbeddedMode)
   throw(SALOME_Exception)
 {
   Unexpect aCatch(SalomeException);
 
-  // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
-  StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
-
   // create a new SMESH_mesh object
   SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
-                                     theStudyId,
                                      this,
                                      theIsEmbeddedMode,
-                                     aStudyContext->myDocument);
-  aStudyContext->mapMesh[_localId-1] = aMesh;
+                                     _studyContext->myDocument);
+  _studyContext->mapMesh[_localId-1] = aMesh;
 
   return aMesh;
 }
@@ -1149,17 +1142,9 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_subMesh * aSubMesh,
  */
 //=============================================================================
 
-StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
+StudyContextStruct *SMESH_Gen::GetStudyContext()
 {
-  // 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];
-  return myStudyContext;
+  return _studyContext;
 }
 
 //================================================================================
index d011050354f065381884f99f8ffb016f5c77c67d..1433a79fa0d5f0fcc2da7c7bbabca59702c6c3e8 100644 (file)
@@ -66,7 +66,7 @@ public:
   SMESH_Gen();
   ~SMESH_Gen();
 
-  SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode)
+  SMESH_Mesh* CreateMesh(bool theIsEmbeddedMode)
     throw(SALOME_Exception);
 
   enum ComputeFlags
@@ -147,7 +147,7 @@ public:
   // if Compute() would fail because of some algo bad state
   // theErrors list contains problems description
 
-  StudyContextStruct *GetStudyContext(int studyId);
+  StudyContextStruct *GetStudyContext();
 
   static int GetShapeDim(const TopAbs_ShapeEnum & aShapeType);
   static int GetShapeDim(const TopoDS_Shape &     aShape)
@@ -165,7 +165,7 @@ public:
 private:
 
   int _localId;                         // unique Id of created objects, within SMESH_Gen entity
-  std::map < int, StudyContextStruct * >_mapStudyContext;
+  StudyContextStruct* _studyContext;
 
   // hypotheses managing
   int _hypId;
index c4107fb3892bed30a88f0b640277375422e4640c..991eb2e94b316490ea7c39c0fe6733b678b4b314 100644 (file)
@@ -41,15 +41,13 @@ using namespace std;
 //=============================================================================
 
 SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
-                                   int studyId,
                                    SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
 {
   _gen            = gen;
-  _studyId        = studyId;
   _type           = PARAM_ALGO;
   _shapeType      = 0;  // to be set by algo with TopAbs_Enum
   _param_algo_dim = -1; // to be set by algo parameter
-  StudyContextStruct* myStudyContext = gen->GetStudyContext(_studyId);
+  StudyContextStruct* myStudyContext = gen->GetStudyContext();
   myStudyContext->mapHypothesis[hypId] = this;
 }
 
@@ -63,7 +61,7 @@ SMESH_Hypothesis::~SMESH_Hypothesis()
 {
   if ( _gen )
   {
-    StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+    StudyContextStruct* myStudyContext = _gen->GetStudyContext();
     myStudyContext->mapHypothesis[_hypId] = 0;
   }
 }
@@ -106,22 +104,11 @@ int SMESH_Hypothesis::GetShapeType() const
  */
 //=============================================================================
 
-int SMESH_Hypothesis::GetStudyId() const
-{
-  return _studyId;
-}
-
-//=============================================================================
-/*!
- * 
- */
-//=============================================================================
-
 void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
 {
   // for all meshes in study
 
-  StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+  StudyContextStruct* myStudyContext = _gen->GetStudyContext();
   map<int, SMESH_Mesh*>::iterator itm;
   for (itm = myStudyContext->mapMesh.begin();
        itm != myStudyContext->mapMesh.end();
@@ -161,7 +148,7 @@ void SMESH_Hypothesis::SetLibName(const char* theLibName)
 
 SMESH_Mesh* SMESH_Hypothesis::GetMeshByPersistentID(int id)
 {
-  StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+  StudyContextStruct* myStudyContext = _gen->GetStudyContext();
   map<int, SMESH_Mesh*>::iterator itm = myStudyContext->mapMesh.begin();
   for ( ; itm != myStudyContext->mapMesh.end(); itm++)
   {
index bfcd2f518daa7b303628e8c246220738c9024c5d..60b74bfb4a80e1405d31d8be3f048fb7bd9a74a2 100644 (file)
@@ -69,10 +69,9 @@ public:
   static bool IsStatusFatal(Hypothesis_Status theStatus)
   { return theStatus >= HYP_UNKNOWN_FATAL; }
 
-  SMESH_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
+  SMESH_Hypothesis(int hypId, SMESH_Gen* gen);
   virtual ~SMESH_Hypothesis();
   virtual int GetDim() const;
-  int         GetStudyId() const;
   SMESH_Gen*  GetGen() const { return (SMESH_Gen*) _gen; }
   virtual int GetShapeType() const;
   virtual const char* GetLibName() const;
@@ -126,7 +125,6 @@ public:
 
 protected:
   SMESH_Gen* _gen;
-  int        _studyId;
   int        _shapeType;
   int        _param_algo_dim; // to be set at descendant hypothesis constructor
 
index 74eaa008632d44bd204859f8f5b8ce72fc754561..af3a96529d30d08152d65656e01642345efe16fb 100644 (file)
@@ -106,7 +106,6 @@ class SMESH_Mesh::SubMeshHolder : public SMESHDS_TSubMeshHolder< SMESH_subMesh >
 //=============================================================================
 
 SMESH_Mesh::SMESH_Mesh(int               theLocalId, 
-                       int               theStudyId, 
                        SMESH_Gen*        theGen,
                        bool              theIsEmbeddedMode,
                        SMESHDS_Document* theDocument):
@@ -114,7 +113,6 @@ SMESH_Mesh::SMESH_Mesh(int               theLocalId,
 {
   if(MYDEBUG) MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
   _id            = theLocalId;
-  _studyId       = theStudyId;
   _gen           = theGen;
   _myDocument    = theDocument;
   _myMeshDS      = theDocument->NewMesh(theIsEmbeddedMode,theLocalId);
@@ -135,7 +133,6 @@ SMESH_Mesh::SMESH_Mesh(int               theLocalId,
 
 SMESH_Mesh::SMESH_Mesh():
   _id(-1),
-  _studyId(-1),
   _groupId( 0 ),
   _nbSubShapes( 0 ),
   _isShapeToMesh( false ),
@@ -208,7 +205,7 @@ SMESH_Mesh::~SMESH_Mesh()
   // remove self from studyContext
   if ( _gen )
   {
-    StudyContextStruct * studyContext = _gen->GetStudyContext( _studyId );
+    StudyContextStruct * studyContext = _gen->GetStudyContext();
     studyContext->mapMesh.erase( _id );
   }
   if ( _myDocument )
@@ -248,7 +245,7 @@ SMESH_Mesh* SMESH_Mesh::FindMesh( int meshId ) const
   if ( _id == meshId )
     return (SMESH_Mesh*) this;
 
-  if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext( _studyId ))
+  if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext())
   {
     std::map < int, SMESH_Mesh * >::iterator i_m = aStudyContext->mapMesh.find( meshId );
     if ( i_m != aStudyContext->mapMesh.end() )
@@ -734,7 +731,7 @@ SMESH_Mesh::RemoveHypothesis(const TopoDS_Shape & aSubShape,
   Unexpect aCatch(SalomeException);
   if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
 
-  StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
+  StudyContextStruct *sc = _gen->GetStudyContext();
   if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
     throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
 
@@ -995,7 +992,7 @@ int SMESH_Mesh::GetHypotheses(const SMESH_subMesh *               aSubMesh,
 
 SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const int anHypId) const
 {
-  StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
+  StudyContextStruct *sc = _gen->GetStudyContext();
   if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
     return NULL;
 
index a8ec5dfae4e0fdfc1762cd981c82ddcccc53dea1..158788613f0b61d911b09f6d7e9bc57c7a69de10 100644 (file)
@@ -68,7 +68,6 @@ class SMESH_EXPORT SMESH_Mesh
 {
  public:
   SMESH_Mesh(int               theLocalId,
-             int               theStudyId,
              SMESH_Gen*        theGen,
              bool              theIsEmbeddedMode,
              SMESHDS_Document* theDocument);
@@ -359,7 +358,6 @@ private:
   
 protected:
   int                        _id;           // id given by creator (unique within the creator instance)
-  int                        _studyId;
   int                        _groupId;      // id generator for group objects
   int                        _nbSubShapes;  // initial nb of subshapes in the shape to mesh
   bool                       _isShapeToMesh;// set to true when a shape is given (only once)
index 1f343b1c4233af0670e82e8529895fbedee6afb6..c477e729ef5cda7a95eca5fb86238ebf132fea69 100644 (file)
@@ -7482,8 +7482,8 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes,
   }
 
   // Remove bad elements, then equal nodes (order important)
-  Remove( rmElemIds, false );
-  Remove( rmNodeIds, true );
+  Remove( rmElemIds, /*isNodes=*/false );
+  Remove( rmNodeIds, /*isNodes=*/true );
 
   return;
 }
@@ -7553,14 +7553,14 @@ bool SMESH_MeshEditor::applyMerge( const SMDS_MeshElement* elem,
     toRemove = true;
     nbResElems = 0;
 
-    if ( elem->IsQuadratic() && newElemDefs[0].myType == SMDSAbs_Face && nbNodes > 6 )
+    if ( newElemDefs[0].myIsQuad && newElemDefs[0].myType == SMDSAbs_Face && nbNodes > 6 )
     {
       // if corner nodes stick, remove medium nodes between them from uniqueNodes
       int nbCorners = nbNodes / 2;
       for ( int iCur = 0; iCur < nbCorners; ++iCur )
       {
-        int iPrev = ( iCur + 1 ) % nbCorners;
-        if ( curNodes[ iCur ] == curNodes[ iPrev ] ) // corners stick
+        int iNext = ( iCur + 1 ) % nbCorners;
+        if ( curNodes[ iCur ] == curNodes[ iNext ] ) // corners stick
         {
           int iMedium = iCur + nbCorners;
           vector< const SMDS_MeshNode* >::iterator i =
@@ -7711,11 +7711,9 @@ bool SMESH_MeshEditor::applyMerge( const SMDS_MeshElement* elem,
       //    |       |
       //    +---+---+
       //   0    7    3
-      if (( nbUniqueNodes == 7 && nbRepl == 2 && iRepl[1] != 8 ) &&
-          (( iRepl[0] == 1 && iRepl[1] == 4 && curNodes[1] == curNodes[0] ) ||
-           ( iRepl[0] == 2 && iRepl[1] == 5 && curNodes[2] == curNodes[1] ) ||
-           ( iRepl[0] == 3 && iRepl[1] == 6 && curNodes[3] == curNodes[2] ) ||
-           ( iRepl[0] == 3 && iRepl[1] == 7 && curNodes[3] == curNodes[0] )))
+      if ( nbUniqueNodes == 7 &&
+           iRepl[0] < 4       &&
+           ( nbRepl == 1 || iRepl[1] != 8 ))
       {
         toRemove = false;
       }
index e03128dc84d92994c16584069d702820e70982b1..004c856f1bae102ebbdc2e7a4bd6b56966ccaef4 100644 (file)
@@ -2669,7 +2669,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap &            theParam2
   }
 
   // nb rows of nodes
-  size_t prevNbRows     = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here
+  size_t prevNbRows   = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here
   size_t expectNbRows = faceSubMesh->NbElements() / ( theParam2ColumnMap.size()-1 ); // to be added
 
   // fill theParam2ColumnMap column by column by passing from nodes on
index 0f14f5ef68d24f82f1e1c50bde6bd90a93e10de9..db6e60e8ca629adbb489633dcffe0758783b0583 100644 (file)
@@ -602,8 +602,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
 
   Extrema_GenExtPS projector;
   GeomAdaptor_Surface aSurface( BRep_Tool::Surface( face ));
-  if ( theProject || needProject )
-    projector.Initialize( aSurface, 20,20, 1e-5,1e-5 );
+  projector.Initialize( aSurface, 20,20, 1e-5,1e-5 );
 
   int iPoint = 0;
   TNodePointIDMap nodePointIDMap;
@@ -690,8 +689,28 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
 
     myPoints.resize( nbNodes );
 
+    // care of INTERNAL VERTEXes
+    TopExp_Explorer vExp( face, TopAbs_VERTEX, TopAbs_EDGE );
+    for ( ; vExp.More(); vExp.Next() )
+    {
+      const SMDS_MeshNode* node =
+        SMESH_Algo::VertexNode( TopoDS::Vertex( vExp.Current()), aMeshDS );
+      if ( !node || node->NbInverseElements( SMDSAbs_Face ) == 0 )
+        continue;
+      myPoints.resize( ++nbNodes );
+      list< TPoint* > & fPoints = getShapePoints( face );
+      nodePointIDMap.insert( make_pair( node, iPoint ));
+      TPoint* p = &myPoints[ iPoint++ ];
+      fPoints.push_back( p );
+      gp_XY uv = helper.GetNodeUV( face, node );
+      p->myInitUV.SetCoord( uv.X(), uv.Y() );
+      p->myInitXYZ.SetCoord( p->myInitUV.X(), p->myInitUV.Y(), 0 );
+    }
+
     // Load U of points on edges
 
+    Bnd_Box2d edgesUVBox;
+
     list<int>::iterator nbEinW = myNbKeyPntInBoundary.begin();
     int iE = 0;
     vector< TopoDS_Edge > eVec;
@@ -762,6 +781,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
           else
             keyPoint->myInitUV = C2d->Value( isForward ? f : l ).XY();
           keyPoint->myInitXYZ.SetCoord (keyPoint->myInitUV.X(), keyPoint->myInitUV.Y(), 0);
+          edgesUVBox.Add( gp_Pnt2d( keyPoint->myInitUV ));
         }
       }
       if ( !vPoint->empty() )
@@ -841,6 +861,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
             p->myInitUV = C2d->Value( u ).XY();
           }
           p->myInitXYZ.SetCoord( p->myInitUV.X(), p->myInitUV.Y(), 0 );
+          edgesUVBox.Add( gp_Pnt2d( p->myInitUV ));
           unIt++; unRIt++;
           iPoint++;
         }
@@ -866,6 +887,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
           else
             keyPoint->myInitUV = C2d->Value( isForward ? l : f ).XY();
           keyPoint->myInitXYZ.SetCoord( keyPoint->myInitUV.X(), keyPoint->myInitUV.Y(), 0 );
+          edgesUVBox.Add( gp_Pnt2d( keyPoint->myInitUV ));
         }
       }
       if ( !vPoint->empty() )
@@ -906,7 +928,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
         nodePointIDMap.insert( make_pair( node, iPoint ));
         TPoint* p = &myPoints[ iPoint++ ];
         fPoints.push_back( p );
-        if ( theProject )
+        if ( theProject || edgesUVBox.IsOut( p->myInitUV ) )
           p->myInitUV = project( node, projector );
         else {
           const SMDS_FacePosition* pos =
index 4513302d3767bc5e5210122c58d16156ef8d13eb..f9de0bee1f245c13ff48e381c0cd3902297cc6a7 100644 (file)
@@ -35,7 +35,7 @@ using namespace std;
 //function : Create
 //purpose  : 
 //=======================================================================
-SMESHDS_Document::SMESHDS_Document(int UserID):myUserID(UserID)
+SMESHDS_Document::SMESHDS_Document()
 {
 }
 
index 73fdc3b9fe87d358a9dbccffe1d0a545fd6fd34f..1cb0c9a9bf92adad5e9347d9fb58f4e5ea9e4996 100644 (file)
 class SMESHDS_EXPORT SMESHDS_Document
 {
   public:
-        SMESHDS_Document(int UserID);
-        ~SMESHDS_Document();
-        SMESHDS_Mesh *       NewMesh(bool theIsEmbeddedMode, int MeshID);
-        void                 RemoveMesh(int MeshID);
-        SMESHDS_Mesh *       GetMesh(int MeshID);
-        void                 AddHypothesis(SMESHDS_Hypothesis * H);
-        void                 RemoveHypothesis(int HypID);
-        SMESHDS_Hypothesis * GetHypothesis(int HypID);
-        int                  NbMeshes();
-        int                  NbHypothesis();
-        void                 InitMeshesIterator();
-        SMESHDS_Mesh *       NextMesh();
-        bool                 MoreMesh();        
-        void                 InitHypothesisIterator();
-        SMESHDS_Hypothesis * NextHypothesis();
-        bool                 MoreHypothesis();  
+    SMESHDS_Document();
+    ~SMESHDS_Document();
+    SMESHDS_Mesh *       NewMesh(bool theIsEmbeddedMode, int MeshID);
+    void                 RemoveMesh(int MeshID);
+    SMESHDS_Mesh *       GetMesh(int MeshID);
+    void                 AddHypothesis(SMESHDS_Hypothesis * H);
+    void                 RemoveHypothesis(int HypID);
+    SMESHDS_Hypothesis * GetHypothesis(int HypID);
+    int                  NbMeshes();
+    int                  NbHypothesis();
+    void                 InitMeshesIterator();
+    SMESHDS_Mesh *       NextMesh();
+    bool                 MoreMesh();
+    void                 InitHypothesisIterator();
+    SMESHDS_Hypothesis * NextHypothesis();
+    bool                 MoreHypothesis();
 
   private:
-        int                                         myUserID;
-        std::map<int,SMESHDS_Mesh*>                 myMeshes;
-        std::map<int,SMESHDS_Hypothesis*>           myHypothesis;
-        std::map<int,SMESHDS_Mesh*>::iterator       myMeshesIt;
-        std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
+    std::map<int,SMESHDS_Mesh*>                 myMeshes;
+    std::map<int,SMESHDS_Hypothesis*>           myHypothesis;
+    std::map<int,SMESHDS_Mesh*>::iterator       myMeshesIt;
+    std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
 };
 
 #endif
index 526b6c6500b2b1b0e4a8d2567e86a45669ec2d7e..3f2b887710b780ff979c506ae21d02af75eb1050 100644 (file)
@@ -194,7 +194,7 @@ namespace
 
   void ExportMeshToFile(int theCommandID);
 
-  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap);
+  void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap);
 
   void SetDisplayEntity(int theCommandID);
 
@@ -276,7 +276,7 @@ namespace
     if ( filenames.count() > 0 )
     {
       SUIT_OverrideCursor wc;
-      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+      _PTR(Study) aStudy = SMESH::getStudy();
 
       QStringList errors;
       QStringList anEntryList;
@@ -630,7 +630,7 @@ namespace
       };
       // is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed)
       const int nbTypes = sizeof( typeMsg ) / sizeof( const char* );
-      int _assert[( nbTypes == SMESH::Entity_Last ) ? 2 : -1 ]; _assert[0]=_assert[1];
+      int _assert[( nbTypes == SMESH::Entity_Last ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
 
       QString andStr = " " + QObject::tr("SMESH_AND") + " ", comma(", ");
       for ( size_t iType = 0; iType < presentNotSupported.size(); ++iType ) {
@@ -1336,7 +1336,7 @@ namespace
       if ( selected.Extent() )
       {
         Handle(SALOME_InteractiveObject) anIObject = selected.First();
-        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+        _PTR(Study) aStudy = SMESH::getStudy();
         _PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry());
         if (aSObj) {
           if ( aStudy->GetUseCaseBuilder()->SortChildren( aSObj, true/*AscendingOrder*/ ) ) {
@@ -1347,7 +1347,7 @@ namespace
     }
   }
 
-  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap)
+  void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap)
   {
     SALOME_ListIO selected;
     SalomeApp_Application* app =
@@ -1369,8 +1369,6 @@ namespace
       return;
     }
 
-    _PTR(Study) aStudy = appStudy->studyDS();
-
     aSel->selectedObjects( selected );
 
     if ( selected.Extent() >= 1 )
@@ -1469,7 +1467,7 @@ namespace
             break;
         }
 
-        SMESHGUI_PropertiesDlg dlg( theMarkerMap[ aStudy->StudyId() ], SMESHGUI::desktop() );
+        SMESHGUI_PropertiesDlg dlg( theMarkerMap, SMESHGUI::desktop() );
         // nodes: color, marker
         dlg.setNodeColor( nodeColor );
         if( markerType != VTK::MT_USER )
@@ -1525,8 +1523,8 @@ namespace
           orientation3d    = dlg.orientation3d();
           shrinkCoef       = dlg.shrinkCoef() / 100.;
 
-          // store point markers map that might be changed by the user
-          theMarkerMap[ aStudy->StudyId() ] = dlg.customMarkers();
+          // store point markers that might be changed by the user
+          theMarkerMap = dlg.customMarkers();
 
           // set properties from dialog box to the presentations
           SALOME_ListIteratorOfListIO It( selected );
@@ -1542,9 +1540,8 @@ namespace
               anActor->SetMarkerStd( markerType, markerScale );
             }
             else {
-              const VTK::MarkerMap& markerMap = theMarkerMap[ aStudy->StudyId() ];
-              VTK::MarkerMap::const_iterator iter = markerMap.find( markerId );
-              if ( iter != markerMap.end() )
+              VTK::MarkerMap::const_iterator iter = theMarkerMap.find( markerId );
+              if ( iter != theMarkerMap.end() )
                 anActor->SetMarkerTexture( markerId, iter->second.second );
             }
             // volumes: normal color, reversed color (delta)
@@ -1682,7 +1679,7 @@ namespace
   void Control( int theCommandID )
   {
     SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
 
     SALOME_ListIO selected;
     if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
@@ -1701,7 +1698,7 @@ namespace
             if ( !anIDSrc->_is_nil() ) {
               SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
               if (( !anActor && selected.Extent() == 1 ) &&
-                  ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
+                  ( anActor = SMESH::CreateActor( anIO->getEntry() )))
               {
                 anActor->SetControlMode( aControl );
                 SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
@@ -1758,7 +1755,7 @@ namespace
 
   QString CheckTypeObject(const Handle(SALOME_InteractiveObject) & theIO)
   {
-    _PTR(Study)  aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study)  aStudy = SMESH::getStudy();
     _PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry());
     if (aSObj) {
       _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
@@ -1822,7 +1819,7 @@ void SMESHGUI::OnEditDelete()
   LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
   SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
 
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  _PTR(Study) aStudy = SMESH::getStudy();
   _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
   _PTR(GenericAttribute) anAttr;
   _PTR(AttributeIOR) anIOR;
@@ -2210,17 +2207,6 @@ SMESHGUI* SMESHGUI::GetSMESHGUI()
     smeshMod = dynamic_cast<SMESHGUI*>( module );
   }
 
-  if ( smeshMod && smeshMod->application() && smeshMod->application()->activeStudy() )
-  {
-    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( smeshMod->application()->activeStudy() );
-    if ( study )
-    {
-      _PTR(Study) aStudy = study->studyDS();
-      if ( aStudy )
-        GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
-    }
-  }
-
   return smeshMod;
 }
 
@@ -2393,36 +2379,27 @@ bool SMESHGUI::DefineDlgPosition(QWidget * aDlg, int &x, int &y)
   return true;
 }
 
-//=============================================================================
 /*!
- *
- */
-//=============================================================================
-static int isStudyLocked(_PTR(Study) theStudy){
-  return theStudy->GetProperties()->IsLocked();
-}
-
-static bool checkLock(_PTR(Study) theStudy) {
-  if (isStudyLocked(theStudy)) {
-    SUIT_MessageBox::warning( SMESHGUI::desktop(),
-                              QObject::tr("WRN_WARNING"),
-                              QObject::tr("WRN_STUDY_LOCKED") );
+ * \brief Verifies whether study of operation is locked
+  * \param theMess - specifies whether message box must be shown if study is locked
+  * \return State of study.
+*
+* Verifies whether study of operation is locked. If second parameter is TRUE and study
+* is locked when corresponding message box appears
+*/
+bool SMESHGUI::isStudyLocked( bool theMessage )
+{
+  if ( SMESH::getStudy()->GetProperties()->IsLocked() )
+  {
+    if ( theMessage )
+      SUIT_MessageBox::warning( SMESHGUI::desktop(),
+                                QObject::tr( "WRN_WARNING" ),
+                                QObject::tr( "WRN_STUDY_LOCKED" ) );
     return true;
   }
   return false;
 }
 
-//=======================================================================
-//function : CheckActiveStudyLocked
-//purpose  :
-//=======================================================================
-
-bool SMESHGUI::isActiveStudyLocked()
-{
-  _PTR(Study) aStudy = activeStudy()->studyDS();
-  return checkLock( aStudy );
-}
-
 //=============================================================================
 /*!
  *
@@ -2434,15 +2411,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   if( !anApp )
     return false;
 
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
   SUIT_ResourceMgr* mgr = resourceMgr();
   if( !mgr )
     return false;
 
-  if (CORBA::is_nil(GetSMESHGen()->GetCurrentStudy())) {
-    GetSMESHGen()->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
-  }
-
   SUIT_ViewWindow* view = application()->desktop()->activeWindow();
   SVTK_ViewWindow* vtkwnd = dynamic_cast<SVTK_ViewWindow*>( view );
 
@@ -2450,7 +2422,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   switch (theCommandID) {
   case SMESHOp::OpDelete:
-    if(checkLock(aStudy)) break;
+    if(isStudyLocked()) break;
     OnEditDelete();
     break;
   case SMESHOp::OpImportDAT:
@@ -2468,7 +2440,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case SMESHOp::OpPopupImportSAUV:
   case SMESHOp::OpPopupImportGMF:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       ::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
       break;
     }
@@ -2630,7 +2602,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpUpdate:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       SUIT_OverrideCursor wc;
       try {
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
@@ -2697,7 +2669,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
 
         // PAL13338 + PAL15161 -->
-        if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
+        if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !isStudyLocked()) {
           SMESH::UpdateView();
           SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
         }
@@ -2719,7 +2691,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpNode:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
 
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
@@ -2746,14 +2718,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     break;
   case SMESHOp::OpCopyMesh:
     {
-      if (checkLock(aStudy)) break;
+      if (isStudyLocked()) break;
       EmitSignalDeactivateDialog();
       ( new SMESHGUI_CopyMeshDlg( this ) )->show();
     }
     break;
   case SMESHOp::OpBuildCompoundMesh:
     {
-      if (checkLock(aStudy)) break;
+      if (isStudyLocked()) break;
       EmitSignalDeactivateDialog();
       ( new SMESHGUI_BuildCompoundDlg( this ) )->show();
     }
@@ -2768,7 +2740,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if ( checkLock( aStudy ) )
+      if ( isStudyLocked() )
         break;
 
       /*Standard_Boolean aRes;
@@ -2798,7 +2770,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if ( checkLock( aStudy ) )
+      if ( isStudyLocked() )
         break;
 
       EmitSignalDeactivateDialog();
@@ -2817,7 +2789,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpSmoothing:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_SmoothingDlg( this ) )->show();
@@ -2829,7 +2801,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpExtrusion:
     {
-      if (checkLock(aStudy)) break;
+      if (isStudyLocked()) break;
       if (vtkwnd) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
@@ -2840,7 +2812,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpExtrusionAlongAPath:
     {
-      if (checkLock(aStudy)) break;
+      if (isStudyLocked()) break;
       if (vtkwnd) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
@@ -2851,7 +2823,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpRevolution:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_RevolutionDlg( this ) )->show();
@@ -2863,7 +2835,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpPatternMapping:
     {
-      if ( checkLock( aStudy ) )
+      if ( isStudyLocked() )
         break;
       if ( vtkwnd )
       {
@@ -2892,7 +2864,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       EmitSignalDeactivateDialog();
       SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
 
@@ -2919,7 +2891,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       EmitSignalDeactivateDialog();
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -2932,7 +2904,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         // check if submesh is selected
         Handle(SALOME_InteractiveObject) IObject = selected.First();
         if (IObject->hasEntry()) {
-          _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
+          _PTR(SObject) aSObj = SMESH::getStudy()->FindObjectID(IObject->getEntry());
           if( aSObj ) {
             SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
             if (!aSubMesh->_is_nil()) {
@@ -2996,7 +2968,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       EmitSignalDeactivateDialog();
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -3026,7 +2998,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpAddElemGroupPopup:     // Add elements to group
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if (myState == 800) {
         SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
         if (aDlg) aDlg->onAdd();
@@ -3036,7 +3008,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpRemoveElemGroupPopup:  // Remove elements from group
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if (myState == 800) {
         SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
         if (aDlg) aDlg->onRemove();
@@ -3052,7 +3024,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       EmitSignalDeactivateDialog();
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -3092,7 +3064,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if ( checkLock( aStudy ) )
+      if ( isStudyLocked() )
         break;
 
       EmitSignalDeactivateDialog();
@@ -3112,7 +3084,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
     case SMESHOp::OpGroupUnderlyingElem: // Create groups of entities from existing groups of superior dimensions
     {
-      if ( checkLock( aStudy ) )
+      if ( isStudyLocked() )
         break;
 
       EmitSignalDeactivateDialog();
@@ -3130,7 +3102,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       }
 
-      if ( checkLock( aStudy ) )
+      if ( isStudyLocked() )
         break;
 
       EmitSignalDeactivateDialog();
@@ -3172,7 +3144,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpEditHypothesis:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
       SALOME_ListIO selected;
@@ -3217,7 +3189,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpUnassign:                      // REMOVE HYPOTHESIS / ALGORITHMS
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       SUIT_OverrideCursor wc;
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -3248,7 +3220,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case SMESHOp::OpPyramid:
   case SMESHOp::OpHexagonalPrism:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         SMDSAbs_EntityType type = SMDSEntity_Edge;
@@ -3274,7 +3246,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpPolyhedron:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
@@ -3296,7 +3268,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case SMESHOp::OpQuadraticHexahedron:
   case SMESHOp::OpTriQuadraticHexahedron:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         SMDSAbs_EntityType type = SMDSEntity_Last;
@@ -3326,7 +3298,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpRemoveNodes:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
@@ -3339,7 +3311,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpRemoveElements:                                    // REMOVES ELEMENTS
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
@@ -3353,7 +3325,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpClearMesh: {
 
-    if(checkLock(aStudy)) break;
+    if(isStudyLocked()) break;
 
     SALOME_ListIO selected;
     if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
@@ -3374,7 +3346,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SMESH::ModifiedMesh( aMeshSObj, false, true);
         // hide groups and submeshes
         _PTR(ChildIterator) anIter =
-          SMESH::GetActiveStudyDocument()->NewChildIterator( aMeshSObj );
+          SMESH::getStudy()->NewChildIterator( aMeshSObj );
         for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
         {
           _PTR(SObject) so = anIter->Value();
@@ -3393,7 +3365,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   }
   case SMESHOp::OpRemoveOrphanNodes:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       SALOME_ListIO selected;
       if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
         aSel->selectedObjects( selected );
@@ -3432,7 +3404,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpRenumberingNodes:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
@@ -3446,7 +3418,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpRenumberingElements:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
@@ -3460,7 +3432,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpTranslation:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_TranslationDlg( this ) )->show();
@@ -3473,7 +3445,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpRotation:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_RotationDlg( this ) )->show();
@@ -3486,7 +3458,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpSymmetry:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if(vtkwnd) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_SymmetryDlg( this ) )->show();
@@ -3499,7 +3471,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpScale:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_ScaleDlg( this ) )->show();
@@ -3513,7 +3485,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpSewing:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if(vtkwnd) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_SewingDlg( this ) )->show();
@@ -3526,7 +3498,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpMergeNodes:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if(vtkwnd) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_MergeDlg( this, 0 ) )->show();
@@ -3539,7 +3511,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     }
   case SMESHOp::OpMergeElements:
     {
-      if (checkLock(aStudy)) break;
+      if (isStudyLocked()) break;
       if (vtkwnd) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_MergeDlg( this, 1 ) )->show();
@@ -3556,7 +3528,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case SMESHOp::OpDuplicateNodes:
     {
-      if(checkLock(aStudy)) break;
+      if(isStudyLocked()) break;
       if ( vtkwnd ) {
         EmitSignalDeactivateDialog();
         ( new SMESHGUI_DuplicateNodesDlg( this ) )->show();
@@ -4849,11 +4821,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
   action(SMESHOp::OpDelete)->setEnabled(true); // Delete: Key_Delete
 
   //  0020210. Make SMESH_Gen update meshes at switching GEOM->SMESH
-  GetSMESHGen()->SetCurrentStudy(SALOMEDS::Study::_nil());
-  if ( SalomeApp_Study* s = dynamic_cast<SalomeApp_Study*>( study )) {
-    if ( _PTR(Study) aStudy = s->studyDS() )
-      GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
-  }
+  GetSMESHGen()->UpdateStudy();
 
   // get all view currently opened in the study and connect their signals  to
   // the corresponding slots of the class.
@@ -4886,7 +4854,7 @@ void SMESHGUI::studyClosed( SUIT_Study* s )
 {
   if( !s )
     return;
-  SMESH::RemoveVisuData( s->id() );
+  SMESH::RemoveVisuData();
   SalomeApp_Module::studyClosed( s );
 }
 
@@ -4902,16 +4870,11 @@ void SMESHGUI::OnGUIEvent()
 
 SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
 {
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
   if ( CORBA::is_nil( myComponentSMESH ) )
-    {
-      SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
-      if ( aStudy )
-        aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
-      return aGUI.myComponentSMESH;
-    }
-  if ( aStudy )
-    myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
+  {
+    SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
+    return aGUI.myComponentSMESH;
+  }
   return myComponentSMESH;
 }
 
@@ -5621,8 +5584,7 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
 
 void SMESHGUI::switchToOperation(int id)
 {
-  if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() )
-    activeStudy()->abortAllOperations();
+  activeStudy()->abortAllOperations();
   startOperation( id );
 }
 
@@ -5715,12 +5677,11 @@ void SMESHGUI::storeVisualParameters (int savePoint)
                                                              savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
-  // store map of custom markers
-  const VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
-  if( !aMarkerMap.empty() )
+  // store custom markers
+  if( !myMarkerMap.empty() )
   {
-    VTK::MarkerMap::const_iterator anIter = aMarkerMap.begin();
-    for( ; anIter != aMarkerMap.end(); anIter++ )
+    VTK::MarkerMap::const_iterator anIter = myMarkerMap.begin();
+    for( ; anIter != myMarkerMap.end(); anIter++ )
     {
       int anId = anIter->first;
       VTK::MarkerData aMarkerData = anIter->second;
@@ -6068,8 +6029,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                                                              savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
-  // restore map of custom markers and map of clipping planes
-  VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
+  // restore custom markers and map of clipping planes
   TPlaneDataMap aPlaneDataMap;
 
   std::vector<std::string> properties = ip->getProperties();
@@ -6126,7 +6086,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
           aMarkerTexture.push_back( aChar.digitValue() );
       }
 
-      aMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
+      myMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
     }
     else if( aPropertyType == "ClippingPlane" )
     {
@@ -6644,8 +6604,8 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                     aSmeshActor->SetMarkerStd( (VTK::MarkerType)aParam1, (VTK::MarkerScale)aParam2 );
                   }
                   else if( data[0] == "custom" ) {
-                    VTK::MarkerMap::const_iterator markerIt = aMarkerMap.find( aParam1 );
-                    if( markerIt != aMarkerMap.end() ) {
+                    VTK::MarkerMap::const_iterator markerIt = myMarkerMap.find( aParam1 );
+                    if( markerIt != myMarkerMap.end() ) {
                       VTK::MarkerData aMarkerData = markerIt->second;
                       aSmeshActor->SetMarkerTexture( aParam1, aMarkerData.second );
                     }
@@ -7049,7 +7009,7 @@ bool SMESHGUI::renameAllowed( const QString& entry) const {
     return false;
 
   // check type to prevent renaming of inappropriate objects
-  int aType = SMESHGUI_Selection::type(qPrintable(entry), SMESH::GetActiveStudyDocument());
+  int aType = SMESHGUI_Selection::type(qPrintable(entry));
   if (aType == SMESH::MESH || aType == SMESH::GROUP ||
       aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
       aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
@@ -7096,7 +7056,7 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
     if ( obj->FindAttribute(anAttr, "AttributeName") ) {
       aName = anAttr;
       // check type to prevent renaming of inappropriate objects
-      int aType = SMESHGUI_Selection::type( qPrintable(entry), SMESH::GetActiveStudyDocument() );
+      int aType = SMESHGUI_Selection::type( qPrintable(entry));
       if (aType == SMESH::MESH || aType == SMESH::GROUP ||
           aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
           aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
index 92a51bf56bb073f03f6c8a6dec22384d713d0f44..44b7671bbfb4187056a99a239e731197910febc5 100644 (file)
@@ -63,8 +63,6 @@ class LightApp_SelectionMgr;
 class SMESH_Actor;
 class SMESHGUI_FilterLibraryDlg;
 
-typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
-
 namespace SMESH
 {
   class OrientedPlane;
@@ -96,14 +94,14 @@ public :
   static SUIT_ResourceMgr*        resourceMgr();
   static SUIT_Desktop*            desktop();
   static SalomeApp_Study*         activeStudy();
-  
-  bool                            isActiveStudyLocked();
 
   static bool                     automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0);
   static bool                     automaticUpdate( SMESH::SMESH_IDSource_ptr, int*, bool*, int*, long* );
 
   static void                     Modified( bool = true );
 
+  static bool                     isStudyLocked( bool = true );
+
   virtual LightApp_Displayer*     displayer();
   virtual QString                 engineIOR() const;
   virtual void                    initialize( CAM_Application* );
@@ -225,7 +223,7 @@ private :
 
   SMESHGUI_FilterLibraryDlg*      myFilterLibraryDlg;
 
-  SMESHGUI_StudyId2MarkerMap      myMarkerMap;
+  VTK::MarkerMap                  myMarkerMap;
   SMESHGUI_ClippingPlaneInfoMap   myClippingPlaneInfoMap;
 
   vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
index 30a8fc92d6f29faa74f8de50050ceb17dc7454d5..a015b4181e1bdd6b9b04185f0d633b1ea2023cfc 100644 (file)
@@ -310,8 +310,7 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::selectionDone()
     _PTR(SObject) group0DRoot;
     if ( meshSO && meshSO->FindSubObject( SMESH::Tag_0DElementsGroups, group0DRoot ))
     {
-      _PTR(Study)              aStudy = SMESH::GetActiveStudyDocument();
-      _PTR(ChildIterator) group0DIter = aStudy->NewChildIterator( group0DRoot );
+      _PTR(ChildIterator) group0DIter = SMESH::getStudy()->NewChildIterator( group0DRoot );
       for ( ; group0DIter->More(); group0DIter->Next() )
       {
         _PTR(SObject) groupSO = group0DIter->Value();
index 25bbd46e7c12d24af2e0db2541e6bb6c3d72ffe7..aea995c8823cd43610f476b0bde02abcaff123e4 100644 (file)
@@ -549,7 +549,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
   if( !isValid() )
     return;
 
-  if (myNbOkNodes && !mySMESHGUI->isActiveStudyLocked()) {
+  if (myNbOkNodes && !SMESHGUI::isStudyLocked()) {
     myBusy = true;
     QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
     SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
index c24dbc4b3eac838cee465990b0267b74649f2dd1..d23b066288f8f4dc0a544483baa14a54a0dd881b 100644 (file)
@@ -686,7 +686,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
   if( !isValid() )
     return false;
 
-  if ( mySMESHGUI->isActiveStudyLocked() || myBusy || !IsValid() )
+  if ( SMESHGUI::isStudyLocked() || myBusy || !IsValid() )
     return false;
 
   BusyLocker lock( myBusy );
index aac578ba22440c023b86bdbc78fd84907d199f1c..0cd63352b9c86ce79a25a0f6561459fda6ef0c86 100644 (file)
@@ -250,10 +250,7 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation)
   QString aName = "";
 
   // collect all object names of SMESH component
-  SalomeApp_Study* appStudy =
-    dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-  if ( !appStudy ) return aName;
-  _PTR(Study) aStudy = appStudy->studyDS();
+  _PTR(Study) aStudy = SMESH::getStudy();
 
   std::set<std::string> aSet;
   _PTR(SComponent) aMeshCompo (aStudy->FindComponent("SMESH"));
@@ -283,7 +280,7 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation)
 //=================================================================================
 bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if (!isValid())
@@ -335,7 +332,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
       SMESH::UpdateView();
 
       _PTR(SObject) aSO = SMESH::FindSObject(aMesh.in());
-      if ( SMESH_Actor* anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()) ) {
+      if ( SMESH_Actor* anActor = SMESH::CreateActor( aSO->GetID().c_str()) ) {
         SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
         SMESH::UpdateView();
       }
index d7d455b6d79cf5dd58d9cb0247e70e8f802e4cb9..55a87509d6480b73bd28f60640a6244d00e53c2f 100644 (file)
@@ -1068,11 +1068,7 @@ void SMESHGUI_ClippingDlg::updateActorList()
 {
   ActorList->clear();
 
-  SalomeApp_Study* anAppStudy = SMESHGUI::activeStudy();
-  if( !anAppStudy )
-    return;
-
-  _PTR(Study) aStudy = anAppStudy->studyDS();
+  _PTR(Study) aStudy = SMESH::getStudy();
   if( !aStudy )
     return;
 
index 5a32503a1ae6f702a5a77476fc44675e3a1cbbc8..fa746f19a679bbee85c03ec280dffcb652fd0213 100644 (file)
@@ -379,9 +379,7 @@ namespace SMESH
     _PTR(SObject) so = SMESH::FindSObject(aMainShape);
     if ( subShapeID == 1 || !so )
       return so;
-    _PTR(ChildIterator) it;
-    if (_PTR(Study) study = SMESH::GetActiveStudyDocument())
-      it =  study->NewChildIterator(so);
+    _PTR(ChildIterator) it = SMESH::getStudy()->NewChildIterator(so);
     _PTR(SObject) subSO;
     if ( it ) {
       for ( it->InitEx(true); !subSO && it->More(); it->Next() ) {
@@ -927,7 +925,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
 
     // NPAL16631: if ( !memoryLack )
     {
-      _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID(myIObject->getEntry());
+      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID(myIObject->getEntry());
       SMESH::ModifiedMesh( sobj,
                            !computeFailed && aHypErrors.isEmpty(),
                            myMesh->NbNodes() == 0);
@@ -998,8 +996,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
               {
                 toDisplay = true;
                 SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
-                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(),
-                                                              (*anIter).second->GetID().c_str(),
+                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetID().c_str(),
                                                               /*clearLog =*/ true );
                 if ( anActor ) // actor is not created for an empty mesh
                 {
@@ -1267,7 +1264,6 @@ void SMESHGUI_BaseComputeOp::stopOperation()
 void SMESHGUI_BaseComputeOp::onPublishShape()
 {
   GEOM::GEOM_Gen_var      geomGen = SMESH::GetGEOMGen();
-  SALOMEDS::Study_var       study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
   GEOM::GEOM_Object_var meshShape = myMesh->GetShapeToMesh();
 
   QStringList entryList;
@@ -1283,7 +1279,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
       if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
       {
         QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
-        SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, myMainShape,
+        SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape,
                                                          name.toLatin1().data(),
                                                          GEOM::GEOM_Object::_nil());
         // look for myMainShape in the table
@@ -1302,7 +1298,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
         if ( curSub == 1 ) continue;
       }
       QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
-      SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape,
+      SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape,
                                                        name.toLatin1().data(), myMainShape);
       if ( !so->_is_nil() ) {
         CORBA::String_var name  = so->GetName();
@@ -1743,7 +1739,7 @@ void SMESHGUI_PrecomputeOp::initDialog()
   QList<int> modes;
 
   QMap<int, int> modeMap;
-  _PTR(SObject)  pMesh = studyDS()->FindObjectID( myIObject->getEntry() );
+  _PTR(SObject)  pMesh = SMESH::getStudy()->FindObjectID( myIObject->getEntry() );
   getAssignedAlgos( pMesh, modeMap );
   if ( modeMap.contains( SMESH::DIM_3D ) )
   {
@@ -1786,8 +1782,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject)  theMesh,
   int aPart = SMESH::Tag_RefOnAppliedAlgorithms;
   if ( theMesh->FindSubObject( aPart, aHypFolder ))
   {
-    _PTR(ChildIterator) anIter =
-      SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
+    _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
     for ( ; anIter->More(); anIter->Next() )
     {
       _PTR(SObject) anObj = anIter->Value();
@@ -1830,8 +1825,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject)  theMesh,
     if ( !theMesh->FindSubObject( aPart, aHypFolder ))
       continue;
 
-    _PTR(ChildIterator) anIter =
-      SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
+    _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
     for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
     {
       _PTR(SObject) anObj = anIter->Value();
index 3afa881c15178f5b4a3e82a8ed7b627e900d95e9..b412f118decabcaab2c3ad1fec4dcec414ee4313 100644 (file)
@@ -129,7 +129,7 @@ void SMESHGUI_ConvToQuadOp::selectionDone()
   try
   {
     QString anObjEntry = myDlg->selectedObject( 0 );
-    _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
     if ( !pObj ) return;
 
     SMESH::SMESH_IDSource_var idSource = 
@@ -204,7 +204,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
   QString aMess;
 
   QString anObjEntry = myDlg->selectedObject( 0 );
-  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
   if ( !pObj )
   {
     dlg()->show();
@@ -382,7 +382,7 @@ SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSourc
 void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id )
 {
   QString anObjEntry = myDlg->selectedObject( 0 );
-  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
   if ( !pObj ) return;
 
   SMESH::SMESH_IDSource_var idSource = 
index 0fc5aef49ba59fd75f94e995ff9e4a20ef7ee09d..b6609fcff170f51dbd081d3852524135d9223d89 100644 (file)
@@ -303,7 +303,7 @@ void SMESHGUI_CopyMeshDlg::Init (bool ResetControls)
 
 bool SMESHGUI_CopyMeshDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if( !isValid() )
index e938f0667250f9a48878ba630d0ebf2b9ae07f7d..38f64d2ad93ae9a334323a1e19e2e3a7ec0c6bde 100644 (file)
@@ -448,7 +448,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
   if( !isValid() )
     return;
 
-  if ( myNbOkElements>0 && !mySMESHGUI->isActiveStudyLocked())
+  if ( myNbOkElements>0 && !SMESHGUI::isStudyLocked())
     {
       if(checkEditLine(false) == -1) {return;}
       busy = true;
index 7711022c36f3a4372bbb18b3aecb12cac125cac7..6f589a9a0e42c5bd7568036fab40709e6c3f8bc9 100644 (file)
@@ -194,7 +194,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid()
     return false;
   }
 
-  return !mySMESHGUI->isActiveStudyLocked();
+  return !SMESHGUI::isStudyLocked();
 }
 
 //=================================================================================
index 5af7f78159e78780147431139fad3136f9e6f62e..fd673c22a2ba68d98f2ef6549fd71bf674f77987 100644 (file)
@@ -97,7 +97,7 @@ SMESHGUI_DisplayEntitiesDlg::SMESHGUI_DisplayEntitiesDlg( QWidget* parent )
   hl->addWidget( nb0DElemsLab, 0, 1 );
   my0DElemsTB->setEnabled( nbElements );
   nb0DElemsLab->setEnabled( nbElements );
-  myNbTypes += ( nbElements > 0 );
+  myNbTypes = ( nbElements > 0 );
 
   // Edges
   nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_Edge ) : aMesh->NbEdges();
@@ -233,8 +233,7 @@ void SMESHGUI_DisplayEntitiesDlg::onOk()
   const char* entry = myIObject->getEntry();
   
   if ( !myActor ) {
-    myActor = SMESH::CreateActor(SMESH::GetActiveStudyDocument(), 
-                                 entry, true);
+    myActor = SMESH::CreateActor(entry, true);
   }
 
   if( myEntityMode != myActor->GetEntityMode() ) {
index 6fa1ee65c890bcd55e362321a7c2965725f447e5..633d9196abbb7570e76281e887a010e33ca567a0 100644 (file)
@@ -68,7 +68,7 @@ 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( entry.toLatin1().data(), true );
       if( anActor )
       {
         SMESH::DisplayActor( wnd, anActor );
@@ -94,12 +94,7 @@ bool SMESHGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vi
   if(viewer_type != SVTK_Viewer::Type())
     return res;
   
-  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
-  if( !study )
-    return res;
-  
-  
-  _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry.toLatin1() );
+  _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( (const char*)entry.toLatin1() );
   CORBA::Object_var anObj = SMESH::SObjectToObject( obj );
   
     /*
index 297a85d47dba5cfbcbc5125142cdc8d0796e722b..0eb48be8378e641ea1cc7d896db40f1befad5585 100644 (file)
@@ -395,7 +395,7 @@ void SMESHGUI_DuplicateNodesDlg::onConstructorsClicked (int constructorId)
 */
 bool SMESHGUI_DuplicateNodesDlg::onApply()
 {
-  if ( mySMESHGUI->isActiveStudyLocked() || !isValid() )
+  if ( SMESHGUI::isStudyLocked() || !isValid() )
     return false;
 
   BusyLocker lock( myBusy );
index 9b6ce1843a433aec2cd615b149e4feafcd3c4d87..417d1f803f4a813800dca173f6df50f98a9948aa 100644 (file)
@@ -394,7 +394,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::CheckIsEnable()
 //=================================================================================
 bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if ( !SelectorWdg->IsAnythingSelected() || myPath->_is_nil() )
index 205544cfa0993ba688f3dfd69a386640774a7525..7a37a17158400f98af2d3fad2914c06d2a20197e 100644 (file)
@@ -1092,7 +1092,7 @@ void SMESHGUI_ExtrusionDlg::ClickOnRadio()
 
 bool SMESHGUI_ExtrusionDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if (!isValid())
index 8b060f647c19d1c999e820f0673fac252cc3aeaf..7ab25ef53d2fcc21494496e5779e51e3e94ea6f6 100644 (file)
@@ -92,9 +92,8 @@ GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
   myFields = & fields;
   myTree->clear();
   
-  _PTR(Study) study = SMESH::GetActiveStudyDocument();
   GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-  GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations( study->StudyId() );
+  GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations();
 
   for ( int iM = 0; iM < meshes.count(); ++iM )
   {
index 4e7f6bf5ff91f1fb827ca8e6f3a2088478e904ae..00fdedfaedad522da9aa3941c9b953b391bb39c2 100755 (executable)
@@ -1369,8 +1369,7 @@ void SMESHGUI_FilterTable::SetCriterion (const int                       theRow,
   {
     if ( strlen( theCriterion.ThresholdID ) > 0 ) // shape ID -> name
     {
-      _PTR(SObject) sobj =
-        SMESH::GetActiveStudyDocument()->FindObjectID( theCriterion.ThresholdID.in() );
+      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( theCriterion.ThresholdID.in() );
       if ( !sobj )
         aTable->item( theRow, 2 )->setText( QString( theCriterion.ThresholdID ) );
       else
@@ -3195,8 +3194,7 @@ bool SMESHGUI_FilterDlg::isValid() const
       QString aName;
       myTable->GetThreshold(i, aName);
 
-      std::vector<_PTR(SObject)> aList =
-        SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
+      std::vector<_PTR(SObject)> aList = SMESH::getStudy()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
       if (aList.size() == 0) {
         SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
                                      tr("BAD_SHAPE_NAME").arg(aName));
index 5ec69fed3974685b0e6d6e8cefec956a777e021c..a23d80aa330af5e6685a294cc48c8add33c50edd 100644 (file)
@@ -495,7 +495,7 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone()
     if (aList.Extent() == 1 && aList.First()->hasEntry())
     {
       Handle(SALOME_InteractiveObject) anIO = aList.First();
-      _PTR(SObject) pObj = studyDS()->FindObjectID(anIO->getEntry());
+      _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anIO->getEntry());
       CORBA::Object_var anObj = SMESH::IObjectToObject( anIO );
       newMeshEntry = anIO->getEntry();
       SMESH::SMESH_IDSource_var aMeshOrPart = SMESH::SMESH_IDSource::_narrow(anObj);
index 974b54ff88e1b17e6cae96b89332c9a59d62bcaa..5367420060850c3a9f8e3d8bada1c2cdd4261f5d 100644 (file)
@@ -93,11 +93,7 @@ namespace SMESH
     if ( !aMeshShape->_is_nil() )
       return aMeshShape;
 
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    if (!aStudy)
-      return aMeshShape;
-
-    _PTR(ChildIterator) anIter (aStudy->NewChildIterator(theSO));
+    _PTR(ChildIterator) anIter (SMESH::getStudy()->NewChildIterator(theSO));
     for ( ; anIter->More(); anIter->Next()) {
       _PTR(SObject) aSObject = anIter->Value();
       _PTR(SObject) aRefSOClient;
@@ -120,11 +116,7 @@ namespace SMESH
     if (!smeshSO)
       return 0;
 
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    if (!aStudy)
-      return 0;
-
-    _PTR(ChildIterator) anIter (aStudy->NewChildIterator( smeshSO ));
+    _PTR(ChildIterator) anIter (SMESH::getStudy()->NewChildIterator( smeshSO ));
     for ( ; anIter->More(); anIter->Next()) {
       _PTR(SObject) aSObject = anIter->Value();
       _PTR(SObject) aRefSOClient;
@@ -153,11 +145,10 @@ namespace SMESH
                                      long                  theID)
   {
     GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    if (!aStudy || geomGen->_is_nil())
+    if (geomGen->_is_nil())
       return GEOM::GEOM_Object::_nil();
     GEOM::GEOM_IShapesOperations_wrap aShapesOp =
-      geomGen->GetIShapesOperations(aStudy->StudyId());
+      geomGen->GetIShapesOperations();
     if (aShapesOp->_is_nil())
       return GEOM::GEOM_Object::_nil();
     GEOM::GEOM_Object_wrap subShape = aShapesOp->GetSubShape (theMainShape,theID);
@@ -183,10 +174,7 @@ namespace SMESH
     meshGeom.clear();
     if ( hypIO.IsNull() ) return false;
 
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    if ( !aStudy ) return false;
-
-    _PTR(SObject) hypSO = aStudy->FindObjectID( hypIO->getEntry() );
+    _PTR(SObject) hypSO = SMESH::getStudy()->FindObjectID( hypIO->getEntry() );
     if ( !hypSO ) return false;
 
     // Depth() is a number of fathers
index c7d806b7da09362543e0ff236a00ef96c5072eb5..ce7f8b88af92956310cc239b856e2920d0f1cefa 100644 (file)
@@ -498,10 +498,7 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
   QString aName = "";
 
   // collect all object names of SMESH component
-  SalomeApp_Study* appStudy =
-    dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-  if ( !appStudy ) return aName;
-  _PTR(Study) aStudy = appStudy->studyDS();
+  _PTR(Study) aStudy = SMESH::getStudy();
 
   std::set<std::string> aSet;
   _PTR(SComponent) aMeshCompo (aStudy->FindComponent( "SMESH" ));
@@ -528,14 +525,13 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
 void  SMESHGUI_GroupDlg::setDefaultName() const
 {
   QString aResName;
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
   int i=1;
   QString aPrefix ="Group_";
   _PTR(SObject) anObj;
   do
   {
     aResName = aPrefix + QString::number( i++ );
-    anObj = aStudy->FindObject( SMESH::toUtf8(aResName) );
+    anObj = SMESH::getStudy()->FindObject( SMESH::toUtf8(aResName) );
   }
   while ( anObj );
   myName->setText(aResName); 
@@ -664,7 +660,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
   else if ( grpType == 1 ) // group on geom
   {
     QString aShapeName( "" );
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
     GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape();
     if (!aGroupShape->_is_nil())
     {
@@ -915,7 +911,7 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
 //=================================================================================
 bool SMESHGUI_GroupDlg::onApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if (myName->text().trimmed().isEmpty())
@@ -1050,7 +1046,7 @@ bool SMESHGUI_GroupDlg::onApply()
       if (myMesh->_is_nil() || !myGeomObjects->length())
         return false;
 
-      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+      _PTR(Study) aStudy = SMESH::getStudy();
 
       if (myGeomObjects->length() == 1) {
         myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
@@ -1064,12 +1060,11 @@ bool SMESHGUI_GroupDlg::onApply()
 
         // create a geometry group
         GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 
-        if (geomGen->_is_nil() || !aStudy)
+        if (geomGen->_is_nil())
           return false;
 
-        GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
+        GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
         if (op->_is_nil())
           return false;
 
@@ -1095,7 +1090,7 @@ bool SMESHGUI_GroupDlg::onApply()
           QString aNewGeomGroupName ( "Auto_group_for_" );
           aNewGeomGroupName += myName->text();
           SALOMEDS::SObject_var aNewGroupSO =
-            geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
+            geomGen->AddInStudy(aGroupVar,
                                 SMESH::toUtf8(aNewGeomGroupName), aMeshShape);
         }
 
@@ -1412,13 +1407,12 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
           continue;
 
         // Check if group constructed on the same shape as a mesh or on its child
-        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 
         // The main shape of the group
         GEOM::GEOM_Object_var aGroupMainShape;
         if (aGeomGroup->GetType() == 37) {
           GEOM::GEOM_IGroupOperations_wrap anOp =
-            SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+            SMESH::GetGEOMGen()->GetIGroupOperations();
           aGroupMainShape = anOp->GetMainShape(aGeomGroup);
           // aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
         }
@@ -1427,7 +1421,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
           aGroupMainShape->Register();
         }
         _PTR(SObject) aGroupMainShapeSO =
-          aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
+          SMESH::getStudy()->FindObjectID(aGroupMainShape->GetStudyEntry());
 
         _PTR(SObject) anObj, aRef;
         bool isRefOrSubShape = false;
@@ -2006,9 +2000,8 @@ void SMESHGUI_GroupDlg::onAdd()
     onListSelectionChanged();
 
   } else if (myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1) {
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
     GEOM::GEOM_IGroupOperations_wrap aGroupOp =
-      SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+      SMESH::GetGEOMGen()->GetIGroupOperations();
 
     SMESH::ElementType aGroupType = SMESH::ALL;
     switch(aGroupOp->GetType(myGeomObjects[0])) {
@@ -2021,8 +2014,8 @@ void SMESHGUI_GroupDlg::onAdd()
 
     if (aGroupType == aType) {
       _PTR(SObject) aGroupSO =
-        //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
-        aStudy->FindObjectID(myGeomObjects[0]->GetStudyEntry());
+        //SMESH::getStudy()->FindObjectIOR(SMESH::getStudy()->ConvertObjectToIOR(myGeomGroup));
+        SMESH::getStudy()->FindObjectID(myGeomObjects[0]->GetStudyEntry());
       // Construct filter
       SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
       SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
@@ -2454,8 +2447,7 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op)
     if ( !aGeomVar->_is_nil() )
     {
       QString ID = aGeomVar->GetStudyEntry();
-      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-      if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
+      if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) {
         SALOME_ListIO anIOList;
         Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
           ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
index dc1461cda8159a93ab2669695854a27dc2a2c1f7..aaf5f6801e7816bc65f882f23fd720d2da8bf6dc 100644 (file)
@@ -219,13 +219,12 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom)
     case GEOM::COMPOUND: break;
     default:             return SMESH::ALL;
     }
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
     GEOM::GEOM_IShapesOperations_wrap aShapeOp =
-      SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());
+      SMESH::GetGEOMGen()->GetIShapesOperations();
 
     if ( geom->GetType() == 37 ) { // geom group
       GEOM::GEOM_IGroupOperations_wrap aGroupOp =
-        SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+        SMESH::GetGEOMGen()->GetIGroupOperations();
       if ( !aGroupOp->_is_nil() ) {
         // mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
         GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom );
@@ -296,11 +295,11 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
 {
   SUIT_OverrideCursor aWaitCursor;
 
-  if (isStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   // study
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  _PTR(Study) aStudy = SMESH::getStudy();
   if ( !aStudy ) return false;
 
   // mesh
@@ -460,7 +459,7 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
   QStringList goodNames, goodIds;
   if (nbSelected > 0) {
     // study
-    if (_PTR(Study) aStudy = SMESH::GetActiveStudyDocument()) {
+    if (_PTR(Study) aStudy = SMESH::getStudy()) {
       // mesh
       if (_PTR(SObject)  meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() )) {
         // shape to mesh
index 915933dc40e028d5e138cbc5b3c2133f0a8a940d..b4084b6655b391f4cf23e1a6d91dbff3b7e09e78 100644 (file)
@@ -629,7 +629,7 @@ void SMESHGUI_UnionGroupsDlg::reset()
 */
 bool SMESHGUI_UnionGroupsDlg::onApply()
 {
-  if ( getSMESHGUI()->isActiveStudyLocked())
+  if ( SMESHGUI::isStudyLocked())
     return false;
 
   // Verify validity of group name
@@ -738,7 +738,7 @@ void SMESHGUI_IntersectGroupsDlg::reset()
 */
 bool SMESHGUI_IntersectGroupsDlg::onApply()
 {
-  if ( getSMESHGUI()->isActiveStudyLocked())
+  if ( SMESHGUI::isStudyLocked())
     return false;
 
   // Verify validity of group name
@@ -898,7 +898,7 @@ void SMESHGUI_CutGroupsDlg::reset()
 */
 bool SMESHGUI_CutGroupsDlg::onApply()
 {
-  if ( getSMESHGUI()->isActiveStudyLocked())
+  if ( SMESHGUI::isStudyLocked())
     return false;
 
   // Verify validity of group name
@@ -1088,7 +1088,7 @@ void SMESHGUI_DimGroupDlg::setElementType( const SMESH::ElementType& theElemType
 */
 bool SMESHGUI_DimGroupDlg::onApply()
 {
-  if ( getSMESHGUI()->isActiveStudyLocked())
+  if ( SMESHGUI::isStudyLocked())
     return false;
 
   // Verify validity of group name
index f313c8ce2cba016f685848be11629ca21aec2226..bbb79cfe37e233e780e26c3fdc47f52d0e42e886 100644 (file)
@@ -213,7 +213,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
       case QVariant::String:
         {
           if((*anIt).isVariable) {
-            _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+            _PTR(Study) aStudy = SMESH::getStudy();
             QString aVar = (*anIt).myValue.toString();
             if(aStudy->IsInteger(aVar.toLatin1().constData())){
               SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
@@ -298,7 +298,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
   {
     //remove just created hypothesis
     _PTR(SObject) aHypSObject = SMESH::FindSObject( myHypo );
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
     if( aStudy && !aStudy->GetProperties()->IsLocked() )
     {
       _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
index 021e003b93ada81e5b8ac34a605df6fa074364ff..12668b5bf8f983b5a9feb386940a89f52b270cb6 100644 (file)
@@ -701,7 +701,7 @@ namespace SMESH
     SUIT_OverrideCursor wc;
 
     try {
-      _PTR(Study) aStudy = GetActiveStudyDocument();
+      _PTR(Study) aStudy = getStudy();
       _PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
       if( aHypObj )
       {
@@ -785,8 +785,7 @@ namespace SMESH
     if (!AlgoOrHyp->_is_nil()) {
       _PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
       if (SO_Hypothesis) {
-        SObjectList listSO =
-          SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
+        SObjectList listSO = SMESH::getStudy()->FindDependances(SO_Hypothesis);
 
         if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
         for (unsigned int i = 0; i < listSO.size(); i++) {
index e5eef00dd02ec8317a4a12a67930e1610e68be0a..73c54eb1ca251a616187e101b1ebc48490b97ea8 100644 (file)
@@ -302,8 +302,7 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone()
       bool isMesh = true;
       for ( int i = 0; i < ids.count() && isMesh; ++i )
       {
-        _PTR(SObject) sobj =
-          SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
+        _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toLatin1().constData() );
         mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );  
         //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
       }
@@ -356,7 +355,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
     for ( int i = 0; i < entries.count(); ++i )
     {
       SMESH::SMESH_GroupBase_var grp;
-      if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ))
+      if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ))
         grp = SMESH::SObjectToInterface<SMESH::SMESH_GroupBase>( sobj );
       if ( grp->_is_nil() ) {
         msg = tr( "SMESH_NOT_ONLY_GROUPS" );
@@ -370,7 +369,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
   for ( int i = 0; i < entries.count(); ++i )
   {
     SMESH::SMESH_IDSource_var idSource;
-    if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ))
+    if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ))
       idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
     if ( !idSource->_is_nil() ) {
       SMESH::array_of_ElementType_var types = idSource->GetTypes();
@@ -428,8 +427,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
       groups->length( entries.count() );
       for ( int i = 0; i < entries.count(); ++i )
       {
-        _PTR(SObject) sobj =
-          SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() );
+        _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() );
         SMESH::SMESH_IDSource_var grp = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );  
         SMESH::array_of_ElementType_var types = grp->GetTypes();
         if ( types->length() < 1 || types[0] != goodType )
@@ -482,7 +480,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
 
 bool SMESHGUI_Make2DFrom3DOp::onApply()
 {
-  if ( isStudyLocked() )
+  if ( SMESHGUI::isStudyLocked() )
     return false;
 
   QString msg;
index 385bb8f1b95adc6bafe8ef53e340946858e53d8f..cd5a89ff5c3de644c2369612222b06d3cde59c82 100644 (file)
@@ -493,7 +493,7 @@ void SMESHGUI_MakeNodeAtPointOp::stopOperation()
 
 bool SMESHGUI_MakeNodeAtPointOp::onApply()
 {
-  if( isStudyLocked() )
+  if( SMESHGUI::isStudyLocked() )
     return false;
 
   if ( !myMeshActor ) {
index 2aba558af7aa5b6a827d67a863e8545462c1a3cf..d25b65970ef32240d3939f6cc4d85ac96475330e 100644 (file)
@@ -511,7 +511,7 @@ void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
 //=================================================================================
 bool SMESHGUI_MergeDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
+  if (SMESHGUI::isStudyLocked() || myMesh->_is_nil())
     return false;
 
   try {
index c2932c2032730c788df81e2b55bf9fcdc5a9576f..610ccc08ca3d60f4ece94066410aeae96ee2f76c 100644 (file)
 
 namespace {
 
-const int SPACING      = 6;
-const int MARGIN       = 9;
-const int MAXITEMS     = 10;
-const int GROUPS_ID    = 100;
-const int SUBMESHES_ID = 200;
-const int SPACING_INFO = 2;
-
-enum InfoRole {
-  TypeRole = Qt::UserRole + 10,
-  IdRole,
-};
-
-enum InfoType {
-  NodeConnectivity = 100,
-  ElemConnectivity,
-};
+  const int SPACING      = 6;
+  const int MARGIN       = 9;
+  const int MAXITEMS     = 10;
+  const int GROUPS_ID    = 100;
+  const int SUBMESHES_ID = 200;
+  const int SPACING_INFO = 2;
+
+  const char* id_preview_resource = "id_preview_resource";
+
+  enum InfoRole {
+    TypeRole = Qt::UserRole + 10,
+    IdRole,
+  };
+
+  enum InfoType {
+    NodeConnectivity = 100,
+    ElemConnectivity,
+  };
 } // namesapce
 
 /*!
@@ -2942,6 +2944,8 @@ SMESHGUI_MeshInfoDlg::SMESHGUI_MeshInfoDlg( QWidget* parent, int page )
   connect( myElemInfo,  SIGNAL( itemInfo( int )),     this, SLOT( showItemInfo( int )));
   connect( myElemInfo,  SIGNAL( itemInfo( QString )), this, SLOT( showItemInfo( QString )));
 
+  myIDPreviewCheck->setChecked( SMESHGUI::resourceMgr()->booleanValue( "SMESH", id_preview_resource, false ));
+
   updateSelection();
 }
 
@@ -3189,6 +3193,7 @@ void SMESHGUI_MeshInfoDlg::idChanged()
 void SMESHGUI_MeshInfoDlg::idPreviewChange( bool isOn )
 {
   myIDPreview->SetPointsLabeled( isOn && !myID->text().simplified().isEmpty() );
+  SMESHGUI::resourceMgr()->setValue("SMESH", id_preview_resource, isOn );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
     aViewWindow->Repaint();
 }
@@ -3211,12 +3216,6 @@ void SMESHGUI_MeshInfoDlg::showItemInfo( const QString& theStr )
 
 void SMESHGUI_MeshInfoDlg::dump()
 {
-  SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if ( !app ) return;
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study *>( app->activeStudy() );
-  if ( !appStudy ) return;
-  _PTR( Study ) aStudy = appStudy->studyDS();
-
   QStringList aFilters;
   aFilters.append( tr( "TEXT_FILES" ));
 
@@ -3968,12 +3967,6 @@ void SMESHGUI_CtrlInfoDlg::deactivate()
  */
 void SMESHGUI_CtrlInfoDlg::dump()
 {
-  SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if ( !app ) return;
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study *>( app->activeStudy() );
-  if ( !appStudy ) return;
-  _PTR( Study ) aStudy = appStudy->studyDS();
-
   QStringList aFilters;
   aFilters.append( tr( "TEXT_FILES" ));
 
index 43d92b9fc96c191ae3db98324bbbf30fb1e3a2f5..f9f5ab83ab4fe362ec1f26df2d76926d30d3a309 100644 (file)
@@ -133,7 +133,7 @@ LightApp_Dialog* SMESHGUI_MeshOp::dlg() const
 //================================================================================
 bool SMESHGUI_MeshOp::onApply()
 {
-  if (isStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   QString aMess;
@@ -227,7 +227,7 @@ void SMESHGUI_MeshOp::startOperation()
   }
   SMESHGUI_SelectionOp::startOperation();
   // iterate through dimensions and get available algorithms, set them to the dialog
-  _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
+  _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent( "SMESH" );
   for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
   {
     SMESHGUI_MeshTab* aTab = myDlg->tab( i );
@@ -329,7 +329,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
 
   // mesh
   QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
-  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+  _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
   if (!pMesh) return false;
 
   SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
@@ -345,17 +345,16 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
 
   if (aGEOMs.count() > 0) {
     GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    if (geomGen->_is_nil() || !aStudy) return false;
+    if (geomGen->_is_nil()) return false;
 
-    GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
+    GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
     if (op->_is_nil()) return false;
 
     // check all selected shapes
     QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
     for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) {
       QString aSubGeomEntry = (*aSubShapesIter);
-      _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
+      _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
       if (!pSubGeom) return false;
 
       GEOM::GEOM_Object_var aSubGeomVar =
@@ -375,7 +374,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
       if ( aSubGeomVar->GetShapeType() == GEOM::COMPOUND )
       {
         // is aSubGeomVar a compound of sub-shapes?
-        GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations(aStudy->StudyId());
+        GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations();
         if (sop->_is_nil()) return false;
         GEOM::ListOfLong_var ids = sop->GetAllSubShapesIDs( aSubGeomVar,
                                                             GEOM::SHAPE,/*sorted=*/false);
@@ -417,7 +416,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
 
     QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
     QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-    _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+    _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
     if ( pMesh ) {
 
       QStringList algoNames;
@@ -433,7 +432,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
       }
 
 //       GEOM::GEOM_Object_var geom;
-//       if (_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() ))
+//       if (_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ))
 //         geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
 
 //       if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well
@@ -462,8 +461,8 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
 {
   QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
   QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
-  _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+  _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
+  _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
   if ( pMesh && pGeom ) {
     GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
     if ( !geom->_is_nil() ) {
@@ -480,7 +479,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
       }
       _PTR(GenericAttribute) anAttr;
       _PTR(SObject) aSubmeshRoot;
-      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+      _PTR(Study) aStudy = SMESH::getStudy();
       if ( pMesh->FindSubObject( tag, aSubmeshRoot ) )
       {
         _PTR(ChildIterator) smIter = aStudy->NewChildIterator( aSubmeshRoot );
@@ -523,7 +522,7 @@ void SMESHGUI_MeshOp::selectionDone()
 
     //Check geometry for mesh
     QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj);
-    _PTR(SObject) pObj = studyDS()->FindObjectID(anObjEntry.toLatin1().data());
+    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anObjEntry.toLatin1().data());
     if (pObj)
     {
       SMESH::SMESH_Mesh_var aMeshVar =
@@ -551,7 +550,7 @@ void SMESHGUI_MeshOp::selectionDone()
         int iSubSh = 0;
         for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
           QString aSubGeomEntry = (*aSubShapesIter);
-          _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
+          _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
          
           if( pSubGeom ) { 
             SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom);
@@ -567,7 +566,7 @@ void SMESHGUI_MeshOp::selectionDone()
       } else {
         // get geometry by selected sub-mesh
         QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
-        _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+        _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
         GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
         if (!aGeomVar->_is_nil()) {
           aSeq->length(1);
@@ -694,12 +693,12 @@ void SMESHGUI_MeshOp::selectionDone()
         // enable/disable popup for choice of geom selection way
         bool enable = false;
         QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
-        if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
+        if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
           SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
           if ( !mesh->_is_nil() ) {
             //rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry
             QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-            _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+            _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
             if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
               myDlg->activateObject(SMESHGUI_MeshDlg::Geom);
             enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 );
@@ -774,7 +773,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
   {
     QString aMeshEntry = myDlg->selectedObject
       ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
-    if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
+    if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
       SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
       if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) {
         theMess = tr( "IMPORTED_MESH" );
@@ -803,7 +802,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
       }
       return true;
     }
-    _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+    _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
     if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
     {
       theMess = tr( "GEOMETRY_OBJECT_IS_NULL" );
@@ -819,7 +818,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
         theMess = tr( "MESH_IS_NOT_DEFINED" );
         return false;
       }
-      _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+      _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
       if ( !pMesh || SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() )->_is_nil() )
       {
         theMess = tr( "MESH_IS_NULL" );
@@ -946,7 +945,7 @@ void SMESHGUI_MeshOp::availableHyps( const int       theDim,
   QString aCurrentGeomToSelect;
   if ( !theMeshType.isEmpty() ) {
     aCurrentGeomToSelect = myDlg->selectedObject( myToCreate ? SMESHGUI_MeshDlg::Geom : SMESHGUI_MeshDlg::Obj );
-    if ( _PTR(SObject) so = studyDS()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) {
+    if ( _PTR(SObject) so = SMESH::getStudy()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) {
       aGeomVar = SMESH::GetGeom( so );
     }
    if ( aCurrentGeomToSelect != myLastGeomToSelect )
@@ -1050,8 +1049,7 @@ void SMESHGUI_MeshOp::existingHyps( const int       theDim,
 
   if ( theFather->FindSubObject( aPart, aHypRoot ) )
   {
-    _PTR(ChildIterator) anIter =
-      SMESH::GetActiveStudyDocument()->NewChildIterator( aHypRoot );
+    _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypRoot );
     for ( ; anIter->More(); anIter->Next() )
     {
       _PTR(SObject) anObj = anIter->Value();
@@ -1122,14 +1120,14 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
   {
     anEntry = myDlg->selectedObject
       ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
-    if ( _PTR(SObject) pObj = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+    if ( _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
     {
       CORBA::Object_ptr Obj = _CAST( SObject,pObj )->GetObject();
       if ( myToCreate ) // mesh and geom may be selected
       {
         aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj );
         anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-        if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+        if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
           aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
       }
       else // edition: sub-mesh may be selected
@@ -1147,7 +1145,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
     if ( !myToCreate ) // mesh to edit can be selected
     {
       anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
-      if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+      if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
       {
         aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
         if ( !aMeshVar->_is_nil() )
@@ -1156,7 +1154,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
     }
     if ( aGeomVar->_is_nil() ) {
       anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-      if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+      if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
       {
         aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
       }
@@ -1199,13 +1197,13 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea
     aMeshEntry = aGeomEntry;
 
   if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited
-    _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
     GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
     aMeshEntry = ( aGeomVar->_is_nil() ) ? QString() : SMESH::toQStr( aGeomVar->GetStudyEntry() );
   }
 
   if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited
-    _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
     bool isMesh;
     GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh );
     if ( !aGeomVar->_is_nil() )
@@ -1218,7 +1216,7 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea
 
   if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) {
     // take geometry from submesh being created
-    _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
     if ( pObj ) {
       // if current object is sub-mesh
       SMESH::SMESH_subMesh_var aSubMeshVar =
@@ -1396,7 +1394,7 @@ void SMESHGUI_MeshOp::onHypoCreated( int result )
     myDlg->setEnabled( true );
   }
 
-  _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
+  _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent("SMESH");
 
   int nbHyp = myExistingHyps[myDim][myType].count();
   HypothesisData* algoData = hypData( myDim, Algo, currentHyp( myDim, Algo ));
@@ -1610,7 +1608,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
 
   // set hypotheses corresponding to the found algorithms
 
-  _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
+  _PTR(SObject) pObj = SMESH::getStudy()->FindComponent("SMESH");
 
   for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
   {
@@ -1829,7 +1827,7 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList )
   for ( int i = 0; it!=aList.end(); it++, ++i )
   {
     QString aGeomEntry = *it;
-    _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+    _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
     GEOM::GEOM_Object_var aGeomVar =
       GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
 
@@ -1896,7 +1894,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
 
   // get mesh object
   QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
-  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+  _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
   SMESH::SMESH_Mesh_var aMeshVar =
     SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
   if (aMeshVar->_is_nil())
@@ -1916,17 +1914,16 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
   {
     //QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
     QString aGeomEntry = aGEOMs.first();
-    _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+    _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
     aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
   }
   else if (aGEOMs.count() > 1)
   {
     // create a GEOM group
     GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    if (!geomGen->_is_nil() && aStudy) {
+    if (!geomGen->_is_nil()) {
       GEOM::GEOM_IGroupOperations_wrap op =
-        geomGen->GetIGroupOperations(aStudy->StudyId());
+        geomGen->GetIGroupOperations();
       if (!op->_is_nil()) {
         // check and add all selected GEOM objects: they must be
         // a sub-shapes of the main GEOM and must be of one type
@@ -1937,7 +1934,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
         QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
         for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
           QString aSubGeomEntry = (*aSubShapesIter);
-          _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
+          _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
           GEOM::GEOM_Object_var aSubGeomVar =
             GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
           TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType();
@@ -1960,9 +1957,8 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
           // publish the GEOM group in study
           QString aNewGeomGroupName ("Auto_group_for_");
           aNewGeomGroupName += aName;
-          SALOMEDS::Study_var aStudyVar = _CAST(Study, aStudy)->GetStudy();
           SALOMEDS::SObject_wrap aNewGroupSO =
-            geomGen->AddInStudy( aStudyVar, aGeomVar,
+            geomGen->AddInStudy( aGeomVar,
                                  aNewGeomGroupName.toLatin1().data(), mainGeom);
         }
       }
@@ -2117,7 +2113,7 @@ void SMESHGUI_MeshOp::setDefaultName( const QString& thePrefix ) const
 {
   QString aResName;
 
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  _PTR(Study) aStudy = SMESH::getStudy();
   int i = 1;
 
   QString aPrefix = thePrefix;
@@ -2158,7 +2154,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
   QString aHypName = dataList[ aHypIndex ]->TypeName;
 
   // get existing algorithms
-  _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
+  _PTR(SObject) pObj = SMESH::getStudy()->FindComponent("SMESH");
   QStringList tmp;
   existingHyps( theDim, Algo, pObj, tmp, myExistingHyps[ theDim ][ Algo ]);
 
@@ -2204,7 +2200,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
         delete aCreator;
       }
       QStringList tmpList;
-      _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
+      _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent( "SMESH" );
       existingHyps( theDim, Algo, aFather, tmpList, myExistingHyps[ theDim ][ Algo ] );
     }
 
@@ -2233,7 +2229,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
 void SMESHGUI_MeshOp::readMesh()
 {
   QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
-  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
   if ( !pObj )
     return;
 
@@ -2399,7 +2395,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
     return false;
 
   QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
-  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
   if ( !pObj )
     return false;
 
@@ -2582,7 +2578,7 @@ void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh )
     }
     // set mesh object to SMESHGUI_ShapeByMeshOp and start it
     QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
-    if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
+    if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
       SMESH::SMESH_Mesh_var aMeshVar =
         SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
       if ( !aMeshVar->_is_nil() ) {
@@ -2611,7 +2607,7 @@ void SMESHGUI_MeshOp::onPublishShapeByMeshDlg(SUIT_Operation* op)
     if ( !aGeomVar->_is_nil() )
     {
       QString ID = SMESH::toQStr( aGeomVar->GetStudyEntry() );
-      if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.toLatin1().data() )) {
+      if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) {
         selectObject( aGeomSO );
         selectionDone();
       }
index eec510cea2d9e2819c48acdfe2f390d6c1b644ca..cab1695a5f155c89bccdd0734724236020e5582e 100644 (file)
@@ -280,7 +280,7 @@ bool SMESHGUI_MeshOrderMgr::SetMeshOrder( const  ListListId& theListListIds )
   if (theListListIds.isEmpty() || myMesh->_is_nil())
     return false;
 
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  _PTR(Study) aStudy = SMESH::getStudy();
   _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
   if ( !aStudy || !aMeshSObj )
     return false;
index 53e60ce65f9153acf8287c81e517ca0a0bb30952..8b0bd227c3e17d9b62df382b7feb1a28691f5deb 100755 (executable)
@@ -504,7 +504,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
         _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());
+          anActor = SMESH::CreateActor(aSO->GetID().c_str());
           if (anActor) {
             SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
             SMESH::FitAll();
index 9b3d606a0b2507a3b90569116c5ca3e122b18a3c..0e322fc4a7c97fc37459a51537a7d02013b793f3 100644 (file)
@@ -64,7 +64,7 @@ namespace SMESH
   {
     QString baseName = thePostfix.isEmpty() ? 
       theBaseName : theBaseName + "_" + thePostfix;
-    if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
+    if ( _PTR(Study) aStudy = getStudy() ) {
       QString name = baseName;
       while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
         int nb = 0;
@@ -90,7 +90,7 @@ namespace SMESH
     QString baseName = thePostfix.isEmpty() ? 
       theBaseName : theBaseName + "_" + thePostfix;
     QString name = baseName;
-    if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
+    if ( _PTR(Study) aStudy = getStudy() ) {
       _PTR(SObject) p = theParent;
       if ( !p ) p = aStudy->FindComponent( "SMESH" );
       if ( p ) {
index f31874bb0be88e298906d82c13ece5201a2dbc36..1f1ee9efc667d21d729e144ac52cc706f7da0087 100755 (executable)
@@ -995,7 +995,7 @@ void SMESHGUI_MultiEditDlg::setSelectionMode()
 //=======================================================================
 bool SMESHGUI_MultiEditDlg::onApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
   if (!isValid(true))
     return false;
index 0e6bd0d98cd07e8f12ba03aab918441c806c44a1..5f2f2d9219df22fafb0819ace97a245f5cbe1ff5 100644 (file)
@@ -102,9 +102,7 @@ namespace SMESH
       SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
       theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
       aNodeId = aMeshEditor->AddNode( x, y, z );
-      _PTR(Study) aStudy = GetActiveStudyDocument();
-      CORBA::Long anId = aStudy->StudyId();
-      if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
+      if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( aSobj->GetID().c_str() ) ) {
         aVisualObj->Update( true );
       }
     } 
@@ -423,7 +421,7 @@ void SMESHGUI_NodesDlg::ClickOnOk()
 //=================================================================================
 bool SMESHGUI_NodesDlg::ClickOnApply()
 {
-  if ( mySMESHGUI->isActiveStudyLocked() )
+  if ( SMESHGUI::isStudyLocked() )
     return false;
 
   if ( myMesh->_is_nil() ) {
index 0a6b8bc2739757a6b65eb306c41e71e60e6616e6..2b604b0ebbb75fa7c6c43ecdd52a975faa7d2f7c 100755 (executable)
@@ -122,7 +122,7 @@ bool SMESHGUI_Operation::isReadyToStart() const
                               tr( "NO_MODULE" ) );
     return false;
   }
-  else if ( isStudyLocked() )
+  else if ( SMESHGUI::isStudyLocked() )
     return false;
 
   return true;
@@ -142,16 +142,6 @@ void SMESHGUI_Operation::setDialogActive( const bool active )
 
 }
 
-//=======================================================================
-// name    : studyDS
-// Purpose :
-//=======================================================================
-_PTR(Study) SMESHGUI_Operation::studyDS() const
-{
-  SalomeApp_Study* s = dynamic_cast<SalomeApp_Study*>( study() );
-  return s->studyDS();
-}
-
 //=======================================================================
 // name    : onOk
 // Purpose :
@@ -236,30 +226,6 @@ bool SMESHGUI_Operation::isApplyAndClose() const
   return myIsApplyAndClose;
 }
 
-/*!
- * \brief Verifies whether study of operation is locked
-  * \param theMess - specifies whether message box must be shown if study is locked
-  * \return State of study.
-*
-* Verifies whether study of operation is locked. If second parameter is TRUE and study
-* is locked when corresponding message box appears
-*/
-bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const
-{
-  if ( studyDS() )
-  {
-    if ( studyDS()->GetProperties()->IsLocked() )
-    {
-      if ( theMess )
-        SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
-                                  tr( "WRN_STUDY_LOCKED" ) );
-      return true;
-    }
-  }
-
-  return false;
-}
-
 /*!
  * \brief Verifies whether given operator is valid for this one
   * \param theOtherOp - other operation
index 990759dc8985b5553155e94863910872bd2d2e9f..3f3e891517cef6a322a7bbeaf952723df9874d9d 100755 (executable)
@@ -65,9 +65,6 @@ protected:
   virtual void      setDialogActive( const bool );
 
   SMESHGUI*         getSMESHGUI() const;
-  bool              isStudyLocked( const bool = true ) const;
-
-  _PTR(Study)       studyDS() const;
   
   virtual bool      isValid( SUIT_Operation* ) const;
 
index 067eb5f49e734f6c2d48e900f21e4fcb784dbbd3..620996d18f42eb585650ddd95a902ab52e592a83 100644 (file)
@@ -223,7 +223,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
 //=================================================================================
 void SMESHGUI_RemoveElementsDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return;
 
   if (myNbOkElements)
index 805b37c85a1eccabe0371eb783e6abea10295d11..a94f4b488077fa5241bd3bbcef3ddc4703d7c4ff 100644 (file)
@@ -229,7 +229,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
 //=================================================================================
 void SMESHGUI_RemoveNodesDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return;
 
   if (myNbOkNodes) {
index 5dc81e40ec90e9c995fb9939b978180ab1e7af28..9f21446747fc566a90f5c7e7eb7e2dee94b7dc5e 100644 (file)
@@ -210,7 +210,7 @@ void SMESHGUI_RenumberingDlg::Init()
 //=================================================================================
 void SMESHGUI_RenumberingDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return;
 
   if (!myMesh->_is_nil()) {
index cb3828246dbc0af8776cf4467737349e085ee480..f6f72edb2bc5f549b42e0299baa375aadc0dc956 100644 (file)
@@ -638,7 +638,7 @@ void SMESHGUI_ReorientFacesOp::onTextChange( const QString& theText )
 
 bool SMESHGUI_ReorientFacesOp::onApply()
 {
-  if( isStudyLocked() )
+  if( SMESHGUI::isStudyLocked() )
     return false;
 
   QString msg;
@@ -728,7 +728,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg )
 {
   // check object
   QString objectEntry = myDlg->selectedObject( EObject );
-  _PTR(SObject) pSObject = studyDS()->FindObjectID( objectEntry.toLatin1().data() );
+  _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() );
   myObject = SMESH::SMESH_IDSource::_narrow( _CAST( SObject,pSObject )->GetObject() );
   if ( myObject->_is_nil() )
   {
@@ -749,7 +749,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg )
   if ( myDlg->myConstructorGrp->checkedId() == CONSTRUCTOR_VOLUME )
   {
     objectEntry = myDlg->selectedObject( EVolumes );
-    _PTR(SObject) pSObject = studyDS()->FindObjectID( objectEntry.toLatin1().data() );
+    _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() );
     myVolumeObj = SMESH::SObjectToInterface< SMESH::SMESH_IDSource>( pSObject );
     if ( myVolumeObj->_is_nil() )
     {
index 27dfe0af088d7ed1aa05c443097c4cbf6c0bccf8..f23c6d2f652688145b890e611b82b215925d306c 100644 (file)
@@ -392,7 +392,7 @@ bool SMESHGUI_RevolutionDlg::isValid()
 //=================================================================================
 bool SMESHGUI_RevolutionDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if (!isValid())
index 48e7204cbac16bc01bc660abbe394a2435bd8198..291d908ddbb5686d539621f604c7126ee0fde7aa 100644 (file)
@@ -400,7 +400,7 @@ void SMESHGUI_RotationDlg::Init (bool ResetControls)
 //=================================================================================
 bool SMESHGUI_RotationDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if( !isValid() )
index 85e9dd46c84125ccf57c95c3cb9ebdf19c6ce611..001ee7d9440a02acbd4667a707abe59ec48c3fb6 100644 (file)
@@ -439,7 +439,7 @@ void SMESHGUI_ScaleDlg::ConstructorsClicked (int constructorId)
 //=================================================================================
 bool SMESHGUI_ScaleDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if( !isValid() )
index b6976df864921b7e5219e1bf10c74d7c794b9f9a..0b113839d81732f0b25f608b9254c31b4657d99c 100644 (file)
@@ -40,7 +40,7 @@
 #include <SMESH_ScalarBarActor.h>
 
 // SALOME GUI includes
-#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
 #include <LightApp_VTKSelector.h>
 #include <SVTK_ViewWindow.h>
 
@@ -75,15 +75,10 @@ void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
 {
   LightApp_Selection::init( client, mgr );
 
-  if( mgr && study() )
+  if( mgr )
   {
-    SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
-    if (!aSStudy)
-      return;
-    _PTR(Study) aStudy = aSStudy->studyDS();
-
     for( int i=0, n=count(); i<n; i++ ) {
-      myTypes.append( typeName( type( entry( i ), aStudy ) ) );
+      myTypes.append( typeName( type( entry( i ) ) ) );
       myControls.append( controlMode( i ) );
     }
   }
@@ -203,8 +198,8 @@ QList<QVariant> SMESHGUI_Selection::elemTypes( int ind, bool fromObj ) const
   {
     if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
     {
-      _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
-      CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+      CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
       SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
       if ( !CORBA::is_nil( idSrc ) )
       {
@@ -268,7 +263,7 @@ QString SMESHGUI_Selection::displayMode( int ind ) const
 
 bool SMESHGUI_Selection::isQuadratic( int ind ) const
 {
-  _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+  _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
   if ( !so )
     return false;
   SMESH::SMESH_IDSource_var idSource =  SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( so );
@@ -463,11 +458,14 @@ bool SMESHGUI_Selection::isAutoColor( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
   {
-    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
-    CORBA::Object_var      obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
-    SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
-    if ( !CORBA::is_nil( mesh ) )
-      return mesh->GetAutoColor();
+    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+    CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
+
+    if ( !CORBA::is_nil( obj ) ) {
+      SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
+      if ( !CORBA::is_nil( mesh ) )
+        return mesh->GetAutoColor();
+    }
   }
   return false;
 }
@@ -481,8 +479,8 @@ int SMESHGUI_Selection::numberOfNodes( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
   {
-    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
-    CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+    CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
 
     if ( !CORBA::is_nil( obj ) ) {
       SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
@@ -512,8 +510,8 @@ int SMESHGUI_Selection::dim( int ind ) const
   int dim = -1;
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
   {
-    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
-    CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+    CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
 
     if ( !CORBA::is_nil( obj ) ) {
       SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
@@ -547,7 +545,7 @@ bool SMESHGUI_Selection::isComputable( int ind ) const
                                               myTypes[ind].startsWith("Mesh " )))
   {
     QMap<int,int> modeMap;
-    _PTR(SObject) meshSO = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+    _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
 
     _PTR(SComponent) component = meshSO->GetFatherComponent();
     if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
@@ -573,7 +571,7 @@ bool SMESHGUI_Selection::isPreComputable( int ind ) const
     if ( maxDim < 2 ) // we can preview 1D or 2D
     {
       QMap<int,int> modeMap;
-      _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+      _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
       SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
       if ( modeMap.size() > 1 )
         return (( modeMap.contains( SMESH::DIM_3D )) ||
@@ -592,7 +590,7 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
   {
-    _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+    _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
     GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
     return !shape->_is_nil();
   }
@@ -609,7 +607,7 @@ bool SMESHGUI_Selection::isEditableHyp( int ind ) const
   bool isEditable = true;
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" )
   {
-    _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+    _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
     SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface<SMESH::SMESH_Hypothesis>( so );
     if ( !hyp->_is_nil() )
     {
@@ -646,9 +644,9 @@ bool SMESHGUI_Selection::hasChildren( int ind ) const
 {
   if ( ind >= 0 )
   {
-    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
     if ( sobj ) 
-      return SMESH::GetActiveStudyDocument()->GetUseCaseBuilder()->HasChildren( sobj );
+      return SMESH::getStudy()->GetUseCaseBuilder()->HasChildren( sobj );
   }
   return false;
 }
@@ -663,9 +661,10 @@ int SMESHGUI_Selection::nbChildren( int ind ) const
   int nb = 0;
   if ( ind >= 0 )
   {
-    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
-    if ( sobj && sobj->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
-      _PTR(UseCaseIterator) it = sobj->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( sobj ); 
+    _PTR(Study) study = SMESH::getStudy();
+    _PTR(SObject) sobj = study->FindObjectID( entry( ind ).toLatin1().data() );
+    if ( sobj && study->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
+      _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( sobj );
       for ( it->Init( false ); it->More(); it->Next() ) nb++;
     }
   }
@@ -687,10 +686,10 @@ bool SMESHGUI_Selection::isContainer( int ind ) const
 //purpose  : 
 //=======================================================================
 
-int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
+int SMESHGUI_Selection::type( const QString& entry )
 {
   int res = -1;
-  _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().data() );
+  _PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toLatin1().data() );
   if ( obj ) {
     _PTR(SObject) ref;
     if ( obj->ReferencedObject( ref ) )
@@ -786,7 +785,7 @@ QString SMESHGUI_Selection::typeName( const int t )
 bool SMESHGUI_Selection::isImported( const int ind ) const
 {
   bool res = false;
-  _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
+  _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() );
   if ( sobj )
   {
     SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( sobj ) );
@@ -816,7 +815,7 @@ int SMESHGUI_Selection::guiState()
 
 QString SMESHGUI_Selection::groupType( int ind ) const
 {
-  _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
+  _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() );
   if ( sobj )
   {
     SMESH::SMESH_Group_var g = SMESH::SObjectToInterface<SMESH::SMESH_Group>( sobj );
index 71690c7137dfbe63f99ccda2ab828ed6a1502ea6..115b0e46f60ef1e6845ab64a81d6cca4afaa15f3 100644 (file)
@@ -85,7 +85,7 @@ public:
   
   SMESH_Actor*            getActor( int ) const;
 
-  static int              type( const QString&, _PTR(Study) );
+  static int              type( const QString& );
   static QString          typeName( const int );
   static  int             guiState();
   
index ca551105a5db5d68f9f9ababf00ecf2a9c66abb0..ed560b87ee5400108f0be8733d2db59ea87be068 100644 (file)
@@ -295,36 +295,28 @@ SVTK_Selector* SMESHGUI_SelectionOp::selector() const
 //=======================================================================
 int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype ) const
 {
-  SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
-  if( !_study )
-    return -1;
-
-  _PTR( Study ) st = _study->studyDS();
+  _PTR(Study) aStudy = SMESH::getStudy();
 
   int res = -1;
   if( objtype == Object )
   {
-    SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
-    if( _study )
+    int t = SMESHGUI_Selection::type( str );
+    if( t<0 )
     {
-      int t = SMESHGUI_Selection::type( str, _study->studyDS() );
-      if( t<0 )
+      //try to get GEOM type
+      _PTR( SObject ) sobj = aStudy->FindObjectID( str.toLatin1().data() );
+      if( sobj )
       {
-        //try to get GEOM type
-        _PTR( SObject ) sobj = st->FindObjectID( str.toLatin1().data() );
-        if( sobj )
-        {
-          GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
-            dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
-          if( !CORBA::is_nil( obj ) )
-            // as decoding of type id is not realized in LightApp_Dialog,
-            //make all GEOM objects have same type id
-            res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
-        }
+        GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
+          dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
+        if( !CORBA::is_nil( obj ) )
+          // as decoding of type id is not realized in LightApp_Dialog,
+          //make all GEOM objects have same type id
+          res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
       }
-      else
-        res = SMESHGUI_Dialog::prefix( "SMESH" ) + t;
     }
+    else
+      res = SMESHGUI_Dialog::prefix( "SMESH" ) + t;
   }
   else
   {
@@ -335,7 +327,7 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype
     int id = _id.toInt( &ok );
     if( ok )
     {
-      _PTR( SObject ) sobj = st->FindObjectID( entry.toLatin1().data() );
+      _PTR( SObject ) sobj = aStudy->FindObjectID( entry.toLatin1().data() );
       SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( 
         dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
       SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow( 
@@ -422,13 +414,9 @@ void SMESHGUI_SelectionOp::selected( QStringList& names,
       QString id = anIt.Value()->getEntry();
       ids.append( id );
       types.append( typeById( id, Object ) );
-      SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
-      if( _study )
-      {
-        _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
-        if( obj )
-          names.append( QString( obj->GetName().c_str() ).trimmed() );
-      }
+      _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( anIt.Value()->getEntry() );
+      if( obj )
+        names.append( QString( obj->GetName().c_str() ).trimmed() );
     }
   }
 }
index 22253c4d69caec10655af62a565c787b09d98365..27dfe06e75e49695312599ab83ce2a0f6bf61e3e 100644 (file)
@@ -1293,7 +1293,7 @@ void SMESHGUI_SewingDlg::onSwapClicked()
 //=================================================================================
 bool SMESHGUI_SewingDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   bool aResult = false;
index 6bff0c7ece87d602dad77ff6046b3e1f155ad505..5d82de8bebb4970fd87b28a13febf0ceba41d897 100644 (file)
@@ -319,13 +319,12 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
     else
     {
       GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 
-      if (geomGen->_is_nil() || !aStudy)
+      if (geomGen->_is_nil())
         return;
 
       GEOM::GEOM_IShapesOperations_wrap aShapesOp =
-        geomGen->GetIShapesOperations(aStudy->StudyId());
+        geomGen->GetIShapesOperations();
       if (aShapesOp->_is_nil() )
         return;
 
@@ -364,7 +363,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
       else if (aNumberOfGO > 1)
       {
         GEOM::GEOM_IGroupOperations_wrap aGroupOp =
-          geomGen->GetIGroupOperations(aStudy->StudyId());
+          geomGen->GetIGroupOperations();
         if(aGroupOp->_is_nil())
           return;
 
@@ -386,9 +385,8 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
 
       // publish the GEOM object in study
       QString aNewGeomGroupName ( myDlg->myGeomName->text() );
-      SALOMEDS::Study_var aStudyVar = _CAST(Study,aStudy)->GetStudy();
       SALOMEDS::SObject_wrap aNewGroupSO =
-        geomGen->AddInStudy( aStudyVar, aGeomObject, 
+        geomGen->AddInStudy( aGeomObject,
                              aNewGeomGroupName.toLatin1().data(), aMeshShape);
 
       // get a GEOM_Object already published, which doesn't need UnRegister()
index 08424f6d49a6d91fe65eae2ac847c5092df9ecf9..a95ce564867721648425315dbbb3ca41bc96f680 100755 (executable)
@@ -493,7 +493,7 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
 //=================================================================================
 bool SMESHGUI_SingleEditDlg::onApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
   // verify validity of input data
   if (!isValid(true))
index caa4c51194fd1f1de33e69da4e28144d19cace2c..3f79c3292f28fee5482d190a51deff9a976d0e4f 100644 (file)
@@ -341,7 +341,7 @@ void SMESHGUI_SmoothingDlg::Init()
 //=================================================================================
 bool SMESHGUI_SmoothingDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if (!isValid())
index 71cca13a5fcbd77f3b4014f47a945258b98a86ab..75e03affbc832b5109a83cc0ef97f0fda2c7384f 100644 (file)
@@ -202,7 +202,7 @@ bool SMESHGUI_SplitBiQuadOp::onApply()
   int nbObj = 0;
   for ( int i = 0; i < entries.count() ; ++i )
   {
-    _PTR(SObject) pObj = studyDS()->FindObjectID( entries[i].toLatin1().data() );
+    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().data() );
     SMESH::SMESH_IDSource_var obj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj );
     if( !CORBA::is_nil( obj ))
     {
index e6886021ad769e40218d413116f1c0ffd04f4254..f994189fd2df0932fe2c40f7dd43e79c54e070ec 100644 (file)
@@ -474,7 +474,7 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
 //=================================================================================
 bool SMESHGUI_SymmetryDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if( !isValid() )
index 75e5635bfa59a153b34e9938ac52e9e4a1259423..21342aebd88abef9f96f027c89ac26ab713ecb64 100644 (file)
@@ -475,7 +475,7 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
 //=================================================================================
 bool SMESHGUI_TranslationDlg::ClickOnApply()
 {
-  if (mySMESHGUI->isActiveStudyLocked())
+  if (SMESHGUI::isStudyLocked())
     return false;
 
   if( !isValid() )
index 22e71be8a9b130e23d45df1d6e26a3ab933687ee..e6fdb1c157d7aa469158bd37b1e59ea8dd56259c 100644 (file)
@@ -76,12 +76,6 @@ namespace SMESH
     return SUIT_Session::session()->resourceMgr();
   }
 
-  _PTR(Study)
-  GetCStudy(const SalomeApp_Study* theStudy)
-  {
-    return theStudy->studyDS();
-  }
-
   CORBA::Object_var 
   DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner)
   {
@@ -90,9 +84,8 @@ namespace SMESH
       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);
+          _PTR(SObject) aSObj = getStudy()->FindObjectID(anIO->getEntry());
+          anObj = SObjectToObject(aSObj);
         }
       }
     }
@@ -118,13 +111,12 @@ namespace SMESH
       return NULL;
   }
 
-  _PTR(Study) GetActiveStudyDocument()
+  _PTR(Study) getStudy()
   {
-    SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(GetActiveStudy());
-    if (aStudy)
-      return aStudy->studyDS();
-    else
-      return _PTR(Study)();
+    static _PTR(Study) _study;
+    if(!_study)
+      _study = SalomeApp_Application::getStudy();
+    return _study;
   }
 
   _PTR(SObject) FindSObject (CORBA::Object_ptr theObject)
@@ -132,26 +124,23 @@ namespace SMESH
     SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
       (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 getStudy()->FindObjectIOR(anIOR.in());
     }
     return _PTR(SObject)();
   }
 
   void SetName (_PTR(SObject) theSObject, const QString& theName)
   {
-    _PTR(Study) aStudy = GetActiveStudyDocument();
-    if (aStudy->GetProperties()->IsLocked())
+    if (getStudy()->GetProperties()->IsLocked())
       return;
     SMESHGUI::GetSMESHGen()->SetName(theSObject->GetIOR().c_str(), theName.toLatin1().data());
   }
 
   void SetValue (_PTR(SObject) theSObject, const QString& theValue)
   {
-    _PTR(Study) aStudy = GetActiveStudyDocument();
+    _PTR(Study) aStudy = getStudy();
     if (aStudy->GetProperties()->IsLocked())
       return;
     _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
@@ -164,7 +153,7 @@ namespace SMESH
   
   void setFileName (_PTR(SObject) theSObject, const QString& theValue)
   {
-    _PTR(Study) aStudy = GetActiveStudyDocument();
+    _PTR(Study) aStudy = getStudy();
     if (aStudy->GetProperties()->IsLocked())
       return;
     _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
@@ -177,7 +166,7 @@ namespace SMESH
   
   void setFileType (_PTR(SObject) theSObject, const QString& theValue)
   {
-    _PTR(Study) aStudy = GetActiveStudyDocument();
+    _PTR(Study) aStudy = getStudy();
     if (aStudy->GetProperties()->IsLocked())
       return;
     _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
@@ -188,8 +177,7 @@ namespace SMESH
       aFileType->SetValue(theValue.toLatin1().data());
   }
 
-  CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
-                                     _PTR(Study)   /*theStudy*/)
+  CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject )
   {
     SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
       (SUIT_Session::session()->activeApplication());
@@ -207,12 +195,6 @@ namespace SMESH
     return CORBA::Object::_nil();
   }
 
-  CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject)
-  {
-    _PTR(Study) aStudy;// = GetActiveStudyDocument(); -- aStudy is not used
-    return SObjectToObject(theSObject,aStudy);
-  }
-
   _PTR(SObject) ObjectToSObject( CORBA::Object_ptr theObject )
   {
     _PTR(SObject) res;
@@ -220,9 +202,8 @@ namespace SMESH
       (SUIT_Session::session()->activeApplication());
     if ( app ) {
       CORBA::String_var ior = app->orb()->object_to_string( theObject );
-      SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
-      if ( study && strlen( ior ) > 0 )
-        res = study->studyDS()->FindObjectIOR( ior.in() );
+      if ( strlen( ior ) > 0 )
+        res = getStudy()->FindObjectIOR( ior.in() );
     }
     return res;
   }
@@ -231,9 +212,8 @@ namespace SMESH
   {
     if (!theIO.IsNull()) {
       if (theIO->hasEntry()) {
-        _PTR(Study) aStudy = GetActiveStudyDocument();
-        _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
-        return SObjectToObject(anObj,aStudy);
+        _PTR(SObject) anObj = getStudy()->FindObjectID(theIO->getEntry());
+        return SObjectToObject(anObj);
       }
     }
     return CORBA::Object::_nil();
@@ -279,8 +259,8 @@ namespace SMESH
 
   void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNotModif, bool isEmptyMesh)
   {
-    _PTR(Study) aStudy = GetActiveStudyDocument();
-    if (aStudy->GetProperties()->IsLocked())
+    _PTR(Study) aStudy = getStudy();
+    if ( !aStudy || aStudy->GetProperties()->IsLocked())
       return;
 
     _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
@@ -314,7 +294,7 @@ namespace SMESH
           aPixmap = anAttr;
 
           std::string entry = aSObj1->GetID();
-          int objType = SMESHGUI_Selection::type( entry.c_str(), aStudy );
+          int objType = SMESHGUI_Selection::type( entry.c_str() );
           if ( objType == SMESH::HYPOTHESIS || objType == SMESH::ALGORITHM )
             continue;
 
index 5b2e0b89ba662fb1caa7aa102767b8e7f04a880c..4a1a1c600fbf7659f3b90103df606f4782854be7 100644 (file)
@@ -80,10 +80,6 @@ SMESHGUI_EXPORT
 SMESHGUI_EXPORT
   SUIT_ResourceMgr*
   GetResourceMgr( const SalomeApp_Module* );
-  
-SMESHGUI_EXPORT
-  _PTR(Study)
-  GetCStudy( const SalomeApp_Study* );
 
 SMESHGUI_EXPORT
   CORBA::Object_var DataOwnerToObject( const LightApp_DataOwnerPtr& );
@@ -104,7 +100,7 @@ SMESHGUI_EXPORT
   SUIT_ViewWindow* GetActiveWindow();
 
 SMESHGUI_EXPORT
-  _PTR(Study) GetActiveStudyDocument();
+  _PTR(Study) getStudy();
 
 SMESHGUI_EXPORT
   _PTR(SObject) FindSObject( CORBA::Object_ptr );
@@ -117,10 +113,6 @@ SMESHGUI_EXPORT
   void setFileType( _PTR(SObject), const QString& );
   void setFileName( _PTR(SObject), const QString& );
 
-SMESHGUI_EXPORT
-  CORBA::Object_var SObjectToObject( _PTR(SObject),
-                                     _PTR(Study) );
-
 SMESHGUI_EXPORT
   CORBA::Object_var SObjectToObject( _PTR(SObject) );
 
index 5c5bbab522936705450cfde8bf5554ba1045539b..98fcb550d8be0aa0c4fb60ab638dad1f985e0ab9 100644 (file)
@@ -76,7 +76,7 @@
 
 namespace SMESH
 {
-  typedef std::map<TKeyOfVisualObj,TVisualObjPtr> TVisualObjCont;
+  typedef std::map<std::string,TVisualObjPtr> TVisualObjCont;
   static TVisualObjCont VISUAL_OBJ_CONT;
 
   //=============================================================================
@@ -136,17 +136,13 @@ namespace SMESH
       }
     }
     
-    if (aViewManager ) {
-      int aStudyId = aViewManager->study()->id();
-      TVisualObjCont::key_type aKey(aStudyId,theEntry);
-      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
-      if(anIter != VISUAL_OBJ_CONT.end()) {
-        // for unknown reason, object destructor is not called, so clear object manually
-        anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
-        anIter->second->GetUnstructuredGrid()->SetPoints(0);
-      }
-      VISUAL_OBJ_CONT.erase(aKey);
+    TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
+    if(anIter != VISUAL_OBJ_CONT.end()) {
+      // for unknown reason, object destructor is not called, so clear object manually
+      anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
+      anIter->second->GetUnstructuredGrid()->SetPoints(0);
     }
+    VISUAL_OBJ_CONT.erase(theEntry);
 
     if(actorRemoved)
       aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
@@ -199,7 +195,7 @@ namespace SMESH
    */
   //================================================================================
 
-  void RemoveVisuData(int studyID)
+  void RemoveVisuData()
   {
     SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
       ( SUIT_Session::session()->activeApplication() );
@@ -207,8 +203,7 @@ namespace SMESH
     ViewManagerList viewMgrs = app->viewManagers();
     for ( int iM = 0; iM < viewMgrs.count(); ++iM ) {
       SUIT_ViewManager* aViewManager = viewMgrs.at( iM );
-      if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() &&
-           aViewManager->study()->id() == studyID ) {
+      if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() ) {
         QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
         for ( int iV = 0; iV < views.count(); ++iV ) {
           if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
@@ -229,16 +224,10 @@ namespace SMESH
     }
     TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.begin();
     for ( ; anIter != VISUAL_OBJ_CONT.end(); ) {
-      int curId = anIter->first.first;
-      if ( curId == studyID ) {
-        // for unknown reason, object destructor is not called, so clear object manually
-        anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
-        anIter->second->GetUnstructuredGrid()->SetPoints(0);
-        VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
-      }
-      else {
-        anIter++;
-      }
+      // for unknown reason, object destructor is not called, so clear object manually
+      anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
+      anIter->second->GetUnstructuredGrid()->SetPoints(0);
+      VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
     }
   }
 
@@ -278,18 +267,17 @@ namespace SMESH
    */
   //================================================================================
 
-  TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry, bool nulData){
+  TVisualObjPtr GetVisualObj(const char* theEntry, bool nulData){
     TVisualObjPtr aVisualObj;
-    TVisualObjCont::key_type aKey(theStudyId,theEntry);
     try{
       OCC_CATCH_SIGNALS;
-      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
+      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
       if(anIter != VISUAL_OBJ_CONT.end()){
         aVisualObj = anIter->second;
       }else{
         SalomeApp_Application* app =
           dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
-        _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
+        _PTR(Study) aStudy = SMESH::getStudy();
         _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
         if(aSObj){
           _PTR(GenericAttribute) anAttr;
@@ -302,7 +290,7 @@ namespace SMESH
               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);
+                TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                 VISUAL_OBJ_CONT.insert(aValue);
               }
               //Try narrow to SMESH_Group interface
@@ -313,10 +301,10 @@ namespace SMESH
                 aFatherSObj = aFatherSObj->GetFather();
                 if(!aFatherSObj) return aVisualObj;
                 CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
-                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+                TVisualObjPtr aVisObj = GetVisualObj(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);
+                  TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                   VISUAL_OBJ_CONT.insert(aValue);
                 }
               }
@@ -328,10 +316,10 @@ namespace SMESH
                 aFatherSObj = aFatherSObj->GetFather();
                 if(!aFatherSObj) return aVisualObj;
                 CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
-                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+                TVisualObjPtr aVisObj = GetVisualObj(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);
+                  TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                   VISUAL_OBJ_CONT.insert(aValue);
                 }
               }
@@ -553,7 +541,7 @@ namespace SMESH
       return NULL;
 
     if(!CORBA::is_nil(theObject)){
-      _PTR(Study) aStudy = GetActiveStudyDocument();
+      _PTR(Study) aStudy = getStudy();
       CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
       _PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
       if(aSObject){
@@ -565,14 +553,12 @@ namespace SMESH
   }
 
 
-  SMESH_Actor* CreateActor(_PTR(Study) theStudy,
-                           const char* theEntry,
+  SMESH_Actor* CreateActor(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(TVisualObjPtr aVisualObj = GetVisualObj(theEntry)){
+      _PTR(SObject) aSObj = getStudy()->FindObjectID(theEntry);
       if(aSObj){
         _PTR(GenericAttribute) anAttr;
         if(aSObj->FindAttribute(anAttr,"AttributeName")){
@@ -645,10 +631,7 @@ namespace SMESH
         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);
+          VISUAL_OBJ_CONT.erase(anEntry);
         }
       }
       theActor->Delete();
@@ -753,13 +736,10 @@ namespace SMESH
             {
               //MESSAGE("---");
               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();
               TVisualObjPtr aVisualObj;
-              if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
+              if ( (aVisualObj = GetVisualObj(theEntry)) && aVisualObj->IsValid())
               {
-                if ((anActor = CreateActor(aDocument,theEntry,true))) {
+                if ((anActor = CreateActor(theEntry,true))) {
                   bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
                   DisplayActor(theWnd,anActor);
                   anActor->SetVisibility(true);
@@ -827,9 +807,7 @@ namespace SMESH
   bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
   {
     //MESSAGE("Update");
-    _PTR(Study) aStudy = GetActiveStudyDocument();
-    CORBA::Long anId = aStudy->StudyId();
-    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
+    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry())) {
       if ( theDisplay )
         UpdateView(SMESH::eDisplay,theIO->getEntry());
       return true;
@@ -840,9 +818,7 @@ namespace SMESH
   bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
   {
     //MESSAGE("UpdateNulData");
-    _PTR(Study) aStudy = GetActiveStudyDocument();
-    CORBA::Long anId = aStudy->StudyId();
-    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
+    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry(), true)) {
       if ( theDisplay )
         UpdateView(SMESH::eDisplay,theIO->getEntry());
       return true;
index b1159bd139ede160bfcaf7dff4b1451f8a89603b..217b1995da5f4190a58477e14c7f1a980f62e1a3 100644 (file)
@@ -63,10 +63,9 @@ class vtkActor;
 namespace SMESH
 {
   //----------------------------------------------------------------------------
-  typedef std::pair<int,std::string> TKeyOfVisualObj;
   
 SMESHGUI_EXPORT
-  TVisualObjPtr GetVisualObj( int, const char*, bool nulData =false );
+  TVisualObjPtr GetVisualObj( const char*, bool nulData =false );
 SMESHGUI_EXPORT
   void OnVisuException(); // PAL16631
 
@@ -103,13 +102,13 @@ SMESHGUI_EXPORT
 
   //----------------------------------------------------------------------------
 SMESHGUI_EXPORT  
-  SMESH_Actor* CreateActor( _PTR(Study), const char*, int = false );
+  SMESH_Actor* CreateActor( const char*, int = false );
 SMESHGUI_EXPORT
   void DisplayActor( SUIT_ViewWindow*, SMESH_Actor* );
 SMESHGUI_EXPORT
   void RemoveActor( SUIT_ViewWindow*, SMESH_Actor* );
 SMESHGUI_EXPORT
-  void RemoveVisuData( int );
+  void RemoveVisuData();
 
   //----------------------------------------------------------------------------
   enum EDisplaing { eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll };
index 3641d913cdd06639fd7a5cdc3ccbc18b6ce1bc8c..c84715eed262da158df4cb9103f7668cfc0a999f 100644 (file)
@@ -67,6 +67,7 @@ SET(SMESHUtils_HEADERS
   SMESH_MeshAlgos.hxx
   SMESH_MAT2d.hxx
   SMESH_ControlPnt.hxx
+  SMESH_Delaunay.hxx
 )
 
 # --- sources ---
@@ -84,6 +85,7 @@ SET(SMESHUtils_SOURCES
   SMESH_FreeBorders.cxx
   SMESH_ControlPnt.cxx
   SMESH_DeMerge.cxx
+  SMESH_Delaunay.cxx
   )
 
 # --- rules ---
diff --git a/src/SMESHUtils/SMESH_Delaunay.cxx b/src/SMESHUtils/SMESH_Delaunay.cxx
new file mode 100644 (file)
index 0000000..2a2809c
--- /dev/null
@@ -0,0 +1,374 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File      : SMESH_Delaunay.cxx
+// Created   : Wed Apr 19 15:41:15 2017
+// Author    : Edward AGAPOV (eap)
+
+#include "SMESH_Delaunay.hxx"
+
+#include "SMESH_Comment.hxx"
+#include "SMESH_File.hxx"
+#include "SMESH_MeshAlgos.hxx"
+
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepMesh_Delaun.hxx>
+
+//================================================================================
+/*!
+ * \brief Construct a Delaunay triangulation of given boundary nodes
+ *  \param [in] boundaryNodes - vector of nodes of a wire
+ *  \param [in] face - the face
+ *  \param [in] faceID - the face ID
+ *  \param [in] nbNodesToVisit - nb of non-marked nodes on the face
+ */
+//================================================================================
+
+SMESH_Delaunay::SMESH_Delaunay(const std::vector< const UVPtStructVec* > & boundaryNodes,
+                               const TopoDS_Face&                          face,
+                               const int                                   faceID)
+  : _face( face ), _faceID( faceID ), _scale( 1., 1. )
+{
+  // compute _scale
+  BRepAdaptor_Surface surf( face );
+  if ( surf.GetType() != GeomAbs_Plane )
+  {
+    const int nbDiv = 100;
+    const double uRange = surf.LastUParameter() - surf.FirstUParameter();
+    const double vRange = surf.LastVParameter() - surf.FirstVParameter();
+    const double dU = uRange / nbDiv;
+    const double dV = vRange / nbDiv;
+    double u = surf.FirstUParameter(), v = surf.FirstVParameter();
+    gp_Pnt p0U = surf.Value( u, v ), p0V = p0U;
+    double lenU = 0, lenV = 0;
+    for ( ; u < surf.LastUParameter(); u += dU, v += dV )
+    {
+      gp_Pnt p1U = surf.Value( u, surf.FirstVParameter() );
+      lenU += p1U.Distance( p0U );
+      p0U = p1U;
+      gp_Pnt p1V = surf.Value( surf.FirstUParameter(), v );
+      lenV += p1V.Distance( p0V );
+      p0V = p1V;
+    }
+    _scale.SetCoord( lenU / uRange, lenV / vRange );
+  }
+
+  // count boundary points
+  int iP = 1, nbP = 0;
+  for ( size_t iW = 0; iW < boundaryNodes.size(); ++iW ) // loop on wires
+  {
+    nbP += boundaryNodes[iW]->size();
+    if ( boundaryNodes[iW]->front().node == boundaryNodes[iW]->back().node )
+      --nbP; // 1st and last points coincide
+  }
+  _bndNodes.resize( nbP );
+
+  // fill boundary points
+  BRepMesh::Array1OfVertexOfDelaun bndVert( 1, 1 + nbP );
+  BRepMesh_Vertex v( 0, 0, BRepMesh_Frontier );
+  for ( size_t iW = 0; iW < boundaryNodes.size(); ++iW )
+  {
+    const UVPtStructVec& bndPnt = *boundaryNodes[iW];
+    int i = 0, nb = bndPnt.size();
+    if ( bndPnt[0].node == bndPnt.back().node )
+      --nb;
+    for ( ; i < nb;  ++i, ++iP )
+    {
+      _bndNodes[ iP-1 ] = bndPnt[i].node;
+      bndPnt[i].node->setIsMarked( true );
+
+      v.ChangeCoord() = bndPnt[i].UV().Multiplied( _scale );
+      bndVert( iP )   = v;
+    }
+  }
+
+  // triangulate the srcFace in 2D
+  BRepMesh_Delaun Delaunay( bndVert );
+  _triaDS = Delaunay.Result();
+}
+
+//================================================================================
+/*!
+ * \brief Prepare to the exploration of nodes
+ */
+//================================================================================
+
+void SMESH_Delaunay::InitTraversal(const int nbNodesToVisit)
+{
+  _nbNodesToVisit = (size_t) nbNodesToVisit;
+  _nbVisitedNodes = _iBndNode = 0;
+  _noTriQueue.clear();
+}
+
+//================================================================================
+/*!
+ * \brief Return a node with its Barycentric Coordinates within the triangle
+ *        defined by its node indices (zero based)
+ *  \param [out] bc - Barycentric Coordinates of the returned node
+ *  \param [out] triaNodes - indices of triangle nodes
+ *  \return const SMDS_MeshNode* - the next node or NULL
+ */
+//================================================================================
+
+const SMDS_MeshNode* SMESH_Delaunay::NextNode( double bc[3], int triaNodes[3] )
+{
+  while ( _nbVisitedNodes < _nbNodesToVisit )
+  {
+    while ( !_noTriQueue.empty() )
+    {
+      const SMDS_MeshNode*     node = _noTriQueue.front().first;
+      const BRepMesh_Triangle* tria = _noTriQueue.front().second;
+      _noTriQueue.pop_front();
+      if ( node->isMarked() )
+        continue;
+      ++_nbVisitedNodes;
+      node->setIsMarked( true );
+
+      // find a Delaunay triangle containing the src node
+      gp_XY uv = getNodeUV( _face, node );
+      tria = FindTriangle( uv, tria, bc, triaNodes );
+      if ( tria )
+      {
+        addCloseNodes( node, tria, _faceID, _noTriQueue );
+        return node;
+      }
+    }
+    for ( ; _iBndNode < _bndNodes.size() &&  _noTriQueue.empty();  ++_iBndNode )
+    {
+      if ( const BRepMesh_Triangle* tria = GetTriangleNear( _iBndNode ))
+        addCloseNodes( _bndNodes[ _iBndNode ], tria, _faceID, _noTriQueue );
+    }
+    if ( _noTriQueue.empty() )
+      break;
+  }
+
+  // if ( _nbVisitedNodes < _nbNodesToVisit )
+  //   _nbVisitedNodes = std::numeric_limits<int>::max();
+  return NULL;
+}
+
+//================================================================================
+/*!
+ * \brief Find a Delaunay triangle containing a given 2D point and return
+ *        barycentric coordinates within the found triangle
+ */
+//================================================================================
+
+const BRepMesh_Triangle* SMESH_Delaunay::FindTriangle( const gp_XY&             UV,
+                                                       const BRepMesh_Triangle* tria,
+                                                       double                   bc[3],
+                                                       int                      triaNodes[3] )
+{
+  int   nodeIDs[3];
+  gp_XY nodeUVs[3];
+  int   linkIDs[3];
+  Standard_Boolean ori[3];
+
+  gp_XY uv = UV.Multiplied( _scale );
+
+  while ( tria )
+  {
+    // check if the uv is in tria
+
+    _triaDS->ElementNodes( *tria, nodeIDs );
+    nodeUVs[0] = _triaDS->GetNode( nodeIDs[0] ).Coord();
+    nodeUVs[1] = _triaDS->GetNode( nodeIDs[1] ).Coord();
+    nodeUVs[2] = _triaDS->GetNode( nodeIDs[2] ).Coord();
+
+    SMESH_MeshAlgos::GetBarycentricCoords( uv,
+                                           nodeUVs[0], nodeUVs[1], nodeUVs[2],
+                                           bc[0], bc[1] );
+    if ( bc[0] >= 0 && bc[1] >= 0 && bc[0] + bc[1] <= 1 )
+    {
+      if ( _triaDS->GetNode( nodeIDs[0] ).Movability() != BRepMesh_Frontier ||
+           _triaDS->GetNode( nodeIDs[1] ).Movability() != BRepMesh_Frontier ||
+           _triaDS->GetNode( nodeIDs[2] ).Movability() != BRepMesh_Frontier )
+      {
+        return 0;
+      }
+      bc[2] = 1 - bc[0] - bc[1];
+      triaNodes[0] = nodeIDs[0] - 1;
+      triaNodes[1] = nodeIDs[1] - 1;
+      triaNodes[2] = nodeIDs[2] - 1;
+      return tria;
+    }
+
+    // look for a neighbor triangle, which is adjacent to a link intersected
+    // by a segment( triangle center -> uv )
+
+    gp_XY gc = ( nodeUVs[0] + nodeUVs[1] + nodeUVs[2] ) / 3.;
+    gp_XY seg = uv - gc;
+
+    tria->Edges( linkIDs, ori );
+    int triaID = _triaDS->IndexOf( *tria );
+    tria = 0;
+
+    for ( int i = 0; i < 3; ++i )
+    {
+      const BRepMesh_PairOfIndex & triIDs = _triaDS->ElementsConnectedTo( linkIDs[i] );
+      if ( triIDs.Extent() < 2 )
+        continue; // no neighbor triangle
+
+      // check if a link intersects gc2uv
+      const BRepMesh_Edge & link = _triaDS->GetLink( linkIDs[i] );
+      const BRepMesh_Vertex & n1 = _triaDS->GetNode( link.FirstNode() );
+      const BRepMesh_Vertex & n2 = _triaDS->GetNode( link.LastNode() );
+      gp_XY uv1 = n1.Coord();
+      gp_XY lin = n2.Coord() - uv1; // link direction
+
+      double crossSegLin = seg ^ lin;
+      if ( Abs( crossSegLin ) < std::numeric_limits<double>::min() )
+        continue; // parallel
+
+      double uSeg = ( uv1 - gc ) ^ lin / crossSegLin;
+      if ( 0. <= uSeg && uSeg <= 1. )
+      {
+        tria = & _triaDS->GetElement( triIDs.Index( 1 + ( triIDs.Index(1) == triaID )));
+        if ( tria->Movability() != BRepMesh_Deleted )
+          break;
+      }
+    }
+  }
+  return tria;
+}
+
+//================================================================================
+/*!
+ * \brief Return a triangle sharing a given boundary node
+ *  \param [in] iBndNode - index of the boundary node
+ *  \return const BRepMesh_Triangle* - a found triangle
+ */
+//================================================================================
+
+const BRepMesh_Triangle* SMESH_Delaunay::GetTriangleNear( int iBndNode )
+{
+  int nodeIDs[3];
+  int nbNbNodes = _bndNodes.size();
+  const BRepMesh::ListOfInteger & linkIds = _triaDS->LinksConnectedTo( iBndNode + 1 );
+  BRepMesh::ListOfInteger::const_iterator iLink = linkIds.cbegin();
+  for ( ; iLink != linkIds.cend(); ++iLink )
+  {
+    const BRepMesh_PairOfIndex & triaIds = _triaDS->ElementsConnectedTo( *iLink );
+    {
+      const BRepMesh_Triangle& tria = _triaDS->GetElement( triaIds.Index(1) );
+      if ( tria.Movability() != BRepMesh_Deleted )
+      {
+        _triaDS->ElementNodes( tria, nodeIDs );
+        if ( nodeIDs[0]-1 < nbNbNodes &&
+             nodeIDs[1]-1 < nbNbNodes &&
+             nodeIDs[2]-1 < nbNbNodes )
+          return &tria;
+      }
+    }
+    if ( triaIds.Extent() > 1 )
+    {
+      const BRepMesh_Triangle& tria = _triaDS->GetElement( triaIds.Index(2) );
+      if ( tria.Movability() != BRepMesh_Deleted )
+      {
+        _triaDS->ElementNodes( tria, nodeIDs );
+        if ( nodeIDs[0]-1 < nbNbNodes &&
+             nodeIDs[1]-1 < nbNbNodes &&
+             nodeIDs[2]-1 < nbNbNodes )
+          return &tria;
+      }
+    }
+  }
+  return 0;
+}
+
+//================================================================================
+/*!
+ * \brief Return UV of the i-th source boundary node (zero based)
+ */
+//================================================================================
+
+gp_XY SMESH_Delaunay::GetBndUV(const int iNode) const
+{
+  return _triaDS->GetNode( iNode+1 ).Coord();
+}
+
+//================================================================================
+/*!
+ * \brief Add non-marked nodes surrounding a given one to a queue
+ */
+//================================================================================
+
+void SMESH_Delaunay::addCloseNodes( const SMDS_MeshNode*     node,
+                                    const BRepMesh_Triangle* tria,
+                                    const int                faceID,
+                                    TNodeTriaList &          _noTriQueue )
+{
+  // find in-FACE nodes
+  SMDS_ElemIteratorPtr elems = node->GetInverseElementIterator(SMDSAbs_Face);
+  while ( elems->more() )
+  {
+    const SMDS_MeshElement* elem = elems->next();
+    if ( elem->getshapeId() == faceID )
+    {
+      for ( int i = 0, nb = elem->NbNodes(); i < nb; ++i )
+      {
+        const SMDS_MeshNode* n = elem->GetNode( i );
+        if ( !n->isMarked() /*&& n->getshapeId() == faceID*/ )
+          _noTriQueue.push_back( std::make_pair( n, tria ));
+      }
+    }
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Write a python script that creates an equal mesh in Mesh module
+ */
+//================================================================================
+
+void SMESH_Delaunay::ToPython() const
+{
+  SMESH_Comment text;
+  text << "import salome, SMESH\n";
+  text << "salome.salome_init()\n";
+  text << "from salome.smesh import smeshBuilder\n";
+  text << "smesh = smeshBuilder.New(salome.myStudy)\n";
+  text << "mesh=smesh.Mesh()\n";
+  const char* endl = "\n";
+
+  for ( int i = 0; i < _triaDS->NbNodes(); ++i )
+  {
+    const BRepMesh_Vertex& v = _triaDS->GetNode( i+1 );
+    text << "mesh.AddNode( " << v.Coord().X() << ", " << v.Coord().Y() << ", 0 )" << endl;
+  }
+
+  int nodeIDs[3];
+  for ( int i = 0; i < _triaDS->NbElements(); ++i )
+  {
+    const BRepMesh_Triangle& t = _triaDS->GetElement( i+1 );
+    if ( t.Movability() == BRepMesh_Deleted )
+      continue;
+    _triaDS->ElementNodes( t, nodeIDs );
+    text << "mesh.AddFace([ " << nodeIDs[0] << ", " << nodeIDs[1] << ", " << nodeIDs[2] << " ])" << endl;
+  }
+
+  const char* fileName = "/tmp/Delaunay.py";
+  SMESH_File file( fileName, false );
+  file.remove();
+  file.openForWriting();
+  file.write( text.c_str(), text.size() );
+  cout << "execfile( '" << fileName << "')" << endl;
+}
diff --git a/src/SMESHUtils/SMESH_Delaunay.hxx b/src/SMESHUtils/SMESH_Delaunay.hxx
new file mode 100644 (file)
index 0000000..7170711
--- /dev/null
@@ -0,0 +1,115 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File      : SMESH_Delaunay.hxx
+// Created   : Wed Apr 19 15:42:54 2017
+// Author    : Edward AGAPOV (eap)
+
+
+#ifndef __SMESH_Delaunay_HXX__
+#define __SMESH_Delaunay_HXX__
+
+#include "SMESH_TypeDefs.hxx"
+
+#include <BRepMesh_DataStructureOfDelaun.hxx>
+
+/*!
+ * \brief Create a Delaunay triangulation of nodes on a face boundary
+ *        and provide exploration of nodes shared by elements lying on
+ *        the face. For a returned node, also return a Delaunay triangle
+ *        the node lies in and its Barycentric Coordinates within the triangle.
+ *        Only non-marked nodes are visited. Boundary nodes given at the construction
+ *        are not returned.
+ *
+ *        For usage, this class needs to be subclassed to implement getNodeUV();
+ */
+class SMESHUtils_EXPORT SMESH_Delaunay
+{
+ public:
+
+  // construct a Delaunay triangulation of given boundary nodes
+  SMESH_Delaunay(const std::vector< const UVPtStructVec* > & boundaryNodes,
+                 const TopoDS_Face&                          face,
+                 const int                                   faceID);
+
+  virtual ~SMESH_Delaunay() {}
+
+  // prepare to the exploration of nodes
+  void InitTraversal(const int nbNodesToVisit = -1);
+
+  // return a node with its Barycentric Coordinates within the triangle
+  // defined by its node indices (zero based)
+  const SMDS_MeshNode* NextNode( double bc[3], int triaNodes[3] );
+
+  // return nb of nodes returned by NextNode()
+  int NbVisitedNodes() const { return _nbVisitedNodes; }
+
+
+  // find a triangle containing an UV, starting from a given triangle;
+  // return barycentric coordinates of the UV and the found triangle (indices are zero based).
+  const BRepMesh_Triangle* FindTriangle( const gp_XY&             uv,
+                                         const BRepMesh_Triangle* bmTria,
+                                         double                   bc[3],
+                                         int                      triaNodes[3]);
+
+  // return any Delaunay triangle neighboring a given boundary node (zero based)
+  const BRepMesh_Triangle* GetTriangleNear( int iBndNode );
+
+  // return source boundary nodes
+  const std::vector< const SMDS_MeshNode* >& GetBndNodes() const { return _bndNodes; }
+
+  // return UV of the i-th source boundary node (zero based)
+  gp_XY GetBndUV(const int iNode) const;
+
+  // return scale factor to convert real UV to/from UV used for Delauney meshing:
+  // delauney_UV = real_UV * scale
+  const gp_XY& GetScale() const { return _scale; }
+
+  void ToPython() const;
+
+  Handle(BRepMesh_DataStructureOfDelaun) GetDS() { return _triaDS; }
+
+ protected:
+
+  // container of a node and a triangle serving as a start while searching a
+  // triangle including the node UV
+  typedef std::list< std::pair< const SMDS_MeshNode*, const BRepMesh_Triangle* > > TNodeTriaList;
+
+  // return UV of a node on the face
+  virtual gp_XY getNodeUV( const TopoDS_Face& face, const SMDS_MeshNode* node ) const = 0;
+
+  // add non-marked nodes surrounding a given one to a queue
+  static void addCloseNodes( const SMDS_MeshNode*     node,
+                             const BRepMesh_Triangle* bmTria,
+                             const int                faceID,
+                             TNodeTriaList &          noTriQueue );
+
+  const TopoDS_Face&                     _face;
+  int                                    _faceID;
+  std::vector< const SMDS_MeshNode* >    _bndNodes;
+  gp_XY                                  _scale;
+  Handle(BRepMesh_DataStructureOfDelaun) _triaDS;
+  size_t                                 _nbNodesToVisit, _nbVisitedNodes, _iBndNode;
+  TNodeTriaList                          _noTriQueue;
+
+};
+
+#endif
index aad6899d32debaa1f322d69d3123b24902fe804a..f37334a160308c8759f28b9568fdf5c1ec023b76 100644 (file)
@@ -434,7 +434,7 @@ namespace
     text << "import salome, SMESH\n";
     text << "salome.salome_init()\n";
     text << "from salome.smesh import smeshBuilder\n";
-    text << "smesh = smeshBuilder.New(salome.myStudy)\n";
+    text << "smesh = smeshBuilder.New()\n";
     text << "m=smesh.Mesh()\n";
     for ( size_t iE = 0; iE < bndSegsPerEdge.size(); ++iE )
     {
index f8fabc08cd59a31f9d1d231e58cf4400f932274e..63c599a8878fa1e5a16d3ebf01ab1e71e4fd455e 100644 (file)
@@ -70,6 +70,7 @@ SET(_link_LIBRARIES
   ${KERNEL_SalomeGenericObj}
   ${KERNEL_SalomeIDLKERNEL}
   ${KERNEL_SALOMELocalTrace}
+  ${KERNEL_SalomeKernelHelpers}
   ${CAS_TKCDF}
   ${CAS_TKBO}
   ${CAS_TKShHealing}
index 70f69c5d797c0bb09bd257ae87e062a859b1770a..96287f87270a8d406bcb3e73d2414c8b1f15df7e 100644 (file)
@@ -461,7 +461,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
                               Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
                               Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                               std::set< TCollection_AsciiString >&      theRemovedObjIDs,
-                              SALOMEDS::Study_ptr&                      theStudy,
                               const bool                                theToKeepAllCommands)
 {
   std::list< TCollection_AsciiString >::iterator lineIt;
@@ -484,7 +483,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
   theGen = new _pyGen( theEntry2AccessorMethod,
                        theObjectNames,
                        theRemovedObjIDs,
-                       theStudy,
                        theToKeepAllCommands );
 
   for ( lineIt = theScriptLines.begin(); lineIt != theScriptLines.end(); ++lineIt )
@@ -516,7 +514,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
   set<_pyID> createdObjects;
   createdObjects.insert( "smeshBuilder" );
   createdObjects.insert( "smesh" );
-  createdObjects.insert( "theStudy" );
   for ( cmd = theGen->GetCommands().begin(); cmd != theGen->GetCommands().end(); ++cmd )
   {
 #ifdef DUMP_CONVERSION
@@ -544,7 +541,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
 _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
                Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                std::set< TCollection_AsciiString >&      theRemovedObjIDs,
-               SALOMEDS::Study_ptr&                      theStudy,
                const bool                                theToKeepAllCommands)
   : _pyObject( new _pyCommand( "", 0 )),
     myNbCommands( 0 ),
@@ -553,7 +549,6 @@ _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod
     myRemovedObjIDs( theRemovedObjIDs ),
     myNbFilters( 0 ),
     myToKeepAllCommands( theToKeepAllCommands ),
-    myStudy( SALOMEDS::Study::_duplicate( theStudy )),
     myGeomIDNb(0), myGeomIDIndex(-1)
 {
   // make that GetID() to return TPythonDump::SMESHGenName()
@@ -562,11 +557,11 @@ _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod
   GetCreationCmd()->GetString() += "=";
 
   // Find 1st digit of study entry by which a GEOM object differs from a SMESH object
-  if ( !theObjectNames.IsEmpty() && !CORBA::is_nil( theStudy ))
+  if ( !theObjectNames.IsEmpty() )
   {
     // find a GEOM entry
     _pyID geomID;
-    SALOMEDS::SComponent_wrap geomComp = theStudy->FindComponent("GEOM");
+    SALOMEDS::SComponent_wrap geomComp = SMESH_Gen_i::getStudyServant()->FindComponent("GEOM");
     if ( geomComp->_is_nil() ) return;
     CORBA::String_var entry = geomComp->GetID();
     geomID = entry.in();
@@ -1101,7 +1096,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
   static TStringSet smeshpyMethods;
   if ( smeshpyMethods.empty() ) {
     const char * names[] =
-      { "SetEmbeddedMode","IsEmbeddedMode","SetCurrentStudy","GetCurrentStudy",
+      { "SetEmbeddedMode","IsEmbeddedMode","UpdateStudy","GetStudy",
         "GetPattern","GetSubShapesId",
         "" }; // <- mark of array end
     smeshpyMethods.Insert( names );
@@ -1673,7 +1668,7 @@ bool _pyGen::IsNotPublished(const _pyID& theObjID) const
   // either the SMESH object is not in study or it is a GEOM object
   if ( IsGeomObject( theObjID ))
   {
-    SALOMEDS::SObject_wrap so = myStudy->FindObjectID( theObjID.ToCString() );
+    SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( theObjID.ToCString() );
     if ( so->_is_nil() ) return true;
     CORBA::Object_var obj = so->GetObject();
     return CORBA::is_nil( obj );
@@ -2122,7 +2117,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
     const char * names[] =
       { "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents",
         "GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
-        "ClearLog","GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
+        "ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
         "NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",
         "NbTrianglesOfOrder","NbQuadrangles","NbQuadranglesOfOrder","NbPolygons","NbVolumes",
         "NbVolumesOfOrder","NbTetras","NbTetrasOfOrder","NbHexas","NbHexasOfOrder",
index 6fd991533bd9188f7e6fc9f06a404adb5399f633..589c78317dfd08f48a8f8367d7abe34a28da3e51 100644 (file)
@@ -255,7 +255,6 @@ public:
   _pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
          Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
          std::set< TCollection_AsciiString >&      theRemovedObjIDs,
-         SALOMEDS::Study_ptr&                      theStudy,
          const bool                                theToKeepAllCommands);
   Handle(_pyCommand) AddCommand( const _AString& theCommand );
   void ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) theCmd2 );
@@ -326,7 +325,6 @@ private:
   Handle(_pyCommand)                        myLastCommand;
   int                                       myNbFilters;
   bool                                      myToKeepAllCommands;
-  SALOMEDS::Study_var                       myStudy;
   int                                       myGeomIDNb, myGeomIDIndex;
   std::map< _AString, ExportedMeshData >    myFile2ExportedMesh;
   Handle( _pyHypothesisReader )             myHypReader;
index cc842f215462cc31dedfe6acfedeca3f84b65e55..92506466cdbd268668025cb1c8106b4745bb1861 100644 (file)
@@ -74,13 +74,12 @@ namespace SMESH
       SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
       std::string aString = myStream.str();
       TCollection_AsciiString aCollection(Standard_CString(aString.c_str()));
-      SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
-      if(!aStudy->_is_nil() && !aCollection.IsEmpty())
+      if(!aCollection.IsEmpty())
       {
         const std::string & objEntry = SMESH_Gen_i::GetSMESHGen()->GetLastObjEntry();
         if ( !objEntry.empty() )
           aCollection += (TVar::ObjPrefix() + objEntry ).c_str();
-        aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
+        aSMESHGen->AddToPythonScript(aCollection);
         if(MYDEBUG) MESSAGE(aString);
         // prevent misuse of already treated variables
         aSMESHGen->UpdateParameters(CORBA::Object_var().in(),"");
@@ -316,8 +315,7 @@ namespace SMESH
   operator<<(CORBA::Object_ptr theArg)
   {
     SMESH_Gen_i*          aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_var      aStudy = aSMESHGen->GetCurrentStudy();
-    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
     if(!aSObject->_is_nil()) {
       CORBA::String_var id = aSObject->GetID();
       myStream << id;
@@ -336,8 +334,7 @@ namespace SMESH
   TPythonDump::
   operator<<(SMESH::SMESH_Hypothesis_ptr theArg)
   {
-    SALOMEDS::Study_var     aStudy = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
-    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
     if(aSObject->_is_nil() && !CORBA::is_nil(theArg))
       myStream << "hyp_" << theArg->GetId();
     else
@@ -352,8 +349,7 @@ namespace SMESH
     if ( CORBA::is_nil( theArg ) )
       return *this << "None";
     SMESH_Gen_i*          aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_var      aStudy = aSMESHGen->GetCurrentStudy();
-    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
     if(!aSObject->_is_nil())
     {
       return *this << aSObject;
@@ -368,7 +364,7 @@ namespace SMESH
       SMESH::long_array_var    anElementsId = theArg->GetIDs();
       SMESH::array_of_ElementType_var types = theArg->GetTypes();
       SMESH::ElementType               type = types->length() ? types[0] : SMESH::ALL;
-      SALOMEDS::SObject_wrap         meshSO = SMESH_Gen_i::ObjectToSObject(aStudy,mesh);
+      SALOMEDS::SObject_wrap         meshSO = SMESH_Gen_i::ObjectToSObject(mesh);
       if ( meshSO->_is_nil() ) // don't waste memory for dumping not published objects
         return *this << mesh << ".GetIDSource([], " << type << ")";
       else
@@ -718,12 +714,11 @@ void RemoveTabulation( TCollection_AsciiString& theScript )
 //function : DumpPython
 //purpose  :
 //=======================================================================
-Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
-                                           CORBA::Boolean isPublished,
+Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Boolean isPublished,
                                            CORBA::Boolean isMultiFile,
                                            CORBA::Boolean& isValidScript)
 {
-  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
+  SALOMEDS::Study_var aStudy = getStudyServant();
   if (CORBA::is_nil(aStudy))
     return new Engines::TMPFile(0);
 
@@ -761,7 +756,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;
-  aScript += DumpPython_impl(aStudy, aMap, aMapNames, isPublished, isMultiFile,
+  aScript += DumpPython_impl(aMap, aMapNames, isPublished, isMultiFile,
                              myIsHistoricalPythonDump, isValidScript, aSavedTrace);
 
   int aLen = aScript.Length();
@@ -782,12 +777,12 @@ Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
  *  AddToPythonScript
  */
 //=============================================================================
-void SMESH_Gen_i::AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString)
+void SMESH_Gen_i::AddToPythonScript (const TCollection_AsciiString& theString)
 {
-  if (myPythonScripts.find(theStudyID) == myPythonScripts.end()) {
-    myPythonScripts[theStudyID] = new TColStd_HSequenceOfAsciiString;
+  if (myPythonScript.IsNull()) {
+    myPythonScript = new TColStd_HSequenceOfAsciiString;
   }
-  myPythonScripts[theStudyID]->Append(theString);
+  myPythonScript->Append(theString);
 }
 
 //=============================================================================
@@ -795,11 +790,11 @@ void SMESH_Gen_i::AddToPythonScript (int theStudyID, const TCollection_AsciiStri
  *  RemoveLastFromPythonScript
  */
 //=============================================================================
-void SMESH_Gen_i::RemoveLastFromPythonScript (int theStudyID)
+void SMESH_Gen_i::RemoveLastFromPythonScript()
 {
-  if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
-    int aLen = myPythonScripts[theStudyID]->Length();
-    myPythonScripts[theStudyID]->Remove(aLen);
+  if (!myPythonScript.IsNull()) {
+    int aLen = myPythonScript->Length();
+    myPythonScript->Remove(aLen);
   }
 }
 
@@ -807,15 +802,15 @@ void SMESH_Gen_i::RemoveLastFromPythonScript (int theStudyID)
 //function : SavePython
 //purpose  :
 //=======================================================================
-void SMESH_Gen_i::SavePython (SALOMEDS::Study_ptr theStudy)
+void SMESH_Gen_i::SavePython()
 {
   // Dump trace of API methods calls
-  TCollection_AsciiString aScript = GetNewPythonLines(theStudy->StudyId());
+  TCollection_AsciiString aScript = GetNewPythonLines();
 
   // Check contents of PythonObject attribute
   CORBA::String_var compDataType = ComponentDataType();
-  SALOMEDS::SObject_wrap aSO = theStudy->FindComponent( compDataType.in() );
-  SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+  SALOMEDS::SObject_wrap aSO = getStudyServant()->FindComponent( compDataType.in() );
+  SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
   SALOMEDS::GenericAttribute_wrap anAttr =
     aStudyBuilder->FindOrCreateAttribute(aSO, "AttributePythonObject");
 
@@ -835,7 +830,7 @@ void SMESH_Gen_i::SavePython (SALOMEDS::Study_ptr theStudy)
   pyAttr->SetObject(oldScript.ToCString(), 1);
 
   // Clean trace of API methods calls
-  CleanPythonTrace(theStudy->StudyId());
+  CleanPythonTrace();
 }
 
 
@@ -979,7 +974,6 @@ namespace {
 //================================================================================
 /*!
  * \brief Createa a Dump Python script
- *  \param [in] theStudy - the study to dump
  *  \param [in,out] theObjectNames - map of an entry to a study and python name
  *  \param [in] theNames -  - map of an entry to a study name
  *  \param [in] isPublished - \c true if dump of object publication in study is needed
@@ -993,8 +987,7 @@ namespace {
 //================================================================================
 
 TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
-                        (SALOMEDS::Study_ptr                       theStudy,
-                         Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                        (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                          Resource_DataMapOfAsciiStringAsciiString& theNames,
                          bool                                      isPublished,
                          bool                                      isMultiFile,
@@ -1003,7 +996,6 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
                          TCollection_AsciiString&                  theSavedTrace)
 {
   SMESH_TRY;
-  const int aStudyID = theStudy->StudyId();
 
   const TCollection_AsciiString aSmeshpy ( SMESH_2smeshpy::SmeshpyName() );
   const TCollection_AsciiString aSMESHGen( SMESH_2smeshpy::GenName() );
@@ -1015,9 +1007,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   std::list< TCollection_AsciiString >::iterator linesIt;
   
   if ( isPublished )
-    lines.push_back(  aSMESHGen + " = smeshBuilder.New(theStudy)" );
+    lines.push_back(  aSMESHGen + " = smeshBuilder.New()" );
    else
-    lines.push_back(  aSMESHGen + " = smeshBuilder.New(None)" );
+    lines.push_back(  aSMESHGen + " = smeshBuilder.New(False)" );
   lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" );
   lines.push_back( helper + "aMeasurements = "  + aSMESHGen + ".CreateMeasurements()" );
 
@@ -1063,9 +1055,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   }
 
   // Add new dump trace of API methods calls to script lines
-  if (myPythonScripts.find( aStudyID ) != myPythonScripts.end())
+  if (!myPythonScript.IsNull())
   {
-    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScripts[ aStudyID ];
+    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScript;
     Standard_Integer istr, aLen = aPythonScript->Length();
     for (istr = 1; istr <= aLen; istr++)
       lines.push_back( aPythonScript->Value( istr ));
@@ -1079,7 +1071,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   if ( !getenv("NO_2smeshpy_conversion"))
     SMESH_2smeshpy::ConvertScript( lines, anEntry2AccessorMethod,
                                    theObjectNames, aRemovedObjIDs,
-                                   theStudy, isHistoricalDump );
+                                   isHistoricalDump );
 
   bool importGeom = false;
   GEOM::GEOM_Gen_ptr geom = GetGeomEngine();
@@ -1218,7 +1210,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   }
 
   if ( isMultiFile )
-    initPart += "def RebuildData(theStudy):";
+    initPart += "def RebuildData():";
   initPart += "\n";
 
   anUpdatedScript.Prepend( initPart );
@@ -1229,12 +1221,12 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   TCollection_AsciiString removeObjPart;
   if ( !mapRemoved.IsEmpty() ) {
     removeObjPart += nt + "## some objects were removed";
-    removeObjPart += nt + "aStudyBuilder = theStudy.NewBuilder()";
+    removeObjPart += nt + "aStudyBuilder = salome.myStudy.NewBuilder()";
     Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString mapRemovedIt;
     for ( mapRemovedIt.Initialize( mapRemoved ); mapRemovedIt.More(); mapRemovedIt.Next() ) {
       aName   = mapRemovedIt.Value(); // python name
       anEntry = mapRemovedIt.Key();
-      removeObjPart += nt + "SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(";
+      removeObjPart += nt + "SO = salome.myStudy.FindObjectIOR(salome.myStudy.ConvertObjectToIOR(";
       removeObjPart += aName;
       // for object wrapped by class of smeshBuilder.py
       if ( anEntry2AccessorMethod.IsBound( anEntry ) )
@@ -1272,7 +1264,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   {
     //Output the script that sets up the visual parameters.
     CORBA::String_var compDataType = ComponentDataType();
-    CORBA::String_var script = theStudy->GetDefaultScript( compDataType.in(), tab.ToCString() );
+    CORBA::String_var script = getStudyServant()->GetDefaultScript( compDataType.in(), tab.ToCString() );
     if ( script.in() && script.in()[0] ) {
       visualPropertiesPart += nt + "### Store presentation parameters of displayed objects\n";
       visualPropertiesPart += script.in();
@@ -1289,9 +1281,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       "\nif __name__ == '__main__':"
       "\n\tSMESH_RebuildData = RebuildData"
       "\n\texec('import '+re.sub('SMESH$','GEOM',thisModule)+' as GEOM_dump')"
-      "\n\tGEOM_dump.RebuildData( salome.myStudy )"
+      "\n\tGEOM_dump.RebuildData()"
       "\n\texec('from '+re.sub('SMESH$','GEOM',thisModule)+' import * ')"
-      "\n\tSMESH_RebuildData( salome.myStudy )";
+      "\n\tSMESH_RebuildData()";
   }
   anUpdatedScript += "\n";
 
@@ -1368,13 +1360,13 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
  *  GetNewPythonLines
  */
 //=============================================================================
-TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines (int theStudyID)
+TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines()
 {
   TCollection_AsciiString aScript;
 
   // Dump trace of API methods calls
-  if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
-    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScripts[theStudyID];
+  if (!myPythonScript.IsNull()) {
+    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScript;
     Standard_Integer istr, aLen = aPythonScript->Length();
     for (istr = 1; istr <= aLen; istr++) {
       aScript += "\n";
@@ -1391,12 +1383,12 @@ TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines (int theStudyID)
  *  CleanPythonTrace
  */
 //=============================================================================
-void SMESH_Gen_i::CleanPythonTrace (int theStudyID)
+void SMESH_Gen_i::CleanPythonTrace()
 {
   TCollection_AsciiString aScript;
 
   // Clean trace of API methods calls
-  if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
-    myPythonScripts[theStudyID]->Clear();
+  if (!myPythonScript.IsNull()) {
+    myPythonScript->Clear();
   }
 }
index 739a4d904ffe1fd5f6cf0e7041e8ec17ab85ad1f..a255fa53f7cec411d9cabc24a5a40e94c1dbc68c 100644 (file)
@@ -138,18 +138,14 @@ static TopoDS_Shape getShapeByName( const char* theName )
   if ( theName != 0 )
   {
     SMESH_Gen_i* aSMESHGen     = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
-    if ( !aStudy->_is_nil() )
+    SALOMEDS::Study::ListOfSObject_var aList = SMESH_Gen_i::getStudyServant()->FindObjectByName( theName, "GEOM" );
+    if ( aList->length() > 0 )
     {
-      SALOMEDS::Study::ListOfSObject_var aList = aStudy->FindObjectByName( theName, "GEOM" );
-      if ( aList->length() > 0 )
-      {
-        CORBA::Object_var        anObj = aList[ 0 ]->GetObject();
-        GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( anObj );
-        TopoDS_Shape             shape = aSMESHGen->GeomObjectToShape( aGeomObj );
-        SALOME::UnRegister( aList ); // UnRegister() objects in aList
-        return shape;
-      }
+      CORBA::Object_var        anObj = aList[ 0 ]->GetObject();
+      GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( anObj );
+      TopoDS_Shape             shape = aSMESHGen->GeomObjectToShape( aGeomObj );
+      SALOME::UnRegister( aList ); // UnRegister() objects in aList
+      return shape;
     }
   }
   return TopoDS_Shape();
@@ -159,14 +155,11 @@ static TopoDS_Shape getShapeByID (const char* theID)
 {
   if ( theID && strlen( theID ) > 0 ) {
     SMESH_Gen_i*     aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
-    if ( !aStudy->_is_nil() ) {
-      SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
-      if ( !aSObj->_is_nil() ) {
-        CORBA::Object_var          obj = aSObj->GetObject();
-        GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
-        return aSMESHGen->GeomObjectToShape( aGeomObj );
-      }
+    SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID(theID);
+    if ( !aSObj->_is_nil() ) {
+      CORBA::Object_var          obj = aSObj->GetObject();
+      GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
+      return aSMESHGen->GeomObjectToShape( aGeomObj );
     }
   }
   return TopoDS_Shape();
@@ -175,14 +168,10 @@ static TopoDS_Shape getShapeByID (const char* theID)
 // static std::string getShapeNameByID (const char* theID)
 // {
 //   if ( theID && strlen( theID ) > 0 ) {
-//     SMESH_Gen_i*     aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-//     SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
-//     if ( !aStudy->_is_nil() ) {
-//       SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
-//       if ( !aSObj->_is_nil() ) {
-//         CORBA::String_var name = aSObj->GetName();
-//         return name.in();
-//       }
+//     SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID(theID);
+//     if ( !aSObj->_is_nil() ) {
+//       CORBA::String_var name = aSObj->GetName();
+//       return name.in();
 //     }
 //   }
 //   return "";
@@ -779,14 +768,10 @@ void BelongToMeshGroup_i::SetGroupID( const char* theID ) // IOR or StoreName
   }
   else if ( strncmp( "0:", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
   {
-    SMESH_Gen_i* aSMESHGen     = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
-    if ( !aStudy->_is_nil() ) {
-      SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID( myID.c_str() );
-      if ( !aSObj->_is_nil() ) {
-        CORBA::Object_var obj = aSObj->GetObject();
-        SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
-      }
+    SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( myID.c_str() );
+    if ( !aSObj->_is_nil() ) {
+      CORBA::Object_var obj = aSObj->GetObject();
+      SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
     }
   }
   else if ( !myID.empty() ) // persistent mode
@@ -812,7 +797,7 @@ SMESH::SMESH_GroupBase_ptr BelongToMeshGroup_i::GetGroup()
   {
     // search for a group in a current study
     SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-    if ( StudyContext*  sc = aSMESHGen->GetCurrentStudyContext() )
+    if ( StudyContext*  sc = aSMESHGen->GetStudyContext() )
     {
       int id = 1;
       std::string ior;
@@ -1677,11 +1662,7 @@ void ConnectedElements_i::SetThreshold ( const char*
     }
   case SMESH::ConnectedElements::VERTEX: // get a VERTEX by its entry /////////////////
     {
-      SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
-      if ( study->_is_nil() )
-        THROW_SALOME_CORBA_EXCEPTION
-          ( "ConnectedElements_i::SetThreshold(): NULL current study", SALOME::BAD_PARAM );
-      SALOMEDS::SObject_wrap sobj = study->FindObjectID( threshold );
+      SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( threshold );
       if ( sobj->_is_nil() )
         THROW_SALOME_CORBA_EXCEPTION
           ( "ConnectedElements_i::SetThreshold(): invalid vertex study entry", SALOME::BAD_PARAM );
@@ -4109,7 +4090,7 @@ static const char** getFunctNames()
 #ifdef _DEBUG_
   // check if functName is complete, compilation failure means that enum FunctorType changed
   const int nbFunctors = sizeof(functName) / sizeof(const char*);
-  int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 2 : -1 ]; _assert[0]=_assert[1];
+  int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
 #endif
 
   return functName;
index 7a3404d242568566aa7859c680cf3bcc313cba72..a31b802b297416a152b6836ae7088c73cafbb401 100644 (file)
@@ -293,7 +293,10 @@ SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr            orb,
   _thisObj = this ;
   _id = myPoa->activate_object( _thisObj );
 
+  myStudyContext = new StudyContext;
+
   myIsEmbeddedMode = false;
+  myIsEnablePublish = true;
   myShapeReader = NULL;  // shape reader
   mySMESHGen = this;
   myIsHistoricalPythonDump = true;
@@ -351,11 +354,8 @@ SMESH_Gen_i::~SMESH_Gen_i()
   myHypCreatorMap.clear();
 
   // Clear study contexts data
-  map<int, StudyContext*>::iterator it;
-  for ( it = myStudyContextMap.begin(); it != myStudyContextMap.end(); ++it ) {
-    delete it->second;
-  }
-  myStudyContextMap.clear();
+  delete myStudyContext;
+
   // delete shape reader
   if ( myShapeReader )
     delete myShapeReader;
@@ -480,7 +480,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
     getHypothesisCreator(theHypName, theLibName, aPlatformLibName);
 
   // create a new hypothesis object, store its ref. in studyContext
-  myHypothesis_i = aCreator->Create(myPoa, GetCurrentStudyID(), &myGen);
+  myHypothesis_i = aCreator->Create(myPoa, &myGen);
   if (myHypothesis_i)
   {
     myHypothesis_i->SetLibName( aPlatformLibName.c_str() ); // for persistency assurance
@@ -512,10 +512,10 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::createMesh()
   // Get or create the GEOM_Client instance
   try {
     // create a new mesh object servant, store it in a map in study context
-    SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this, GetCurrentStudyID() );
+    SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this );
     // create a new mesh object
     if(MYDEBUG) MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
-    meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode ));
+    meshServant->SetImpl( myGen.CreateMesh( myIsEmbeddedMode ));
 
     // activate the CORBA servant of Mesh
     SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( meshServant->_this() );
@@ -609,82 +609,74 @@ CORBA::Boolean SMESH_Gen_i::IsEmbeddedMode()
 
 //=============================================================================
 /*!
- *  SMESH_Gen_i::SetCurrentStudy
+ *  SMESH_Gen_i::SetEnablePublish
  *
- *  Set current study
+ *  Set enable publishing in the study
  */
 //=============================================================================
-
-void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
+void SMESH_Gen_i::SetEnablePublish( CORBA::Boolean theIsEnablePublish )
 {
-  setCurrentStudy( theStudy );
+  myIsEnablePublish = theIsEnablePublish;
 }
 
-void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
-                                   bool                theStudyIsBeingClosed)
+//=============================================================================
+/*!
+ *  SMESH_Gen_i::IsEnablePublish
+ *
+ *  Check enable publishing
+ */
+//=============================================================================
+
+CORBA::Boolean SMESH_Gen_i::IsEnablePublish()
 {
-  int curStudyId = GetCurrentStudyID();
-  myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
-  // create study context, if it doesn't exist and set current study
-  int studyId = GetCurrentStudyID();
-  if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() )
-    myStudyContextMap[ studyId ] = new StudyContext;
-
-  // myCurrentStudy may be nil
-  if ( !theStudyIsBeingClosed && !CORBA::is_nil( myCurrentStudy ) ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-    SALOMEDS::SComponent_wrap GEOM_var = myCurrentStudy->FindComponent( "GEOM" );
-    if( !GEOM_var->_is_nil() )
-      aStudyBuilder->LoadWith( GEOM_var, GetGeomEngine() );
-    // NPAL16168, issue 0020210
-    // Let meshes update their data depending on GEOM groups that could change
-    if ( curStudyId != studyId )
-    {
-      CORBA::String_var compDataType = ComponentDataType();
-      SALOMEDS::SComponent_wrap me = myCurrentStudy->FindComponent( compDataType.in() );
-      if ( !me->_is_nil() ) {
-        SALOMEDS::ChildIterator_wrap anIter = myCurrentStudy->NewChildIterator( me );
-        for ( ; anIter->More(); anIter->Next() ) {
-          SALOMEDS::SObject_wrap so = anIter->Value();
-          CORBA::Object_var     ior = SObjectToObject( so );
-          if ( SMESH_Mesh_i*   mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
-            mesh->CheckGeomModif();
-        }
-      }
-    }
-  }
+  return myIsEnablePublish;
 }
 
 //=============================================================================
 /*!
- *  SMESH_Gen_i::GetCurrentStudy
+ *  SMESH_Gen_i::UpdateStudy
  *
- *  Get current study
+ *  Update study (needed at switching GEOM->SMESH)
  */
 //=============================================================================
 
-SALOMEDS::Study_ptr SMESH_Gen_i::GetCurrentStudy()
+void SMESH_Gen_i::UpdateStudy()
 {
-  if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetCurrentStudy: study Id = " << GetCurrentStudyID() );
-  if ( GetCurrentStudyID() < 0 )
-    return SALOMEDS::Study::_nil();
-  return SALOMEDS::Study::_duplicate( myCurrentStudy );
+  if ( !myStudyContext )
+    myStudyContext = new StudyContext;
+
+  SALOMEDS::Study_var aStudy = getStudyServant();
+  if ( !CORBA::is_nil( aStudy ) ) {
+    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+    SALOMEDS::SComponent_wrap GEOM_var = aStudy->FindComponent( "GEOM" );
+    if( !GEOM_var->_is_nil() )
+      aStudyBuilder->LoadWith( GEOM_var, GetGeomEngine() );
+    // NPAL16168, issue 0020210
+    // Let meshes update their data depending on GEOM groups that could change
+    CORBA::String_var compDataType = ComponentDataType();
+    SALOMEDS::SComponent_wrap me = aStudy->FindComponent( compDataType.in() );
+    if ( !me->_is_nil() ) {
+      SALOMEDS::ChildIterator_wrap anIter = aStudy->NewChildIterator( me );
+      for ( ; anIter->More(); anIter->Next() ) {
+        SALOMEDS::SObject_wrap so = anIter->Value();
+        CORBA::Object_var     ior = SObjectToObject( so );
+        if ( SMESH_Mesh_i*   mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
+          mesh->CheckGeomModif();
+      }
+    }
+  }
 }
 
 //=============================================================================
 /*!
- *  SMESH_Gen_i::GetCurrentStudyContext
+ *  SMESH_Gen_i::GetStudyContext
  *
- *  Get current study context
+ *  Get study context
  */
 //=============================================================================
-StudyContext* SMESH_Gen_i::GetCurrentStudyContext()
+StudyContext* SMESH_Gen_i::GetStudyContext()
 {
-  if ( !CORBA::is_nil( myCurrentStudy ) &&
-       myStudyContextMap.find( GetCurrentStudyID() ) != myStudyContextMap.end() )
-    return myStudyContextMap[ myCurrentStudy->StudyId() ];
-  else
-    return 0;
+  return myStudyContext;
 }
 
 //=============================================================================
@@ -705,7 +697,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::CreateHypothesis( const char* theHypNam
 
   // Publish hypothesis/algorithm in the study
   if ( CanPublishInStudy( hyp ) ) {
-    SALOMEDS::SObject_wrap aSO = PublishHypothesis( myCurrentStudy, hyp );
+    SALOMEDS::SObject_wrap aSO = PublishHypothesis( hyp );
     if ( !aSO->_is_nil() ) {
       // Update Python script
       TPythonDump() << aSO << " = " << this << ".CreateHypothesis('"
@@ -830,12 +822,12 @@ CORBA::Boolean SMESH_Gen_i::GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr
                                                     SMESH::SMESH_Mesh_out       theMesh,
                                                     GEOM::GEOM_Object_out       theShape)
 {
-  if ( GetCurrentStudyID() < 0 || CORBA::is_nil( theHyp ))
+  if ( CORBA::is_nil( theHyp ))
     return false;
 
   // get Mesh component SO
   CORBA::String_var compDataType = ComponentDataType();
-  SALOMEDS::SComponent_wrap comp = myCurrentStudy->FindComponent( compDataType.in() );
+  SALOMEDS::SComponent_wrap comp = getStudyServant()->FindComponent( compDataType.in() );
   if ( CORBA::is_nil( comp ))
     return false;
 
@@ -843,7 +835,7 @@ CORBA::Boolean SMESH_Gen_i::GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr
   SMESH::SMESH_Mesh_var foundMesh;
   TopoDS_Shape          foundShape;
   bool                  isSole = true;
-  SALOMEDS::ChildIterator_wrap meshIter = myCurrentStudy->NewChildIterator( comp );
+  SALOMEDS::ChildIterator_wrap meshIter = getStudyServant()->NewChildIterator( comp );
   for ( ; meshIter->More() && isSole; meshIter->Next() )
   {
     SALOMEDS::SObject_wrap curSO = meshIter->Value();
@@ -1049,9 +1041,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMesh( GEOM::GEOM_Object_ptr theShapeObj
 
   // publish mesh in the study
   if ( CanPublishInStudy( mesh ) ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     aStudyBuilder->NewCommand();  // There is a transaction
-    SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, mesh.in() );
+    SALOMEDS::SObject_wrap aSO = PublishMesh( mesh.in() );
     aStudyBuilder->CommitCommand();
     if ( !aSO->_is_nil() ) {
       // Update Python script
@@ -1080,9 +1072,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateEmptyMesh()
 
   // publish mesh in the study
   if ( CanPublishInStudy( mesh ) ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     aStudyBuilder->NewCommand();  // There is a transaction
-    SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, mesh.in() );
+    SALOMEDS::SObject_wrap aSO = PublishMesh( mesh.in() );
     aStudyBuilder->CommitCommand();
     if ( !aSO->_is_nil() ) {
       // Update Python script
@@ -1135,9 +1127,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromUNV( const char* theFileName
   string aFileName;
   // publish mesh in the study
   if ( CanPublishInStudy( aMesh ) ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     aStudyBuilder->NewCommand();  // There is a transaction
-    SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, aMesh.in(), aFileName.c_str() );
+    SALOMEDS::SObject_wrap aSO = PublishMesh( aMesh.in(), aFileName.c_str() );
     aStudyBuilder->CommitCommand();
     if ( !aSO->_is_nil() ) {
       // Update Python script
@@ -1193,11 +1185,9 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
 
   if (theStatus == SMESH::DRS_OK) {
     SALOMEDS::StudyBuilder_var aStudyBuilder;
-    if ( GetCurrentStudyID() > -1 )
-    {
-      aStudyBuilder = myCurrentStudy->NewBuilder();
-      aStudyBuilder->NewCommand();  // There is a transaction
-    }
+    aStudyBuilder = getStudyServant()->NewBuilder();
+    aStudyBuilder->NewCommand();  // There is a transaction
+
     aResult->length( aNames.size() );
     int i = 0;
 
@@ -1216,7 +1206,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
         // little trick: for MED file theFileName and theFileNameForPython are the same, but they are different for SAUV
         // - as names of meshes are stored in MED file, we use them for data publishing
         // - as mesh name is not stored in UNV file, we use file name as name of mesh when publishing data
-        aSO = PublishMesh( myCurrentStudy, mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
+        aSO = PublishMesh( mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
 
       // Python Dump
       if ( !aSO->_is_nil() ) {
@@ -1327,10 +1317,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromSTL( const char* theFileName
 #endif
   // publish mesh in the study
   if ( CanPublishInStudy( aMesh ) ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     aStudyBuilder->NewCommand();  // There is a transaction
-    SALOMEDS::SObject_wrap aSO = PublishInStudy
-      ( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
+    SALOMEDS::SObject_wrap aSO = PublishInStudy( SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
     aStudyBuilder->CommitCommand();
     if ( !aSO->_is_nil() ) {
       // Update Python script
@@ -1378,7 +1367,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName,
 
     if (theStatus == SMESH::DRS_OK)
     {
-      SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+      SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
       aStudyBuilder->NewCommand();  // There is a transaction
 
       int i = 0;
@@ -1406,7 +1395,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName,
         // publish mesh in the study
         SALOMEDS::SObject_wrap aSO;
         if ( CanPublishInStudy( mesh ) )
-          aSO = PublishMesh( myCurrentStudy, mesh.in(), meshName.c_str() );
+          aSO = PublishMesh( mesh.in(), meshName.c_str() );
 
         // Python Dump
         if ( !aSO->_is_nil() ) {
@@ -1456,10 +1445,9 @@ SMESH_Gen_i::CreateMeshesFromGMF( const char*             theFileName,
 #endif
   // publish mesh in the study
   if ( CanPublishInStudy( aMesh ) ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     aStudyBuilder->NewCommand();  // There is a transaction
-    SALOMEDS::SObject_wrap aSO = PublishInStudy
-      ( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
+    SALOMEDS::SObject_wrap aSO = PublishInStudy( SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
     aStudyBuilder->CommitCommand();
     if ( !aSO->_is_nil() ) {
       // Update Python script
@@ -1526,16 +1514,17 @@ CORBA::Boolean SMESH_Gen_i::IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
 SALOMEDS::SObject_ptr SMESH_Gen_i::GetAlgoSO(const ::SMESH_Algo* algo)
 {
   if ( algo ) {
-    if ( !myCurrentStudy->_is_nil() ) {
+  SALOMEDS::Study_var aStudy = getStudyServant();
+    if ( !aStudy->_is_nil() ) {
       // find algo in the study
       CORBA::String_var compDataType  = ComponentDataType();
-      SALOMEDS::SComponent_wrap father = myCurrentStudy->FindComponent( compDataType.in() );
+      SALOMEDS::SComponent_wrap father = aStudy->FindComponent( compDataType.in() );
       if ( !father->_is_nil() ) {
-        SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( father );
+        SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( father );
         for ( ; itBig->More(); itBig->Next() ) {
           SALOMEDS::SObject_wrap gotBranch = itBig->Value();
           if ( gotBranch->Tag() == GetAlgorithmsRootTag() ) {
-            SALOMEDS::ChildIterator_wrap algoIt = myCurrentStudy->NewChildIterator( gotBranch );
+            SALOMEDS::ChildIterator_wrap algoIt = aStudy->NewChildIterator( gotBranch );
             for ( ; algoIt->More(); algoIt->Next() ) {
               SALOMEDS::SObject_wrap algoSO = algoIt->Value();
               CORBA::Object_var     algoIOR = SObjectToObject( algoSO );
@@ -2271,16 +2260,16 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
     GEOM::GEOM_Gen_ptr    geomGen   = GetGeomEngine();
 
     // try to find the corresponding SObject
-    SALOMEDS::SObject_wrap SObj = ObjectToSObject( myCurrentStudy, geom.in() );
+    SALOMEDS::SObject_wrap SObj = ObjectToSObject( geom.in() );
     if ( SObj->_is_nil() ) // submesh can be not found even if published
     {
       // try to find published submesh
       GEOM::ListOfLong_var list = geom->GetSubShapeIndices();
       if ( !geom->IsMainShape() && list->length() == 1 ) {
-        SALOMEDS::SObject_wrap mainSO = ObjectToSObject( myCurrentStudy, mainShape );
+        SALOMEDS::SObject_wrap mainSO = ObjectToSObject( mainShape );
         SALOMEDS::ChildIterator_wrap it;
         if ( !mainSO->_is_nil() ) {
-          it = myCurrentStudy->NewChildIterator( mainSO );
+          it = getStudyServant()->NewChildIterator( mainSO );
         }
         if ( !it->_is_nil() ) {
           for ( it->InitEx(true); it->More(); it->Next() ) {
@@ -2300,7 +2289,7 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
       }
     }
     if ( SObj->_is_nil() ) // publish a new subshape
-      SObj = geomGen->AddInStudy( myCurrentStudy, geom, theGeomName, mainShape );
+      SObj = geomGen->AddInStudy( geom, theGeomName, mainShape );
 
     // return only published geometry
     if ( !SObj->_is_nil() ) {
@@ -2348,10 +2337,10 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
         GEOM::GEOM_Object_var geom = ShapeToGeomObject( meshDS->IndexToShape( shapeID ));
         if ( geom->_is_nil() ) {
           // try to find a published sub-shape
-          SALOMEDS::SObject_wrap mainSO = ObjectToSObject( myCurrentStudy, mainShape );
+          SALOMEDS::SObject_wrap mainSO = ObjectToSObject( mainShape );
           SALOMEDS::ChildIterator_wrap it;
           if ( !mainSO->_is_nil() ) {
-            it = myCurrentStudy->NewChildIterator( mainSO );
+            it = getStudyServant()->NewChildIterator( mainSO );
           }
           if ( !it->_is_nil() ) {
             for ( it->InitEx(true); it->More(); it->Next() ) {
@@ -2370,8 +2359,7 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
         }
         if ( geom->_is_nil() ) {
           // explode
-          GEOM::GEOM_IShapesOperations_wrap op =
-            geomGen->GetIShapesOperations( GetCurrentStudyID() );
+          GEOM::GEOM_IShapesOperations_wrap op = geomGen->GetIShapesOperations();
           if ( !op->_is_nil() )
             geom = op->GetSubShape( mainShape, shapeID );
         }
@@ -2560,10 +2548,10 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
         const char* typeNames[] = { "All","Nodes","Edges","Faces","Volumes","0DElems","Balls" };
         { // check of typeNames: compilation failure mains that NB_ELEMENT_TYPES changed:
           const int nbNames = sizeof(typeNames) / sizeof(const char*);
-          int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1];
+          int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
         }
         string groupName = "Gr";
-        SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, theMeshesArray[i] );
+        SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( theMeshesArray[i] );
         if ( aMeshSObj ) {
           CORBA::String_var name = aMeshSObj->GetName();
           groupName += name;
@@ -2717,7 +2705,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
   }
 
   // IPAL21468 Change icon of compound because it need not be computed.
-  SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, aNewMesh );
+  SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( aNewMesh );
   SetPixMap( aMeshSObj, "ICON_SMESH_TREE_MESH" );
 
   if (aNewMeshDS)
@@ -2764,7 +2752,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
   SMESH_Mesh_i*       newMesh_i = SMESH::DownCast<SMESH_Mesh_i*>( newMesh );
   if ( !newMesh_i )
     THROW_SALOME_CORBA_EXCEPTION( "can't create a mesh", SALOME::INTERNAL_ERROR );
-  SALOMEDS::SObject_wrap meshSO = ObjectToSObject(myCurrentStudy, newMesh );
+  SALOMEDS::SObject_wrap meshSO = ObjectToSObject( newMesh );
   if ( !meshSO->_is_nil() )
   {
     SetName( meshSO, meshName, "Mesh" );
@@ -3009,16 +2997,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                                       const char*              theURL,
                                       bool                     isMultiFile )
 {
-  //  ASSERT( theComponent->GetStudy()->StudyId() == myCurrentStudy->StudyId() )
-  // san -- in case <myCurrentStudy> differs from theComponent's study,
-  // use that of the component
-  if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() )
-    SetCurrentStudy( theComponent->GetStudy() );
+  if (!myStudyContext)
+    UpdateStudy();
 
   // Store study contents as a set of python commands
-  SavePython(myCurrentStudy);
+  SavePython();
 
-  StudyContext* myStudyContext = GetCurrentStudyContext();
+  SALOMEDS::Study_var aStudy = getStudyServant();
 
   // Declare a byte stream
   SALOMEDS::TMPFile_var aStreamFile;
@@ -3028,20 +3013,20 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
     ( isMultiFile ) ? TCollection_AsciiString( ( char* )theURL ) : ( char* )SALOMEDS_Tool::GetTmpDir().c_str();
 
   // Create a sequence of files processed
-  SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames;
-  aFileSeq->length( NUM_TMP_FILES );
+  SALOMEDS_Tool::ListOfFiles aFileSeq;
+  aFileSeq.reserve( NUM_TMP_FILES );
 
   TCollection_AsciiString aStudyName( "" );
   if ( isMultiFile )
-    aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( Kernel_Utils::encode(myCurrentStudy->URL()) ).c_str() );
+    aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( Kernel_Utils::encode(aStudy->URL()) ).c_str() );
 
   // Set names of temporary files
   TCollection_AsciiString filename =
     aStudyName + TCollection_AsciiString( "_SMESH.hdf" );        // for SMESH data itself
   TCollection_AsciiString meshfile =
     aStudyName + TCollection_AsciiString( "_SMESH_Mesh.med" );   // for mesh data to be stored in MED file
-  aFileSeq[ 0 ] = CORBA::string_dup( filename.ToCString() );
-  aFileSeq[ 1 ] = CORBA::string_dup( meshfile.ToCString() );
+  aFileSeq.push_back(CORBA::string_dup( filename.ToCString() ));
+  aFileSeq.push_back(CORBA::string_dup( meshfile.ToCString() ));
   filename = tmpDir + filename;
   meshfile = tmpDir + meshfile;
 
@@ -3075,7 +3060,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
   // SetStoreName() to groups before storing hypotheses to let them refer to
   // groups using "store name", which is "Group <group_persistent_id>"
   {
-    SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( theComponent );
+    SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( theComponent );
     for ( ; itBig->More(); itBig->Next() ) {
       SALOMEDS::SObject_wrap gotBranch = itBig->Value();
       if ( gotBranch->Tag() > GetAlgorithmsRootTag() ) {
@@ -3112,7 +3097,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
   aFile->CreateOnDisk();
 
   // --> iterator for top-level objects
-  SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( theComponent );
+  SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( theComponent );
   for ( ; itBig->More(); itBig->Next() ) {
     SALOMEDS::SObject_wrap gotBranch = itBig->Value();
 
@@ -3123,7 +3108,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
       aTopGroup->CreateOnDisk();
 
       // iterator for all hypotheses
-      SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( gotBranch );
+      SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( gotBranch );
       for ( ; it->More(); it->Next() ) {
         SALOMEDS::SObject_wrap mySObject = it->Value();
         CORBA::Object_var anObject = SObjectToObject( mySObject );
@@ -3192,7 +3177,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
       aTopGroup->CreateOnDisk();
 
       // iterator for all algorithms
-      SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( gotBranch );
+      SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( gotBranch );
       for ( ; it->More(); it->Next() ) {
         SALOMEDS::SObject_wrap mySObject = it->Value();
         CORBA::Object_var anObject = SObjectToObject( mySObject );
@@ -3341,13 +3326,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
             SALOMEDS::SObject_wrap myHypBranch;
             found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
             if ( found && !shapeRefFound && hasShape) { // remove applied hyps
-              myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
+              aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
             }
             if ( found && (shapeRefFound || !hasShape) ) {
               aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup );
               aGroup->CreateOnDisk();
 
-              SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myHypBranch );
+              SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myHypBranch );
               int hypNb = 0;
               for ( ; it->More(); it->Next() ) {
                 SALOMEDS::SObject_wrap mySObject = it->Value();
@@ -3385,13 +3370,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
             found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(),
                                               myAlgoBranch.inout() );
             if ( found && !shapeRefFound && hasShape) { // remove applied algos
-              myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
+              aStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
             }
             if ( found && (shapeRefFound || !hasShape)) {
               aGroup = new HDFgroup( "Applied Algorithms", aTopGroup );
               aGroup->CreateOnDisk();
 
-              SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myAlgoBranch );
+              SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myAlgoBranch );
               int algoNb = 0;
               for ( ; it->More(); it->Next() ) {
                 SALOMEDS::SObject_wrap mySObject = it->Value();
@@ -3434,7 +3419,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
               {
                 bool hasShapeRef = false;
                 SALOMEDS::ChildIterator_wrap itSM =
-                  myCurrentStudy->NewChildIterator( mySubmeshBranch );
+                  aStudy->NewChildIterator( mySubmeshBranch );
                 for ( ; itSM->More(); itSM->Next() ) {
                   SALOMEDS::SObject_wrap mySubRef, myShape, mySObject = itSM->Value();
                   if ( mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef.inout() ))
@@ -3459,11 +3444,11 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                         }
                       }
                     }
-                    myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( mySObject );
+                    aStudy->NewBuilder()->RemoveObjectWithChildren( mySObject );
                   }
                 } // loop on submeshes of a type
                 if ( !shapeRefFound || !hasShapeRef ) { // remove the whole submeshes branch
-                  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( mySubmeshBranch );
+                  aStudy->NewBuilder()->RemoveObjectWithChildren( mySubmeshBranch );
                   found = false;
                 }
               }  // end check if there is shape reference in submeshes
@@ -3489,7 +3474,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                 aGroup->CreateOnDisk();
 
                 // iterator for all submeshes of given type
-                SALOMEDS::ChildIterator_wrap itSM = myCurrentStudy->NewChildIterator( mySubmeshBranch );
+                SALOMEDS::ChildIterator_wrap itSM = aStudy->NewChildIterator( mySubmeshBranch );
                 for ( ; itSM->More(); itSM->Next() ) {
                   SALOMEDS::SObject_wrap mySObject = itSM->Value();
                   CORBA::Object_var anSubObject = SObjectToObject( mySObject );
@@ -3526,7 +3511,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                       aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup );
                       aSubSubGroup->CreateOnDisk();
 
-                      SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( mySubHypBranch );
+                      SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( mySubHypBranch );
                       int hypNb = 0;
                       for ( ; it->More(); it->Next() ) {
                         SALOMEDS::SObject_wrap mySubSObject = it->Value();
@@ -3563,7 +3548,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                       aSubSubGroup->CreateOnDisk();
 
                       SALOMEDS::ChildIterator_wrap it =
-                        myCurrentStudy->NewChildIterator( mySubAlgoBranch );
+                        aStudy->NewChildIterator( mySubAlgoBranch );
                       int algoNb = 0;
                       for ( ; it->More(); it->Next() ) {
                         SALOMEDS::SObject_wrap mySubSObject = it->Value();
@@ -3659,7 +3644,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                 aGroup = new HDFgroup( name_group, aTopGroup );
                 aGroup->CreateOnDisk();
 
-                SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myGroupsBranch );
+                SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myGroupsBranch );
                 for ( ; it->More(); it->Next() ) {
                   SALOMEDS::SObject_wrap mySObject = it->Value();
                   CORBA::Object_var aSubObject = SObjectToObject( mySObject );
@@ -3944,11 +3929,11 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
   delete aFile;
 
   // Convert temporary files to stream
-  aStreamFile = SALOMEDS_Tool::PutFilesToStream( tmpDir.ToCString(), aFileSeq.in(), isMultiFile );
+  aStreamFile = SALOMEDS_Tool::PutFilesToStream( tmpDir.ToCString(), aFileSeq, isMultiFile );
 
   // Remove temporary files and directory
   if ( !isMultiFile )
-    SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
+    SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq, true );
 
   return aStreamFile._retn();
 }
@@ -3995,11 +3980,7 @@ void SMESH_Gen_i::loadGeomData( SALOMEDS::SComponent_ptr theCompRoot )
   if ( theCompRoot->_is_nil() )
     return;
 
-  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theCompRoot->GetStudy() );
-  if ( aStudy->_is_nil() )
-    return;
-
-  SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
   aStudyBuilder->LoadWith( theCompRoot, GetGeomEngine() );
 }
 
@@ -4016,29 +3997,26 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                         const char*              theURL,
                         bool                     isMultiFile )
 {
-  if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() )
-    SetCurrentStudy( theComponent->GetStudy() );
-
+  if (!myStudyContext)
+    UpdateStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   /*  if( !theComponent->_is_nil() )
       {
-      //SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theComponent->GetStudy() );
-      if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
-      loadGeomData( myCurrentStudy->FindComponent( "GEOM" ) );
+      if( !aStudy->FindComponent( "GEOM" )->_is_nil() )
+      loadGeomData( aStudy->FindComponent( "GEOM" ) );
       }*/
 
-  StudyContext* myStudyContext = GetCurrentStudyContext();
-
   // Get temporary files location
   TCollection_AsciiString tmpDir =
     ( char* )( isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir().c_str() );
 
   // Convert the stream into sequence of files to process
-  SALOMEDS::ListOfFileNames_var aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
-                                                                            tmpDir.ToCString(),
-                                                                            isMultiFile );
+  SALOMEDS_Tool::ListOfFiles aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
+                                                                         tmpDir.ToCString(),
+                                                                         isMultiFile );
   TCollection_AsciiString aStudyName( "" );
   if ( isMultiFile ) {
-    CORBA::WString_var url = myCurrentStudy->URL();
+    CORBA::WString_var url = aStudy->URL();
     aStudyName = (char*)SALOMEDS_Tool::GetNameFromPath( Kernel_Utils::encode(url.in()) ).c_str();
   }
   // Set names of temporary files
@@ -4343,7 +4321,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
             aDataset->ReadFromDisk( refFromFile );
             aDataset->CloseOnDisk();
             if ( strlen( refFromFile ) > 0 ) {
-              SALOMEDS::SObject_wrap shapeSO = myCurrentStudy->FindObjectID( refFromFile );
+              SALOMEDS::SObject_wrap shapeSO = aStudy->FindObjectID( refFromFile );
 
               // Make sure GEOM data are loaded first
               //loadGeomData( shapeSO->GetFatherComponent() );
@@ -4442,7 +4420,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
             aDataset->ReadFromDisk( refFromFile );
             aDataset->CloseOnDisk();
             // san - it is impossible to recover applied algorithms using their entries within Load() method
-            //SALOMEDS::SObject_wrap hypSO = myCurrentStudy->FindObjectID( refFromFile );
+            //SALOMEDS::SObject_wrap hypSO = aStudy->FindObjectID( refFromFile );
             //CORBA::Object_var hypObject = SObjectToObject( hypSO );
             int id = atoi( refFromFile );
             delete [] refFromFile;
@@ -4479,7 +4457,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
             aDataset->ReadFromDisk( refFromFile );
             aDataset->CloseOnDisk();
             // san - it is impossible to recover applied hypotheses using their entries within Load() method
-            //SALOMEDS::SObject_wrap hypSO = myCurrentStudy->FindObjectID( refFromFile );
+            //SALOMEDS::SObject_wrap hypSO = myStudy->FindObjectID( refFromFile );
             //CORBA::Object_var hypObject = SObjectToObject( hypSO );
             int id = atoi( refFromFile );
             delete [] refFromFile;
@@ -4550,7 +4528,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                 aDataset->ReadFromDisk( refFromFile );
                 aDataset->CloseOnDisk();
                 if ( strlen( refFromFile ) > 0 ) {
-                  SALOMEDS::SObject_wrap subShapeSO = myCurrentStudy->FindObjectID( refFromFile );
+                  SALOMEDS::SObject_wrap subShapeSO = aStudy->FindObjectID( refFromFile );
                   CORBA::Object_var subShapeObject = SObjectToObject( subShapeSO );
                   if ( !CORBA::is_nil( subShapeObject ) ) {
                     aSubShapeObject = GEOM::GEOM_Object::_narrow( subShapeObject );
@@ -4700,7 +4678,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                 aDataset->ReadFromDisk( refFromFile );
                 aDataset->CloseOnDisk();
                 if ( strlen( refFromFile ) > 0 ) {
-                  SALOMEDS::SObject_wrap shapeSO = myCurrentStudy->FindObjectID( refFromFile );
+                  SALOMEDS::SObject_wrap shapeSO = aStudy->FindObjectID( refFromFile );
                   CORBA::Object_var shapeObject = SObjectToObject( shapeSO );
                   if ( !CORBA::is_nil( shapeObject ) ) {
                     aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject );
@@ -4850,7 +4828,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
     SMESH_File meshFile( meshfile.ToCString() );
     if ( !meshFile ) // no meshfile exists
     {
-      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
+      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq, true );
     }
     else
     {
@@ -4867,12 +4845,11 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
 
   // creation of tree nodes for all data objects in the study
   // to support tree representation customization and drag-n-drop:
-  SALOMEDS::Study_var                    study = theComponent->GetStudy();
-  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = study->GetUseCaseBuilder();
+  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
   if ( !useCaseBuilder->IsUseCaseNode( theComponent ) ) {
     useCaseBuilder->SetRootCurrent();
     useCaseBuilder->Append( theComponent ); // component object is added as the top level item
-    SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent );
+    SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( theComponent );
     for (it->InitEx(true); it->More(); it->Next()) {
       useCaseBuilder->AppendTo( it->Value()->GetFather(), it->Value() );
     }
@@ -4932,22 +4909,13 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent )
 {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" );
 
-  // set correct current study
-  SALOMEDS::Study_var study = theComponent->GetStudy();
-  if ( study->StudyId() != GetCurrentStudyID())
-    setCurrentStudy( study, /*IsBeingClosed=*/true );
-
   // Clear study contexts data
-  int studyId = GetCurrentStudyID();
-  if ( myStudyContextMap.find( studyId ) != myStudyContextMap.end() ) {
-    delete myStudyContextMap[ studyId ];
-    myStudyContextMap.erase( studyId );
-  }
+  delete myStudyContext;
+  myStudyContext = 0;
 
   // remove the tmp files meshes are loaded from
   SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
 
-  myCurrentStudy = SALOMEDS::Study::_nil();
   return;
 }
 
@@ -4980,7 +4948,6 @@ char* SMESH_Gen_i::IORToLocalPersistentID( SALOMEDS::SObject_ptr /*theSObject*/,
                                            CORBA::Boolean        /*isASCII*/ )
 {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::IORToLocalPersistentID" );
-  StudyContext* myStudyContext = GetCurrentStudyContext();
 
   if ( myStudyContext && strcmp( IORString, "" ) != 0 ) {
     int anId = myStudyContext->findId( IORString );
@@ -5008,7 +4975,6 @@ char* SMESH_Gen_i::LocalPersistentIDToIOR( SALOMEDS::SObject_ptr /*theSObject*/,
                                            CORBA::Boolean        /*isASCII*/ )
 {
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::LocalPersistentIDToIOR(): id = " << aLocalPersistentID );
-  StudyContext* myStudyContext = GetCurrentStudyContext();
 
   if ( myStudyContext && strcmp( aLocalPersistentID, "" ) != 0 ) {
     int anId = atoi( aLocalPersistentID );
@@ -5024,7 +4990,6 @@ char* SMESH_Gen_i::LocalPersistentIDToIOR( SALOMEDS::SObject_ptr /*theSObject*/,
 
 int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
 {
-  StudyContext* myStudyContext = GetCurrentStudyContext();
   if ( myStudyContext && !CORBA::is_nil( theObject )) {
     CORBA::String_var iorString = GetORB()->object_to_string( theObject );
     return myStudyContext->addObject( string( iorString.in() ) );
@@ -5042,7 +5007,6 @@ int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
 
 CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
 {
-  StudyContext* myStudyContext = GetCurrentStudyContext();
   if ( myStudyContext && !CORBA::is_nil( theObject )) {
     string iorString = GetORB()->object_to_string( theObject );
     return myStudyContext->findId( iorString );
@@ -5062,18 +5026,13 @@ void SMESH_Gen_i::SetName(const char* theIOR,
 {
   if ( theIOR && strcmp( theIOR, "" ) ) {
     CORBA::Object_var anObject = GetORB()->string_to_object( theIOR );
-    SALOMEDS::SObject_wrap aSO = ObjectToSObject( myCurrentStudy, anObject );
+    SALOMEDS::SObject_wrap aSO = ObjectToSObject( anObject );
     if ( !aSO->_is_nil() ) {
       SetName( aSO, theName );
     }
   }
 }
 
-int SMESH_Gen_i::GetCurrentStudyID()
-{
-  return myCurrentStudy->_is_nil() || myCurrentStudy->_non_existent() ? -1 : myCurrentStudy->StudyId();
-}
-
 // Version information
 char* SMESH_Gen_i::getVersion()
 {
@@ -5095,9 +5054,8 @@ void SMESH_Gen_i::Move( const SMESH::sobject_list& what,
 {
   if ( CORBA::is_nil( where ) ) return;
 
-  SALOMEDS::Study_var study = where->GetStudy();
-  SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
-  SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
+  SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder();
+  SALOMEDS::UseCaseBuilder_var useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
   SALOMEDS::SComponent_var father = where->GetFatherComponent();
   std::string dataType = father->ComponentDataType();
   if ( dataType != "SMESH" ) return; // not a SMESH component
index 1e869462cd65cf08dc9936b82e669d92e7550975..53921ba6461aeb569e55cf72ae794b9fad957de6 100644 (file)
@@ -154,8 +154,9 @@ public:
   // Get CORBA object corresponding to the SALOMEDS::SObject
   static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
   // Get the SALOMEDS::SObject corresponding to a CORBA object
-  static SALOMEDS::SObject_ptr ObjectToSObject(SALOMEDS::Study_ptr theStudy,
-                                               CORBA::Object_ptr   theObject);
+  static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
+  // Get the SALOMEDS::Study from naming service
+  static SALOMEDS::Study_ptr getStudyServant();
   // Get GEOM Object correspoding to TopoDS_Shape
   GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
   // Get TopoDS_Shape correspoding to GEOM_Object
@@ -182,15 +183,19 @@ public:
   //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
   void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
 
-  // Set current study
+  // Set embedded mode
   void SetEmbeddedMode( CORBA::Boolean theMode );
-  // Get current study
+  // Check embedded mode
   CORBA::Boolean IsEmbeddedMode();
 
-  // Set current study
-  void SetCurrentStudy( SALOMEDS::Study_ptr theStudy );
-  // Get current study
-  SALOMEDS::Study_ptr GetCurrentStudy();
+  // Set enable publishing in the study
+  void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
+
+  // Check enable publishing
+  CORBA::Boolean IsEnablePublish();
+
+  // Update study
+  void UpdateStudy();
 
   // Create hypothesis/algorothm of given type
   SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
@@ -437,8 +442,7 @@ public:
   // 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,
+  SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
                                         CORBA::Object_ptr     theObject,
                                         const char*           theName )
     throw ( SALOME::SALOME_Exception );
@@ -467,19 +471,17 @@ public:
   // Dump python
   // ============
 
-  virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
-                                       CORBA::Boolean isPublished,
+  virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
                                        CORBA::Boolean isMultiFile,
                                        CORBA::Boolean& isValidScript);
 
-  void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
+  void AddToPythonScript (const TCollection_AsciiString& theString);
 
-  void RemoveLastFromPythonScript (int theStudyID);
+  void RemoveLastFromPythonScript();
 
-  void SavePython (SALOMEDS::Study_ptr theStudy);
+  void SavePython();
 
-  TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy,
-                                           Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+  TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                                            Resource_DataMapOfAsciiStringAsciiString& theNames,
                                            bool isPublished,
                                            bool isMultiFile,
@@ -487,9 +489,9 @@ public:
                                            bool& aValidScript,
                                            TCollection_AsciiString& theSavedTrace);
 
-  TCollection_AsciiString GetNewPythonLines (int theStudyID);
+  TCollection_AsciiString GetNewPythonLines();
 
-  void CleanPythonTrace (int theStudyID);
+  void CleanPythonTrace();
 
   // *****************************************
   // Internal methods
@@ -519,33 +521,26 @@ public:
   static long GetBallElementsGroupsTag();
 
   // publishing methods
-  SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
-  SALOMEDS::SObject_ptr PublishMesh (SALOMEDS::Study_ptr   theStudy,
-                                     SMESH::SMESH_Mesh_ptr theMesh,
+  SALOMEDS::SComponent_ptr PublishComponent();
+  SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
                                      const char*           theName = 0);
-  SALOMEDS::SObject_ptr PublishHypothesis (SALOMEDS::Study_ptr         theStudy,
-                                           SMESH::SMESH_Hypothesis_ptr theHyp,
+  SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
                                            const char*                 theName = 0);
-  SALOMEDS::SObject_ptr PublishSubMesh (SALOMEDS::Study_ptr      theStudy,
-                                        SMESH::SMESH_Mesh_ptr    theMesh,
+  SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr    theMesh,
                                         SMESH::SMESH_subMesh_ptr theSubMesh,
                                         GEOM::GEOM_Object_ptr    theShapeObject,
                                         const char*              theName = 0);
-  SALOMEDS::SObject_ptr PublishGroup (SALOMEDS::Study_ptr    theStudy,
-                                      SMESH::SMESH_Mesh_ptr  theMesh,
+  SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr  theMesh,
                                       SMESH::SMESH_GroupBase_ptr theGroup,
                                       GEOM::GEOM_Object_ptr  theShapeObject,
                                       const char*            theName = 0);
-  bool AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
-                            SMESH::SMESH_Mesh_ptr       theMesh,
+  bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr       theMesh,
                             GEOM::GEOM_Object_ptr       theShapeObject,
                             SMESH::SMESH_Hypothesis_ptr theHyp);
-  bool RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy,
-                                 SMESH::SMESH_Mesh_ptr       theMesh,
+  bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                  GEOM::GEOM_Object_ptr       theShapeObject,
                                  SMESH::SMESH_Hypothesis_ptr theHyp);
-  SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr   theStudy,
-                                                 SMESH::SMESH_Mesh_ptr theMesh,
+  SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
                                                  GEOM::GEOM_Object_ptr theShape);
   static void SetName(SALOMEDS::SObject_ptr theSObject,
                       const char*           theName,
@@ -555,7 +550,7 @@ public:
                         const char*           thePixMap);
 
   //  Get study context
-  StudyContext* GetCurrentStudyContext();
+  StudyContext* GetStudyContext();
 
   // Register an object in a StudyContext; return object id
   int RegisterObject(CORBA::Object_ptr theObject);
@@ -567,7 +562,7 @@ public:
   template<class TInterface>
   typename TInterface::_var_type GetObjectByOldId( const int oldID )
   {
-    if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
+    if ( myStudyContext ) {
       std::string ior = myStudyContext->getIORbyOldId( oldID );
       if ( !ior.empty() )
         return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
@@ -575,9 +570,6 @@ public:
     return TInterface::_nil();
   }
 
-  // Get current study ID
-  int GetCurrentStudyID();
-
   /*!
    * \brief Find SObject for an algo
    */
@@ -653,9 +645,6 @@ private:
                                                 const char* theCommandNameForPython,
                                                 const char* theFileNameForPython);
 
-  void setCurrentStudy( SALOMEDS::Study_ptr theStudy,
-                        bool                theStudyIsBeingClosed=false);
-
   std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
                                SMESH::ElementType     theElemType,
                                TopoDS_Shape& aShape,
@@ -673,11 +662,11 @@ private:
   // hypotheses managing
   std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
 
-  std::map<int, StudyContext*>   myStudyContextMap;  // Map of study context objects
+  StudyContext*                  myStudyContext;  // study context
 
   GEOM_Client*                   myShapeReader;      // Shape reader
-  SALOMEDS::Study_var            myCurrentStudy;     // Current study
   CORBA::Boolean                 myIsEmbeddedMode;   // Current mode
+  CORBA::Boolean                 myIsEnablePublish;  // Enable publishing
 
   // Default color of groups
   std::string myDefaultGroupColor;
@@ -686,11 +675,11 @@ private:
   bool myToForgetMeshDataOnHypModif;
 
   // Dump Python: trace of API methods calls
-  std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
-  bool                                                     myIsHistoricalPythonDump;
-  std::vector< int >                                       myLastParamIndex;
-  std::vector< std::string >                               myLastParameters;
-  std::string                                              myLastObj;
+  Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
+  bool                                   myIsHistoricalPythonDump;
+  std::vector< int >                     myLastParamIndex;
+  std::vector< std::string >             myLastParameters;
+  std::string                            myLastObj;
 };
 
 
index b08b7e3e6d35d8b09a536a17ca8b5b5e75a68af5..c9b43633cbba20c5b671f4db37b25a167d3d1e78 100644 (file)
@@ -40,6 +40,7 @@
 #include <Utils_ExceptHandlers.hxx>
 #include <SALOMEDS_wrap.hxx>
 #include <SALOMEDS_Attributes_wrap.hxx>
+#include <SALOME_KernelServices.hxx>
 
 #include <TCollection_AsciiString.hxx>
 #include <TopoDS_Solid.hxx>
@@ -162,10 +163,11 @@ long SMESH_Gen_i::GetBallElementsGroupsTag()
 
 bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
 {
-  if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
-  if( GetCurrentStudyID() < 0 )
-    return false;
+  if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(getStudyServant()));
   
+  if( !myIsEnablePublish )
+    return false;
+
   SMESH::SMESH_Mesh_var aMesh       = SMESH::SMESH_Mesh::_narrow(theIOR);
   if( !aMesh->_is_nil() )
     return true;
@@ -191,18 +193,26 @@ bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
 //purpose  : Put a result into a SALOMEDS::SObject_wrap or call UnRegister()!
 //=======================================================================
 
-SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(SALOMEDS::Study_ptr theStudy,
-                                                   CORBA::Object_ptr   theObject)
+SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(CORBA::Object_ptr theObject)
 {
   SALOMEDS::SObject_wrap aSO;
-  if ( !CORBA::is_nil( theStudy ) && !CORBA::is_nil( theObject ))
+  if ( !CORBA::is_nil( theObject ))
   {
     CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theObject );
-    aSO = theStudy->FindObjectIOR( objStr.in() );
+    aSO = getStudyServant()->FindObjectIOR( objStr.in() );
   }
   return aSO._retn();
 }
 
+//=======================================================================
+//function : GetStudyPtr
+//purpose  : Get study from naming service
+//=======================================================================
+SALOMEDS::Study_ptr SMESH_Gen_i::getStudyServant()
+{
+  return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
+}
+
 //=======================================================================
 //function : objectToServant
 //purpose  : 
@@ -255,14 +265,14 @@ TopoDS_Shape SMESH_Gen_i::GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject)
 //purpose  : 
 //=======================================================================
 
-static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
-                                     CORBA::Object_ptr     theIOR,
+static SALOMEDS::SObject_ptr publish(CORBA::Object_ptr     theIOR,
                                      SALOMEDS::SObject_ptr theFatherObject,
                                      const int             theTag = 0,
                                      const char*           thePixMap = 0,
                                      const bool            theSelectable = true)
 {
-  SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theStudy, theIOR );
+  SALOMEDS::Study_var theStudy = SMESH_Gen_i::getStudyServant();
+  SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theIOR );
   SALOMEDS::StudyBuilder_var     aStudyBuilder = theStudy->NewBuilder();
   SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
   bool isNewSO = false, isInUseCaseTree = false;
@@ -356,8 +366,7 @@ void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
                           const char*           theDefaultName)
 {
   if ( !theSObject->_is_nil() ) {
-    SALOMEDS::Study_var               aStudy = theSObject->GetStudy();
-    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     SALOMEDS::GenericAttribute_wrap   anAttr =
       aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
     SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
@@ -389,8 +398,7 @@ void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,
 {
   if ( !theSObject->_is_nil() && thePixMap && strlen( thePixMap ))
   {
-    SALOMEDS::Study_var               aStudy = theSObject->GetStudy();
-    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
     SALOMEDS::GenericAttribute_wrap anAttr =
       aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributePixMap" );
     SALOMEDS::AttributePixMap_wrap aPMAttr = anAttr;
@@ -403,21 +411,21 @@ void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,
 //purpose  : 
 //=======================================================================
 
-static void addReference (SALOMEDS::Study_ptr   theStudy,
-                          SALOMEDS::SObject_ptr theSObject,
+static void addReference (SALOMEDS::SObject_ptr theSObject,
                           CORBA::Object_ptr     theToObject,
                           int                   theTag = 0)
 {
-  SALOMEDS::SObject_wrap aToObjSO = SMESH_Gen_i::ObjectToSObject( theStudy, theToObject );
+  SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
+  SALOMEDS::SObject_wrap aToObjSO = SMESH_Gen_i::ObjectToSObject( theToObject );
   if ( !aToObjSO->_is_nil() && !theSObject->_is_nil() ) {
-    SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
     SALOMEDS::SObject_wrap aReferenceSO;
     if ( !theTag ) {
       // check if the reference to theToObject already exists
       // and find a free label for the reference object
       bool isReferred = false;
       int tag = 1;
-      SALOMEDS::ChildIterator_wrap anIter = theStudy->NewChildIterator( theSObject );
+      SALOMEDS::ChildIterator_wrap anIter = aStudy->NewChildIterator( theSObject );
       for ( ; !isReferred && anIter->More(); anIter->Next(), ++tag ) {
         SALOMEDS::SObject_wrap curSO = anIter->Value();
         if ( curSO->ReferencedObject( aReferenceSO.inout() )) {
@@ -444,7 +452,7 @@ static void addReference (SALOMEDS::Study_ptr   theStudy,
 
     // add reference to the use case tree
     // (to support tree representation customization and drag-n-drop)
-    SALOMEDS::UseCaseBuilder_wrap  useCaseBuilder = theStudy->GetUseCaseBuilder();
+    SALOMEDS::UseCaseBuilder_wrap  useCaseBuilder = aStudy->GetUseCaseBuilder();
     SALOMEDS::UseCaseIterator_wrap    useCaseIter = useCaseBuilder->GetUseCaseIterator(theSObject);
     for ( ; useCaseIter->More(); useCaseIter->Next() )
     {
@@ -464,42 +472,41 @@ static void addReference (SALOMEDS::Study_ptr   theStudy,
  */
 //=============================================================================
 
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy,
-                                                  SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
                                                   CORBA::Object_ptr     theIOR,
                                                   const char*           theName)
      throw (SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
   SALOMEDS::SObject_wrap aSO;
-  if ( CORBA::is_nil( theStudy ) || CORBA::is_nil( theIOR ))
+  if ( CORBA::is_nil( theIOR ))
     return aSO._retn();
   if(MYDEBUG) MESSAGE("PublishInStudy");
 
   // Publishing a mesh
   SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( theIOR );
   if( !aMesh->_is_nil() )
-    aSO = PublishMesh( theStudy, aMesh, theName );
+    aSO = PublishMesh( aMesh, theName );
 
   // Publishing a sub-mesh
   SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( theIOR );
   if( aSO->_is_nil() && !aSubMesh->_is_nil() ) {
     GEOM::GEOM_Object_var aShapeObject = aSubMesh->GetSubShape();
     aMesh = aSubMesh->GetFather();
-    aSO = PublishSubMesh( theStudy, aMesh, aSubMesh, aShapeObject, theName );
+    aSO = PublishSubMesh( aMesh, aSubMesh, aShapeObject, theName );
   }
 
   // Publishing a hypothesis or algorithm
   SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( theIOR );
   if ( aSO->_is_nil() && !aHyp->_is_nil() )
-    aSO = PublishHypothesis( theStudy, aHyp );
+    aSO = PublishHypothesis( aHyp );
 
   // Publishing a group
   SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(theIOR);
   if ( aSO->_is_nil() && !aGroup->_is_nil() ) {
     GEOM::GEOM_Object_var aShapeObject;
     aMesh = aGroup->GetMesh();
-    aSO = PublishGroup( theStudy, aMesh, aGroup, aShapeObject, theName );
+    aSO = PublishGroup( aMesh, aGroup, aShapeObject, theName );
   }
   if(MYDEBUG) MESSAGE("PublishInStudy_END");
 
@@ -511,17 +518,15 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy
 //purpose  : 
 //=======================================================================
 
-SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent(SALOMEDS::Study_ptr theStudy)
+SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
 {
-  if ( CORBA::is_nil( theStudy ))
-    return SALOMEDS::SComponent::_nil();
   if(MYDEBUG) MESSAGE("PublishComponent");
 
-  SALOMEDS::StudyBuilder_var    aStudyBuilder  = theStudy->NewBuilder(); 
-  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
+  SALOMEDS::StudyBuilder_var    aStudyBuilder  = getStudyServant()->NewBuilder();
+  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
 
   CORBA::String_var   compDataType = ComponentDataType();
-  SALOMEDS::SComponent_wrap father = theStudy->FindComponent( compDataType.in() );
+  SALOMEDS::SComponent_wrap father = getStudyServant()->FindComponent( compDataType.in() );
   if ( !CORBA::is_nil( father ) ) {
     // check that the component is added to the use case browser
     if ( !useCaseBuilder->IsUseCaseNode( father ) ) {
@@ -564,21 +569,19 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent(SALOMEDS::Study_ptr theSt
 //purpose  : 
 //=======================================================================
 
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
-                                                SMESH::SMESH_Mesh_ptr theMesh,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
                                                 const char*           theName)
 {
-  if ( CORBA::is_nil( theStudy ) ||
-       CORBA::is_nil( theMesh ))
+  if ( CORBA::is_nil( theMesh ))
     return SALOMEDS::SComponent::_nil();
   if(MYDEBUG) MESSAGE("PublishMesh--IN");
 
   // find or publish a mesh
 
-  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
   if ( aMeshSO->_is_nil() )
   {
-    SALOMEDS::SComponent_wrap father = PublishComponent( theStudy );
+    SALOMEDS::SComponent_wrap father = PublishComponent();
     if ( father->_is_nil() )
       return aMeshSO._retn();
 
@@ -589,7 +592,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
     else
       aTag++;
 
-    aMeshSO = publish (theStudy, theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
+    aMeshSO = publish ( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
     if ( aMeshSO->_is_nil() )
       return aMeshSO._retn();
   }
@@ -599,7 +602,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
 
   GEOM::GEOM_Object_var aShapeObject = theMesh->GetShapeToMesh();
   if ( !CORBA::is_nil( aShapeObject )) {
-    addReference( theStudy, aMeshSO, aShapeObject, GetRefOnShapeTag() );
+    addReference( aMeshSO, aShapeObject, GetRefOnShapeTag() );
 
     // Publish global hypotheses
 
@@ -607,8 +610,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
     for ( CORBA::ULong i = 0; i < hypList->length(); i++ )
     {
       SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
-      SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp );
-      AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
+      SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp );
+      AddHypothesisToShape( theMesh, aShapeObject, aHyp );
     }
   }
 
@@ -623,7 +626,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
     SMESH::SMESH_subMesh_ptr aSubMesh = (*subIt).second->_this();
     if ( !CORBA::is_nil( aSubMesh )) {
       aShapeObject = aSubMesh->GetSubShape();
-      SALOMEDS::SObject_wrap( PublishSubMesh( theStudy, theMesh, aSubMesh, aShapeObject ));
+      SALOMEDS::SObject_wrap( PublishSubMesh( theMesh, aSubMesh, aShapeObject ));
     }
   }
 
@@ -638,7 +641,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
       SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
       if ( !aGeomGroup->_is_nil() )
         aShapeObj = aGeomGroup->GetShape();
-      SALOMEDS::SObject_wrap( PublishGroup( theStudy, theMesh, aGroup, aShapeObj ));
+      SALOMEDS::SObject_wrap( PublishGroup( theMesh, aGroup, aShapeObj ));
     }
   }
 
@@ -651,22 +654,20 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
 //purpose  : 
 //=======================================================================
 
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theStudy,
-                                                   SMESH::SMESH_Mesh_ptr    theMesh,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr    theMesh,
                                                    SMESH::SMESH_subMesh_ptr theSubMesh,
                                                    GEOM::GEOM_Object_ptr    theShapeObject,
                                                    const char*              theName)
 {
-  if (theStudy->_is_nil() || theMesh->_is_nil() ||
-      theSubMesh->_is_nil() || theShapeObject->_is_nil() )
+  if ( theMesh->_is_nil() || theSubMesh->_is_nil() || theShapeObject->_is_nil() )
     return SALOMEDS::SObject::_nil();
 
-  SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theStudy, theSubMesh );
+  SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theSubMesh );
   if ( aSubMeshSO->_is_nil() )
   {
-    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
     if ( aMeshSO->_is_nil() ) {
-      aMeshSO = PublishMesh( theStudy, theMesh );
+      aMeshSO = PublishMesh( theMesh );
       if ( aMeshSO->_is_nil())
         return SALOMEDS::SObject::_nil();
     }
@@ -705,8 +706,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
     }
 
     // Find or create submesh root
-    SALOMEDS::SObject_wrap aRootSO = publish (theStudy, CORBA::Object::_nil(),
-                                             aMeshSO, aRootTag, 0, false );
+    SALOMEDS::SObject_wrap aRootSO = publish ( CORBA::Object::_nil(),
+                                               aMeshSO, aRootTag, 0, false );
     if ( aRootSO->_is_nil() )
       return aSubMeshSO._retn();
 
@@ -716,7 +717,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
     SMESH::array_of_ElementType_var elemTypes = theSubMesh->GetTypes();
     const int isEmpty = ( elemTypes->length() == 0 );
     const char* pm[2] = { "ICON_SMESH_TREE_MESH", "ICON_SMESH_TREE_MESH_WARN" };
-    aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, pm[isEmpty] );
+    aSubMeshSO = publish ( theSubMesh, aRootSO, 0, pm[isEmpty] );
     if ( aSubMeshSO->_is_nil() )
       return aSubMeshSO._retn();
   }
@@ -724,15 +725,15 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
 
   // Add reference to theShapeObject
 
-  addReference( theStudy, aSubMeshSO, theShapeObject, 1 );
+  addReference( aSubMeshSO, theShapeObject, 1 );
 
   // Publish hypothesis
 
   SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( theShapeObject );
   for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) {
     SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
-    SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp );
-    AddHypothesisToShape( theStudy, theMesh, theShapeObject, aHyp );
+    SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp );
+    AddHypothesisToShape( theMesh, theShapeObject, aHyp );
   }
 
   return aSubMeshSO._retn();
@@ -743,21 +744,20 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
 //purpose  : 
 //=======================================================================
 
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy,
-                                                 SMESH::SMESH_Mesh_ptr  theMesh,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SMESH::SMESH_Mesh_ptr  theMesh,
                                                  SMESH::SMESH_GroupBase_ptr theGroup,
                                                  GEOM::GEOM_Object_ptr  theShapeObject,
                                                  const char*            theName)
 {
-  if (theStudy->_is_nil() || theMesh->_is_nil() || theGroup->_is_nil() )
+  if (theMesh->_is_nil() || theGroup->_is_nil() )
     return SALOMEDS::SObject::_nil();
 
-  SALOMEDS::SObject_wrap aGroupSO = ObjectToSObject( theStudy, theGroup );
+  SALOMEDS::SObject_wrap aGroupSO = ObjectToSObject( theGroup );
   if ( aGroupSO->_is_nil() )
   {
-    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
     if ( aMeshSO->_is_nil() ) {
-      aMeshSO = PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), theMesh, "");
+      aMeshSO = PublishInStudy( SALOMEDS::SObject::_nil(), theMesh, "");
       if ( aMeshSO->_is_nil())
         return SALOMEDS::SObject::_nil();
     }
@@ -773,8 +773,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
       long aRootTag = GetNodeGroupsTag() + aType - 1;
 
       // Find or create groups root
-      SALOMEDS::SObject_wrap aRootSO = publish (theStudy, CORBA::Object::_nil(),
-                                               aMeshSO, aRootTag, 0, false );
+      SALOMEDS::SObject_wrap aRootSO = publish ( CORBA::Object::_nil(),
+                                                 aMeshSO, aRootTag, 0, false );
       if ( aRootSO->_is_nil() ) return SALOMEDS::SObject::_nil();
 
       if ( aType < sizeof(aRootNames)/sizeof(char*) )
@@ -798,7 +798,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
             isEmpty = ( allElemTypes[i] != theGroup->GetType() );
         }
       }
-      aGroupSO = publish (theStudy, theGroup, aRootSO, 0, pm[isEmpty].c_str() );
+      aGroupSO = publish ( theGroup, aRootSO, 0, pm[isEmpty].c_str() );
     }
     if ( aGroupSO->_is_nil() )
       return aGroupSO._retn();
@@ -808,7 +808,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
 
   //Add reference to geometry
   if ( !theShapeObject->_is_nil() )
-    addReference( theStudy, aGroupSO, theShapeObject, 1 );
+    addReference( aGroupSO, theShapeObject, 1 );
 
   return aGroupSO._retn();
 }
@@ -819,20 +819,19 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
 //=======================================================================
 
 SALOMEDS::SObject_ptr
-  SMESH_Gen_i::PublishHypothesis (SALOMEDS::Study_ptr         theStudy,
-                                  SMESH::SMESH_Hypothesis_ptr theHyp,
+  SMESH_Gen_i::PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
                                   const char*                 theName)
 {
   if(MYDEBUG) MESSAGE("PublishHypothesis")
-  if (theStudy->_is_nil() || theHyp->_is_nil())
+  if (theHyp->_is_nil())
     return SALOMEDS::SObject::_nil();
 
   CORBA::String_var hypType = theHyp->GetName();
 
-  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theStudy, theHyp );
+  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theHyp );
   if ( aHypSO->_is_nil() )
   {
-    SALOMEDS::SComponent_wrap father = PublishComponent( theStudy );
+    SALOMEDS::SComponent_wrap father = PublishComponent();
     if ( father->_is_nil() )
       return aHypSO._retn();
 
@@ -840,7 +839,7 @@ SALOMEDS::SObject_ptr
     bool isAlgo = ( !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil() );
     int aRootTag = isAlgo ? GetAlgorithmsRootTag() : GetHypothesisRootTag();
     SALOMEDS::SObject_wrap aRootSO =
-      publish (theStudy, CORBA::Object::_nil(),father, aRootTag,
+      publish (CORBA::Object::_nil(),father, aRootTag,
                isAlgo ? "ICON_SMESH_TREE_ALGO" : "ICON_SMESH_TREE_HYPO", false);
     SetName( aRootSO, isAlgo ?  "Algorithms" : "Hypotheses" );
 
@@ -851,7 +850,7 @@ SALOMEDS::SObject_ptr
     string pluginName = myHypCreatorMap[ hypType.in() ]->GetModuleName();
     if ( pluginName != "StdMeshers" )
       aPmName = pluginName + "::" + aPmName;
-    aHypSO = publish( theStudy, theHyp, aRootSO, 0, aPmName.c_str() );
+    aHypSO = publish( theHyp, aRootSO, 0, aPmName.c_str() );
   }
 
   SetName( aHypSO, theName, hypType.in() );
@@ -866,8 +865,7 @@ SALOMEDS::SObject_ptr
 //=======================================================================
 
 SALOMEDS::SObject_ptr
-  SMESH_Gen_i::GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr   theStudy,
-                                        SMESH::SMESH_Mesh_ptr theMesh,
+  SMESH_Gen_i::GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
                                         GEOM::GEOM_Object_ptr theShape)
 {
   if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape")
@@ -886,12 +884,12 @@ SALOMEDS::SObject_ptr
   if ( !aShape.IsNull() && mesh_i && mesh_i->GetImpl().GetMeshDS() ) {
     SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS();
     if ( aShape.IsSame( meshDS->ShapeToMesh() ))
-      aMeshOrSubMesh = ObjectToSObject( theStudy, theMesh );
+      aMeshOrSubMesh = ObjectToSObject( theMesh );
     else {
       int shapeID = meshDS->ShapeToIndex( aShape );
       SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID);
       if ( !aSubMesh->_is_nil() )
-        aMeshOrSubMesh = ObjectToSObject( theStudy, aSubMesh );
+        aMeshOrSubMesh = ObjectToSObject( aSubMesh );
     }
   }
   if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape--END")
@@ -903,27 +901,26 @@ SALOMEDS::SObject_ptr
 //purpose  : 
 //=======================================================================
 
-bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
-                                       SMESH::SMESH_Mesh_ptr       theMesh,
+bool SMESH_Gen_i::AddHypothesisToShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                        GEOM::GEOM_Object_ptr       theShape,
                                        SMESH::SMESH_Hypothesis_ptr theHyp)
 {
   if(MYDEBUG) MESSAGE("AddHypothesisToShape")
-  if (theStudy->_is_nil() || theMesh->_is_nil() ||
+  if (theMesh->_is_nil() ||
       theHyp->_is_nil() || (theShape->_is_nil()
                             && theMesh->HasShapeToMesh()) )
     return false;
 
-  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
   if ( aMeshSO->_is_nil() )
-    aMeshSO = PublishMesh( theStudy, theMesh );
-  SALOMEDS::SObject_wrap aHypSO = PublishHypothesis( theStudy, theHyp );
+    aMeshSO = PublishMesh( theMesh );
+  SALOMEDS::SObject_wrap aHypSO = PublishHypothesis( theHyp );
   if ( aMeshSO->_is_nil() || aHypSO->_is_nil())
     return false;
 
   // Find a mesh or submesh referring to theShape
   SALOMEDS::SObject_wrap aMeshOrSubMesh =
-    GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
+    GetMeshOrSubmeshByShape( theMesh, theShape );
   if ( aMeshOrSubMesh->_is_nil() )
   {
     // publish submesh
@@ -933,7 +930,7 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
       SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS();
       int shapeID = meshDS->ShapeToIndex( aShape );
       SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID);
-      aMeshOrSubMesh = PublishSubMesh( theStudy, theMesh, aSubMesh, theShape );
+      aMeshOrSubMesh = PublishSubMesh( theMesh, aSubMesh, theShape );
     }
     if ( aMeshOrSubMesh->_is_nil() )
       return false;
@@ -942,12 +939,12 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
   //Find or Create Applied Hypothesis root
   bool aIsAlgo = !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil();
   SALOMEDS::SObject_wrap AHR =
-    publish (theStudy, CORBA::Object::_nil(), aMeshOrSubMesh,
+    publish (CORBA::Object::_nil(), aMeshOrSubMesh,
              aIsAlgo ? GetRefOnAppliedAlgorithmsTag() : GetRefOnAppliedHypothesisTag(),
              aIsAlgo ? "ICON_SMESH_TREE_ALGO" : "ICON_SMESH_TREE_HYPO", false);
   SetName( AHR, aIsAlgo ? "Applied algorithms" : "Applied hypotheses" );
 
-  addReference( theStudy, AHR, theHyp );
+  addReference( AHR, theHyp );
 
   if(MYDEBUG) MESSAGE("AddHypothesisToShape--END")
   return true;
@@ -958,17 +955,16 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
 //purpose  : 
 //=======================================================================
 
-bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy,
-                                            SMESH::SMESH_Mesh_ptr       theMesh,
+bool SMESH_Gen_i::RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                             GEOM::GEOM_Object_ptr       theShape,
                                             SMESH::SMESH_Hypothesis_ptr theHyp)
 {
-  if (theStudy->_is_nil() || theMesh->_is_nil() ||
+  if (theMesh->_is_nil() ||
       theHyp->_is_nil() || (theShape->_is_nil()
                             && theMesh->HasShapeToMesh()))
     return false;
 
-  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theStudy, theHyp );
+  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theHyp );
   if ( aHypSO->_is_nil() )
     return false;
 
@@ -976,13 +972,13 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
 
   // Find a mesh or sub-mesh referring to theShape
   SALOMEDS::SObject_wrap aMeshOrSubMesh =
-    GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
+    GetMeshOrSubmeshByShape( theMesh, theShape );
   if ( aMeshOrSubMesh->_is_nil() )
     return false;
 
   // Find and remove a reference to aHypSO
   SALOMEDS::SObject_wrap aRef, anObj;
-  SALOMEDS::ChildIterator_wrap it = theStudy->NewChildIterator( aMeshOrSubMesh );
+  SALOMEDS::ChildIterator_wrap it = getStudyServant()->NewChildIterator( aMeshOrSubMesh );
   bool found = false;
   for ( it->InitEx( true ); ( it->More() && !found ); it->Next() ) {
     anObj = it->Value();
@@ -993,7 +989,7 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
     }
     if ( found )
     {
-      SALOMEDS::StudyBuilder_var builder = theStudy->NewBuilder();
+      SALOMEDS::StudyBuilder_var builder = getStudyServant()->NewBuilder();
       builder->RemoveObject( anObj );
     }
   }
@@ -1012,10 +1008,6 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
 
 void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters)
 {
-  SALOMEDS::Study_var aStudy = GetCurrentStudy();
-  if ( aStudy->_is_nil() )
-    return;
-
   // find variable names within theParameters
 
   myLastObj.clear();
@@ -1032,7 +1024,7 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
       if ( prevPos < pos )
       {
         string val( theParameters + prevPos, theParameters + pos );
-        if ( !aStudy->IsVariable( val.c_str() ))
+        if ( !getStudyServant()->IsVariable( val.c_str() ))
           val.clear();
         myLastParameters.push_back( val );
         nbVars += (! myLastParameters.back().empty() );
@@ -1054,14 +1046,14 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
   // (2) indices of found variables in myLastParamIndex.
 
   // remember theObject
-  SALOMEDS::SObject_wrap aSObj =  ObjectToSObject(aStudy,theObject);
+  SALOMEDS::SObject_wrap aSObj =  ObjectToSObject(theObject);
   if ( aSObj->_is_nil() )
     return;
   CORBA::String_var anObjEntry = aSObj->GetID();
   myLastObj = anObjEntry.in();
 
   // get a string of variable names
-  SALOMEDS::StudyBuilder_var   aStudyBuilder = aStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var   aStudyBuilder = getStudyServant()->NewBuilder();
   SALOMEDS::GenericAttribute_wrap     anAttr =
     aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString" );
   SALOMEDS::AttributeString_wrap aStringAttr = anAttr;
@@ -1130,15 +1122,11 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
 std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theObjectEntry) const
 {
   std::vector< std::string > varNames;
-  if ( myCurrentStudy->_is_nil() )
-    return varNames;
 
-  SALOMEDS::SObject_wrap aSObj = myCurrentStudy->FindObjectID( theObjectEntry.c_str() );
-  if ( myCurrentStudy->_is_nil() )
-    return varNames;
+  SALOMEDS::SObject_wrap aSObj = getStudyServant()->FindObjectID( theObjectEntry.c_str() );
 
   // get a string of variable names
-  SALOMEDS::StudyBuilder_var   aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var   aStudyBuilder = getStudyServant()->NewBuilder();
   SALOMEDS::GenericAttribute_wrap     anAttr =
     aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString" );
   SALOMEDS::AttributeString_wrap aStringAttr = anAttr;
@@ -1183,7 +1171,7 @@ std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theO
 //   //const char* aParameters = theParameters;
 // //   const char* aParameters = CORBA::string_dup(theParameters);
 //   TCollection_AsciiString anInputParams;
-//   SALOMEDS::Study_var aStudy = GetCurrentStudy();
+//   SALOMEDS::Study_var aStudy = getStudyServant();
 //   if( !aStudy->_is_nil() ) {
 // //     SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(theParameters);
 // //     for(int j=0;j<aSections->length();j++) {
@@ -1232,7 +1220,7 @@ char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject)
 {
   CORBA::String_var aResult("");
 
-  SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy, theObject );
+  SALOMEDS::SObject_wrap aSObj = ObjectToSObject( theObject );
   if ( !aSObj->_is_nil() )
   {
     SALOMEDS::GenericAttribute_wrap attr;
index d9c4b0961d208e34d40bcacc65d9bff6804a6e37..ef9ad77608468615d646e17fb2de594c76c5fb55 100644 (file)
@@ -150,9 +150,8 @@ void SMESH_GroupBase_i::SetName( const char* theName )
 
   // Update group name in a study
   SMESH_Gen_i*              aGen = myMeshServant->GetGen();
-  SALOMEDS::Study_var      aStudy = aGen->GetCurrentStudy();
   SMESH::SMESH_GroupBase_var aGrp = _this();
-  SALOMEDS::SObject_var      anSO = aGen->ObjectToSObject( aStudy, aGrp );
+  SALOMEDS::SObject_var      anSO = aGen->ObjectToSObject( aGrp );
   if ( !anSO->_is_nil() )
   {
     aGen->SetName( anSO, theName );
index b3e4e48325a354797167f1a2e8973ca85d028712..9b9779d68505ced3e554ecd12f1cc19695906ea0 100644 (file)
@@ -128,8 +128,7 @@ bool SMESH_Hypothesis_i::IsPublished()
   bool res = false;
   if ( SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen())
   {
-    SALOMEDS::Study_var study = gen->GetCurrentStudy();
-    SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( study, _this());
+    SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( _this());
     res = !SO->_is_nil();
   }
   return res;
index 85f1d01964e6fe6d89d8ed771132247748d4f6a4..ee8baec36a57907d6ee10f3fd5b1e015f4c0332f 100644 (file)
@@ -133,7 +133,6 @@ class SMESH_I_EXPORT GenericHypothesisCreator_i
 public:
   // Create a hypothesis
   virtual SMESH_Hypothesis_i* Create(PortableServer::POA_ptr thePOA,
-                                     int                     theStudyId,
                                      ::SMESH_Gen*            theGenImpl) = 0;
   virtual ~GenericHypothesisCreator_i() {}
 
@@ -153,10 +152,9 @@ template <class T> class HypothesisCreator_i: public GenericHypothesisCreator_i
 {
 public:
   virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA,
-                                      int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl)
   {
-    return new T (thePOA, theStudyId, theGenImpl);
+    return new T (thePOA, theGenImpl);
   };
 };
 
index 0ba74d70ffef6b3c0fb393d661c3a951ee6dbe9f..7cbef4f106184bf30b1b8de63a8dd8beda123100 100644 (file)
@@ -110,7 +110,7 @@ namespace MeshEditor_I {
     SMDSAbs_ElementType myPreviewType; // type to show
     //!< Constructor
     TPreviewMesh(SMDSAbs_ElementType previewElements = SMDSAbs_All) {
-      _isShapeToMesh = (_id =_studyId = 0);
+      _isShapeToMesh = (_id = 0);
       _myMeshDS  = new SMESHDS_Mesh( _id, true );
       myPreviewType = previewElements;
     }
@@ -5269,8 +5269,7 @@ SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::makeMesh(const char* theMeshName)
 {
   SMESH_Gen_i*              gen = SMESH_Gen_i::GetSMESHGen();
   SMESH::SMESH_Mesh_var    mesh = gen->CreateEmptyMesh();
-  SALOMEDS::Study_var     study = gen->GetCurrentStudy();
-  SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( study, mesh );
+  SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( mesh );
   gen->SetName( meshSO, theMeshName, "Mesh" );
   gen->SetPixMap( meshSO, "ICON_SMESH_TREE_MESH_IMPORTED");
 
index a075dadce83d21437eebba69f9bbb11eeac2a505..d030cbc93b99224c73319515e8f2002945bab70a 100644 (file)
@@ -104,14 +104,12 @@ int SMESH_Mesh_i::_idGenerator = 0;
 //=============================================================================
 
 SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
-                            SMESH_Gen_i*            gen_i,
-                            CORBA::Long             studyId )
+                            SMESH_Gen_i*            gen_i )
 : SALOME::GenericObj_i( thePOA )
 {
   _impl          = NULL;
   _gen_i         = gen_i;
   _id            = _idGenerator++;
-  _studyId       = studyId;
   _editor        = NULL;
   _previewEditor = NULL;
   _preMeshInfo   = NULL;
@@ -239,9 +237,7 @@ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
         for ( ; data != _geomGroupData.end(); ++data )
           if ( data->_smeshObject->_is_equivalent( _this() ))
           {
-            SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-            if ( study->_is_nil() ) break;
-            SALOMEDS::SObject_wrap so = study->FindObjectID( data->_groupEntry.c_str() );
+            SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( data->_groupEntry.c_str() );
             CORBA::Object_var     obj = _gen_i->SObjectToObject( so );
             aShapeObj = GEOM::GEOM_Object::_narrow( obj );
             break;
@@ -499,8 +495,7 @@ int SMESH_Mesh_i::ImportSTLFile( const char* theFileName )
   std::string name = _impl->STLToMesh( theFileName );
   if ( !name.empty() )
   {
-    SALOMEDS::Study_var     study = _gen_i->GetCurrentStudy();
-    SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( study, _this() );
+    SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( _this() );
     _gen_i->SetName( meshSO, name.c_str() );
   }
 
@@ -609,8 +604,7 @@ SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr       aSubShape,
   SMESH::SMESH_Mesh_var mesh( _this() );
   if ( !SMESH_Hypothesis::IsStatusFatal(status) )
   {
-    SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-    _gen_i->AddHypothesisToShape( study, mesh, aSubShape, anHyp );
+    _gen_i->AddHypothesisToShape( mesh, aSubShape, anHyp );
   }
   if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
 
@@ -695,8 +689,7 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Object_ptr aS
 
   if ( !SMESH_Hypothesis::IsStatusFatal(status) )
   {
-    SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-    _gen_i->RemoveHypothesisFromShape( study, mesh, aSubShape, anHyp );
+    _gen_i->RemoveHypothesisFromShape( mesh, aSubShape, anHyp );
   }
   // Update Python script
   if(_impl->HasShapeToMesh())
@@ -866,9 +859,8 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap
       subMesh = createSubMesh( aSubShape );
     if ( _gen_i->CanPublishInStudy( subMesh ))
     {
-      SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
       SALOMEDS::SObject_wrap aSO =
-        _gen_i->PublishSubMesh( study, aMesh, subMesh, aSubShape, theName );
+        _gen_i->PublishSubMesh( aMesh, subMesh, aSubShape, theName );
       if ( !aSO->_is_nil()) {
         // Update Python script
         TPythonDump() << aSO << " = " << aMesh << ".GetSubMesh( "
@@ -897,28 +889,25 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
     return;
 
   GEOM::GEOM_Object_var aSubShape;
-  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
-  if ( !aStudy->_is_nil() )  {
-    // Remove submesh's SObject
-    SALOMEDS::SObject_wrap anSO = _gen_i->ObjectToSObject( aStudy, theSubMesh );
-    if ( !anSO->_is_nil() ) {
-      long aTag = SMESH_Gen_i::GetRefOnShapeTag();
-      SALOMEDS::SObject_wrap anObj, aRef;
-      if ( anSO->FindSubObject( aTag, anObj.inout() ) &&
-           anObj->ReferencedObject( aRef.inout() ))
-      {
-        CORBA::Object_var obj = aRef->GetObject();
-        aSubShape = GEOM::GEOM_Object::_narrow( obj );
-      }
-      // if ( aSubShape->_is_nil() ) // not published shape (IPAL13617)
-      //   aSubShape = theSubMesh->GetSubShape();
+  // Remove submesh's SObject
+  SALOMEDS::SObject_wrap anSO = _gen_i->ObjectToSObject( theSubMesh );
+  if ( !anSO->_is_nil() ) {
+    long aTag = SMESH_Gen_i::GetRefOnShapeTag();
+    SALOMEDS::SObject_wrap anObj, aRef;
+    if ( anSO->FindSubObject( aTag, anObj.inout() ) &&
+         anObj->ReferencedObject( aRef.inout() ))
+    {
+      CORBA::Object_var obj = aRef->GetObject();
+      aSubShape = GEOM::GEOM_Object::_narrow( obj );
+    }
+    // if ( aSubShape->_is_nil() ) // not published shape (IPAL13617)
+    //   aSubShape = theSubMesh->GetSubShape();
 
-      SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder();
-      builder->RemoveObjectWithChildren( anSO );
+    SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
+    builder->RemoveObjectWithChildren( anSO );
 
-      // Update Python script
-      TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
-    }
+    // Update Python script
+    TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
   }
 
   if ( removeSubMesh( theSubMesh, aSubShape.in() ))
@@ -948,9 +937,8 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType
   if ( _gen_i->CanPublishInStudy( aNewGroup ) )
   {
     SMESH::SMESH_Mesh_var mesh = _this();
-    SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
     SALOMEDS::SObject_wrap aSO =
-      _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
+      _gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
     if ( !aSO->_is_nil())
       // Update Python script
       TPythonDump() << aSO << " = " << mesh << ".CreateGroup( "
@@ -985,9 +973,8 @@ SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementType    theElemType,
     if ( _gen_i->CanPublishInStudy( aNewGroup ) )
     {
       SMESH::SMESH_Mesh_var mesh = _this();
-      SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
       SALOMEDS::SObject_wrap aSO =
-        _gen_i->PublishGroup( study, mesh, aNewGroup, theGeomObj, theName );
+        _gen_i->PublishGroup( mesh, aNewGroup, theGeomObj, theName );
       if ( !aSO->_is_nil())
         TPythonDump() << aSO << " = " << mesh << ".CreateGroupFromGEOM( "
                       << theElemType << ", '" << theName << "', " << theGeomObj << " )";
@@ -1034,9 +1021,8 @@ SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType,
   if ( _gen_i->CanPublishInStudy( aNewGroup ) )
   {
     SMESH::SMESH_Mesh_var mesh = _this();
-    SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
     SALOMEDS::SObject_wrap aSO =
-      _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName );
+      _gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName );
 
     if ( !aSO->_is_nil())
       pd << aSO << " = " << mesh << ".CreateGroupFromFilter( "
@@ -1063,19 +1049,15 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
   if ( !aGroup )
     return;
 
-  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
-  if ( !aStudy->_is_nil() )
+  SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( theGroup );
+  if ( !aGroupSO->_is_nil() )
   {
-    SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
-    if ( !aGroupSO->_is_nil() )
-    {
-      // Update Python script
-      TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
+    // Update Python script
+    TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
 
-      // Remove group's SObject
-      SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder();
-      builder->RemoveObjectWithChildren( aGroupSO );
-    }
+    // Remove group's SObject
+    SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
+    builder->RemoveObjectWithChildren( aGroupSO );
   }
   aGroup->Modified(/*removed=*/true); // notify dependent Filter with FT_BelongToMeshGroup criterion
 
@@ -1836,14 +1818,13 @@ void SMESH_Mesh_i::addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj,
   if ( CORBA::is_nil( theGeomObj ) || theGeomObj->GetType() != GEOM_GROUP )
     return;
   // group SO
-  SALOMEDS::Study_var    study   = _gen_i->GetCurrentStudy();
-  SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study, theGeomObj );
+  SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( theGeomObj );
   if ( groupSO->_is_nil() )
     return;
   // group indices
   GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
   GEOM::GEOM_IGroupOperations_wrap groupOp =
-    geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
+    geomGen->GetIGroupOperations();
   GEOM::ListOfLong_var ids = groupOp->GetObjects( theGeomObj );
 
   // store data
@@ -1891,9 +1872,7 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
   TopoDS_Shape newShape;
 
   // get geom group
-  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-  if ( study->_is_nil() ) return newShape; // means "not changed"
-  SALOMEDS::SObject_wrap groupSO = study->FindObjectID( groupData._groupEntry.c_str() );
+  SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( groupData._groupEntry.c_str() );
   if ( !groupSO->_is_nil() )
   {
     CORBA::Object_var groupObj = _gen_i->SObjectToObject( groupSO );
@@ -1904,7 +1883,7 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
     set<int> curIndices;
     GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
     GEOM::GEOM_IGroupOperations_wrap groupOp =
-      geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
+      geomGen->GetIGroupOperations();
     GEOM::ListOfLong_var   ids = groupOp->GetObjects( geomGroup );
     for ( CORBA::ULong i = 0; i < ids->length(); ++i )
       curIndices.insert( ids[i] );
@@ -1969,9 +1948,6 @@ void SMESH_Mesh_i::CheckGeomModif()
 {
   if ( !_impl->HasShapeToMesh() ) return;
 
-  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-  if ( study->_is_nil() ) return;
-
   GEOM::GEOM_Object_var mainGO = _gen_i->ShapeToGeomObject( _impl->GetShapeToMesh() );
   //if ( mainGO->_is_nil() ) return;
 
@@ -2118,9 +2094,6 @@ void SMESH_Mesh_i::CheckGeomGroupModif()
 {
   if ( !_impl->HasShapeToMesh() ) return;
 
-  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-  if ( study->_is_nil() ) return;
-
   CORBA::Long nbEntities = NbNodes() + NbElements();
 
   // Check if group contents changed
@@ -2307,7 +2280,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif()
         if ( _mapGroups.find( oldID ) == _mapGroups.end() )
           continue;
         // get group name
-        SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study,_mapGroups[oldID] );
+        SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( _mapGroups[oldID] );
         CORBA::String_var      name    = groupSO->GetName();
         // update
         SMESH_GroupBase_i*  group_i    = SMESH::DownCast<SMESH_GroupBase_i*>(_mapGroups[oldID] );
@@ -2328,15 +2301,15 @@ void SMESH_Mesh_i::CheckGeomGroupModif()
   if ( newNbEntities != nbEntities )
   {
     // Add all SObjects with icons to soToUpdateIcons
-    soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, _this() )); // mesh
+    soToUpdateIcons.push_back( _gen_i->ObjectToSObject( _this() )); // mesh
 
     for (map<int, SMESH::SMESH_subMesh_ptr>::iterator i_sm = _mapSubMeshIor.begin();
          i_sm != _mapSubMeshIor.end(); ++i_sm ) // submeshes
-      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_sm->second ));
+      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( i_sm->second ));
 
     for ( map<int, SMESH::SMESH_GroupBase_ptr>::iterator i_gr = _mapGroups.begin();
           i_gr != _mapGroups.end(); ++i_gr ) // groups
-      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_gr->second ));
+      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( i_gr->second ));
   }
 
   list< SALOMEDS::SObject_wrap >::iterator so = soToUpdateIcons.begin();
@@ -2382,10 +2355,10 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase
 
   SALOMEDS::StudyBuilder_var builder;
   SALOMEDS::SObject_wrap     aGroupSO;
-  SALOMEDS::Study_var        aStudy = _gen_i->GetCurrentStudy();
+  SALOMEDS::Study_var        aStudy = SMESH_Gen_i::getStudyServant();
   if ( !aStudy->_is_nil() ) {
     builder  = aStudy->NewBuilder();
-    aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
+    aGroupSO = _gen_i->ObjectToSObject( theGroup );
     if ( !aGroupSO->_is_nil() )
     {
       // remove reference to geometry
@@ -2706,17 +2679,6 @@ CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
   return _id;
 }
 
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
-{
-  return _studyId;
-}
-
 //=============================================================================
 namespace
 {
@@ -2976,9 +2938,9 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char*    file,
   // Perform Export
   PrepareForWriting(file, overwrite);
   string aMeshName = "Mesh";
-  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
+  SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
   if ( !aStudy->_is_nil() ) {
-    SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( aStudy, _this() );
+    SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject(  _this() );
     if ( !aMeshSO->_is_nil() ) {
       CORBA::String_var name = aMeshSO->GetName();
       aMeshName = name;
@@ -3151,8 +3113,7 @@ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii)
                 << ".ExportSTL( r'" << file << "', " << isascii << " )";
 
   CORBA::String_var name;
-  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, _this() );
+  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( _this() );
   if ( !so->_is_nil() )
     name = so->GetName();
 
@@ -3234,14 +3195,12 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
 
     PrepareForWriting(file, overwrite);
 
-    SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
-    if ( !aStudy->_is_nil() ) {
-      SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( aStudy, meshPart );
-      if ( !SO->_is_nil() ) {
-        CORBA::String_var name = SO->GetName();
-        aMeshName = name;
-      }
+    SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( meshPart );
+    if ( !SO->_is_nil() ) {
+      CORBA::String_var name = SO->GetName();
+      aMeshName = name;
     }
+
     SMESH_MeshPartDS* partDS = new SMESH_MeshPartDS( meshPart );
     _impl->ExportMED( file, aMeshName.c_str(), auto_groups,
                       version, partDS, autoDimension, /*addODOnVertices=*/have0dField);
@@ -3608,8 +3567,7 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart,
   PrepareForWriting(file);
 
   CORBA::String_var name;
-  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
+  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( meshPart );
   if ( !so->_is_nil() )
     name = so->GetName();
 
@@ -3639,8 +3597,7 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart,
   PrepareForWriting(file,overwrite);
 
   std::string meshName("");
-  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
-  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
+  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( meshPart );
   if ( !so->_is_nil() )
   {
     CORBA::String_var name = so->GetName();
@@ -4771,6 +4728,35 @@ CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes)
   return elemID;
 }
 
+//================================================================================
+/*!
+ * \brief Return elements including all given nodes.
+ */
+//================================================================================
+
+SMESH::long_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::long_array& nodes,
+                                                    SMESH::ElementType       elemType)
+{
+  if ( _preMeshInfo )
+    _preMeshInfo->FullLoadFromFile();
+
+  SMESH::long_array_var result = new SMESH::long_array();
+
+  if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
+  {
+    vector< const SMDS_MeshNode * > nn( nodes.length() );
+    for ( CORBA::ULong i = 0; i < nodes.length(); ++i )
+      nn[i] = mesh->FindNode( nodes[i] );
+
+    std::vector<const SMDS_MeshElement *> elems;
+    mesh->GetElementsByNodes( nn, elems, (SMDSAbs_ElementType) elemType );
+    result->length( elems.size() );
+    for ( size_t i = 0; i < elems.size(); ++i )
+      result[i] = elems[i]->GetID();
+  }
+  return result._retn();
+}
+
 //=============================================================================
 /*!
  * Returns true if given element is polygon
@@ -4949,10 +4935,9 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int         theSubShapeID,
         groups[ ++iG ] = createGroup( SMESH::ElementType(i), theGroupName );
         if ( _gen_i->CanPublishInStudy( groups[ iG ] ))
         {
-          SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
           SMESH::SMESH_Mesh_var mesh = _this();
           SALOMEDS::SObject_wrap aSO =
-            _gen_i->PublishGroup( study, mesh, groups[ iG ],
+            _gen_i->PublishGroup( mesh, groups[ iG ],
                                  GEOM::GEOM_Object::_nil(), theGroupName);
         }
         SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( groups[ iG ]);
@@ -4976,7 +4961,6 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int         theSubShapeID,
 
 void SMESH_Mesh_i::CreateGroupServants()
 {
-  SALOMEDS::Study_var  aStudy = _gen_i->GetCurrentStudy();
   SMESH::SMESH_Mesh_var aMesh = _this();
 
   set<int> addedIDs;
@@ -5013,10 +4997,8 @@ void SMESH_Mesh_i::CreateGroupServants()
     else        { nextId = 0; } // avoid "unused variable" warning in release mode
 
     // publishing the groups in the study
-    if ( !aStudy->_is_nil() ) {
-      GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
-      _gen_i->PublishGroup( aStudy, aMesh, groupVar, shapeVar, group->GetName());
-    }
+    GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
+    _gen_i->PublishGroup( aMesh, groupVar, shapeVar, group->GetName());
   }
   if ( !addedIDs.empty() )
   {
@@ -5082,10 +5064,6 @@ void SMESH_Mesh_i::checkGroupNames()
   int nbGrp = NbGroups();
   if ( !nbGrp )
     return;
-
-  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
-  if ( aStudy->_is_nil() )
-    return; // nothing to do
   
   SMESH::ListOfGroups* grpList = 0;
   // avoid dump of "GetGroups"
@@ -5099,7 +5077,7 @@ void SMESH_Mesh_i::checkGroupNames()
     SMESH::SMESH_GroupBase_ptr aGrp = (*grpList)[ gIndx ];
     if ( !aGrp )
       continue;
-    SALOMEDS::SObject_wrap aGrpSO = _gen_i->ObjectToSObject( aStudy, aGrp );
+    SALOMEDS::SObject_wrap aGrpSO = _gen_i->ObjectToSObject( aGrp );
     if ( aGrpSO->_is_nil() )
       continue;
     // correct name of the mesh group if necessary
@@ -5142,15 +5120,12 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
   SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
   if(gen) {
     CORBA::String_var aParameters = GetParameters();
-    SALOMEDS::Study_var    aStudy = gen->GetCurrentStudy();
-    if ( !aStudy->_is_nil()) {
-      SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters); 
-      if ( aSections->length() > 0 ) {
-        SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
-        aResult->length( aVars.length() );
-        for ( CORBA::ULong i = 0;i < aVars.length(); i++ )
-          aResult[i] = CORBA::string_dup( aVars[i] );
-      }
+    SALOMEDS::ListOfListOfStrings_var aSections = SMESH_Gen_i::getStudyServant()->ParseVariables(aParameters);
+    if ( aSections->length() > 0 ) {
+      SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
+      aResult->length( aVars.length() );
+      for ( CORBA::ULong i = 0;i < aVars.length(); i++ )
+        aResult[i] = CORBA::string_dup( aVars[i] );
     }
   }
   return aResult._retn();
index 8aaa79bae4201174e2019ce25b9c2f7b2d427c81..f4c2cf71bd39102befbf3a2443efac78d45f64ea 100644 (file)
@@ -59,8 +59,7 @@ class SMESH_I_EXPORT SMESH_Mesh_i:
   SMESH_Mesh_i(const SMESH_Mesh_i&);
 public:
   SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
-                SMESH_Gen_i*            myGen_i,
-                CORBA::Long             studyId );
+                SMESH_Gen_i*            myGen_i );
 
   virtual ~SMESH_Mesh_i();
 
@@ -185,8 +184,6 @@ public:
 
   CORBA::Long GetId() throw (SALOME::SALOME_Exception);
 
-  CORBA::Long GetStudyId() throw (SALOME::SALOME_Exception);
-
   // --- C++ interface
 
   void SetImpl(::SMESH_Mesh* impl);
@@ -536,8 +533,8 @@ public:
    * Returns true if given node is medium node
    * in one of quadratic elements
    */
-  CORBA::Boolean IsMediumNodeOfAnyElem(CORBA::Long idn,
-                                       SMESH::ElementType theElemType);
+  CORBA::Boolean IsMediumNodeOfAnyElem(CORBA::Long        idn,
+                                       SMESH::ElementType elemType);
 
   /*!
    * Returns number of edges for given element
@@ -563,6 +560,12 @@ public:
    */
   CORBA::Long FindElementByNodes(const SMESH::long_array& nodes);
 
+  /*!
+   * Return elements including all given nodes.
+   */
+  SMESH::long_array* GetElementsByNodes(const SMESH::long_array& nodes,
+                                        SMESH::ElementType       elemType);
+
   /*!
    * Returns true if given element is polygon
    */
@@ -697,7 +700,6 @@ private:
   ::SMESH_Mesh* _impl;        // :: force no namespace here
   SMESH_Gen_i*  _gen_i;
   int           _id;          // id given by creator (unique within the creator instance)
-  int           _studyId;
   std::map<int, SMESH::SMESH_subMesh_ptr>    _mapSubMeshIor;
   std::map<int, SMESH::SMESH_GroupBase_ptr>  _mapGroups;
   std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;
index e4deee310cd1452ca5f53878725df143bdb6ac09..2b282b8d4549110011627dbdd993aa010b16e176 100644 (file)
@@ -707,8 +707,7 @@ void SMESH_NoteBook::ReplaceVariables()
         // dumped calls due to the fix of
         // issue 0021364:: Dump of netgen parameters has duplicate lines
         SMESH_Gen_i *          aGen = SMESH_Gen_i::GetSMESHGen();
-        SALOMEDS::Study_var  aStudy = aGen->GetCurrentStudy();
-        SALOMEDS::SObject_wrap sobj = aStudy->FindObjectID( (*it).first.ToCString() );
+        SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( (*it).first.ToCString() );
         CORBA::Object_var       obj = aGen->SObjectToObject( sobj );
         if ( SMESH_Hypothesis_i* h = SMESH::DownCast< SMESH_Hypothesis_i*>( obj ))
         {
@@ -745,7 +744,7 @@ void SMESH_NoteBook::InitObjectMap()
   if(!aGen)
     return;
   
-  SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy();
+  SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
   if(aStudy->_is_nil())
     return;
   
@@ -954,11 +953,7 @@ bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double&
 {
   bool ok = false;
 
-  SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
-  if(!aGen)
-    return ok;
-
-  SALOMEDS::Study_ptr aStudy = aGen->GetCurrentStudy();
+  SALOMEDS::Study_ptr aStudy = SMESH_Gen_i::getStudyServant();
   if(aStudy->_is_nil())
     return ok;
 
index 3d8980ff9a3751a9efc1b144ceb9b4ba705bcf1d..e11046e1b4a459a0c4b8e4fc322abfc3ad288378 100644 (file)
@@ -63,8 +63,8 @@ namespace
 {
   enum {  GroupOnFilter_OutOfDate = -1 };
 
-  // a map to count not yet loaded meshes 
-  static std::map< int, int > theStudyIDToMeshCounter;
+  // count not yet loaded meshes
+  static int theMeshCounter = 0;
 
   //================================================================================
   /*!
@@ -74,9 +74,7 @@ namespace
 
   void meshInfoLoaded( SMESH_Mesh_i* mesh )
   {
-    std::map< int, int >::iterator id2counter =
-      theStudyIDToMeshCounter.insert( std::make_pair( (int) mesh->GetStudyId(), 0 )).first;
-    id2counter->second++;
+    theMeshCounter++;
   }
   //================================================================================
   /*!
@@ -88,18 +86,18 @@ namespace
                          std::string   medFile,
                          std::string   hdfFile)
   {
-    if ( --theStudyIDToMeshCounter[ (int) mesh->GetStudyId() ] == 0 )
+    if ( --theMeshCounter == 0 )
     {
       std::string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
 
-      SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
-      aFiles->length(2);
+      SALOMEDS_Tool::ListOfFiles aFiles;
+      aFiles.reserve(2);
       medFile = SALOMEDS_Tool::GetNameFromPath( medFile ) + ".med";
       hdfFile = SALOMEDS_Tool::GetNameFromPath( hdfFile ) + ".hdf";
-      aFiles[0] = medFile.c_str();
-      aFiles[1] = hdfFile.c_str();
+      aFiles.push_back(medFile.c_str());
+      aFiles.push_back(hdfFile.c_str());
 
-      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles.in(), true );
+      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles, true );
     }
   }
 
@@ -117,25 +115,22 @@ namespace
     SignalToGUI( SMESH_Mesh_i* mesh )
     {
       SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
-      SALOMEDS::Study_var study = gen->GetCurrentStudy();
-      if ( !study->_is_nil() && study->StudyId() == mesh->GetStudyId() )
+
+      SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( mesh->_this() );
+      CORBA::Object_var        obj = gen->GetNS()->Resolve( "/Kernel/Session" );
+      _session = SALOME::Session::_narrow( obj );
+      if ( !meshSO->_is_nil() && !_session->_is_nil() )
       {
-        SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject(study, mesh->_this() );
-        CORBA::Object_var        obj = gen->GetNS()->Resolve( "/Kernel/Session" );
-        _session = SALOME::Session::_narrow( obj );
-        if ( !meshSO->_is_nil() && !_session->_is_nil() )
-        {
-          CORBA::String_var meshEntry = meshSO->GetID();
-          _messagePrefix = "SMESH/mesh_loading/";
-          _messagePrefix += meshEntry.in();
+        CORBA::String_var meshEntry = meshSO->GetID();
+        _messagePrefix = "SMESH/mesh_loading/";
+        _messagePrefix += meshEntry.in();
 
-          std::string msgToGUI = _messagePrefix + "/";
-          msgToGUI += SMESH_Comment( mesh->NbNodes() );
-          msgToGUI += "/";
-          msgToGUI += SMESH_Comment( mesh->NbElements() );
+        std::string msgToGUI = _messagePrefix + "/";
+        msgToGUI += SMESH_Comment( mesh->NbNodes() );
+        msgToGUI += "/";
+        msgToGUI += SMESH_Comment( mesh->NbElements() );
 
-          _session->emitMessageOneWay( msgToGUI.c_str());
-        }
+        _session->emitMessageOneWay( msgToGUI.c_str());
       }
     }
     void sendStop()
@@ -1225,10 +1220,9 @@ bool SMESH_PreMeshInfo::IsMeshInfoCorrect() const
 
 void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp)
 {
-  SALOMEDS::Study_var study = smeshComp->GetStudy();
-  if ( theStudyIDToMeshCounter[ (int) study->StudyId() ] > 0 )
+  if ( theMeshCounter > 0 )
   {
-    SALOMEDS::ChildIterator_wrap itBig = study->NewChildIterator( smeshComp );
+    SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( smeshComp );
     for ( ; itBig->More(); itBig->Next() ) {
       SALOMEDS::SObject_wrap gotBranch = itBig->Value();
       CORBA::Object_var       anObject = SMESH_Gen_i::SObjectToObject( gotBranch );
index 52baab3035244f082942031af4abba8771853635..f4ea8834461768ace7701a5391f50a070d2c4d9c 100644 (file)
@@ -69,7 +69,6 @@ public:
                 Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
                 Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                 std::set< TCollection_AsciiString >&      theRemovedObjIDs,
-                SALOMEDS::Study_ptr&                      theStudy,
                 const bool                                theHistoricalDump);
 
   /*!
index 1b82fa5deec0f658993e846e06e8d57c98717b2c..c80998ee94c76d0960779659ab3878558bdf5fe1 100644 (file)
@@ -77,12 +77,12 @@ class SMeshStudyTools:
 
     ## This function updates the tools so that it works on the
     #  specified study.
-    def updateStudy(self, studyId=None):
+    def updateStudy(self):
         """
         This function updates the tools so that it works on the
         specified study.
         """
-        self.editor = getStudyEditor(studyId)
+        self.editor = getStudyEditor()
 
     ## Get the mesh item owning the mesh group \em meshGroupItem.
     #  \param  meshGroupItem (SObject) mesh group belonging to the searched mesh.
@@ -125,7 +125,7 @@ class SMeshStudyTools:
             return None
         import SMESH
         from salome.smesh import smeshBuilder
-        smesh = smeshBuilder.New(self.editor.study)
+        smesh = smeshBuilder.New()
 
         meshObject=salome.IDToObject(entry)
         return smesh.Mesh( meshObject )
@@ -183,17 +183,16 @@ class SMeshStudyTools:
 
 
 def TEST_createBoxMesh():
-    theStudy = helper.getActiveStudy()
     
     import GEOM
     from salome.geom import geomBuilder
-    geompy = geomBuilder.New(theStudy)
+    geompy = geomBuilder.New()
     
     box = geompy.MakeBoxDXDYDZ(200, 200, 200)
 
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
-    smesh = smeshBuilder.New(theStudy
+    smesh = smeshBuilder.New() 
 
     from salome.StdMeshers import StdMeshersBuilder
     boxmesh = smesh.Mesh(box)
@@ -207,7 +206,7 @@ def TEST_createBoxMesh():
 
     smesh.SetName(boxmesh.GetMesh(), 'boxmesh')
     if salome.sg.hasDesktop():
-        salome.sg.updateObjBrowser(True)
+        salome.sg.updateObjBrowser()
 
 #
 # Definitions:
index 057506db66b0918727a85fc8d51781c0741c893f..b57d2b4df013123244a214cd3778232480c501b2 100644 (file)
@@ -22,8 +22,6 @@
 # scripts / static
 SET(_bin_SCRIPTS
   smesh.py
-  batchmode_smesh.py
-  batchmode_mefisto.py
   ex00_all.py
   ex01_cube2build.py
   ex02_cube2primitive.py
index 5cb4dfed0379a1022021b749d3ada1abf6f52431..2bb4d9ecfafb05fb75d63ba200673ae82ee2b0cd 100755 (executable)
@@ -25,11 +25,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 #-----------------------------GEOM----------------------------------------
@@ -103,5 +103,5 @@ print("---------------------Compute the mesh")
 ret = mesh.Compute()
 print(ret)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
index a627b543cc78cc65d85e0c99c40f1b6cfc07c663..4f7866cb6f932ce82ff458d85ab847911d54dee2 100755 (executable)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 #----------------------------------GEOM
@@ -81,4 +81,4 @@ mesh2.Compute()
 
 
 # ---- udate object browser
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 5611f172ed11b6935059ba31a4c66a0bd1fe153b..2485546461c8ce4816fd17e3cd95554949fb1226 100755 (executable)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # create points to build two circles
@@ -90,4 +90,4 @@ mesh1.Compute()
 mesh2.Compute()
 
 # ---- update object browser
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 3732428312915fe4033af85abb88d851389b526c..c390c7ec7c550fa985476a8f9a0c29b565fb2622 100644 (file)
@@ -25,11 +25,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -217,4 +217,4 @@ for i in range(0,nbrs):
     oldnodes = newnodes
     pass
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 0bffff8507f5714d3c83d96d00b9e7edb6bc83c9..04e6fc24488518be62f8af4c7ec549d93959e1b8 100644 (file)
@@ -63,4 +63,4 @@ print("anIds = ", anIds)
 #anIds = CheckBelongToGeomFilterOld(smesh,mesh.GetMesh(),box,box,anElemType)
 #print "anIds = ", anIds
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 4a197353f142083b2f1e422d601a5a83b501cb60..d6b8ec64b5926a14915d074959d29196a0e8a333 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 ## create a bottom box
 Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
@@ -104,4 +104,4 @@ Compound2 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e
 smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
 #end
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index b0e936b19b7afb223153382a5f2b0a052740889a..4383ab44790b8292afc1285cc5fb0b6f8d12202a 100644 (file)
@@ -47,4 +47,4 @@ geompy.addToStudy(aGeomGroup2, "Group on Edges")
 aSmeshGroup1 = mesh.GroupOnGeom(aGeomGroup1, "SMESHGroup1", SMESH.FACE)
 aSmeshGroup2 = mesh.GroupOnGeom(aGeomGroup2, "SMESHGroup2", SMESH.EDGE)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 0d9be36d3f7ac9b12b05a854f9de02917b9087f0..6d21e8fb804f12b13f43eebc2ad1b1210bd08ecd 100755 (executable)
@@ -74,4 +74,4 @@ mesh.Compute()
 print("aGroupOnShell size =", aGroupOnShell.Size())
 print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 4d7f05901b0b64d63379d94587c98facc5429fc7..f0e56293d43456aef9f2ca08550437efcf0f21ed 100644 (file)
@@ -47,4 +47,4 @@ BuildGroupLyingOn(mesh.GetMesh(), SMESH.FACE, "Group of faces lying on edge #1",
 # Second way
 mesh.MakeGroup("Group of faces lying on edge #2", SMESH.FACE, SMESH.FT_LyingOnGeom, edge)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 32330467488ad838552751907e79e7749f17d05d..77055838d17dc6b53488d6bff1c3ce206fe976fe 100755 (executable)
@@ -30,11 +30,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import os
 import math
@@ -158,4 +158,4 @@ print("Number of quadrangles : ", mesh.NbQuadrangles())
 print("Number of volumes     : ", mesh.NbVolumes())
 print("Number of tetrahedrons: ", mesh.NbTetras())
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 0b6b9824588969a18058a2c1afc77df161d8a919..c12165c0dd60815b84c143d3932469af60ab06b5 100644 (file)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 from math import sqrt
 
@@ -43,7 +43,7 @@ from math import sqrt
 barier_height = 7.0
 barier_radius = 5.6 / 2 # Rayon de la bariere
 colis_radius = 1.0 / 2  # Rayon du colis
-colis_step = 2.0        # Distance s\89parant deux colis
+colis_step = 2.0        # Distance s�parant deux colis
 cc_width = 0.11         # Epaisseur du complement de colisage
 
 # --
@@ -184,4 +184,4 @@ if ret != 0:
 else:
     print("problem when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index faadf285e73105204d0242a298bab114e9cd1929..be5e1e24e727528776d14ca1659d28ce129f9b68 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -118,4 +118,4 @@ my_hexa.Quadrangle()
 my_hexa.Hexahedron()
 my_hexa.Compute()
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index b8a4707e33ade879b411df1acbe2bed645f4a1b3..4d25b4a968c5f50fcbd3aab255de69bd149b2509 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -46,4 +46,4 @@ isMeshTest   = 1 # True
 
 GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 1d486f24a5f1c8efdb1687bb94dbd2f0e9600166..e7a8947264932abefe3e8d95b1336fd4c2aeab6c 100755 (executable)
@@ -34,11 +34,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 from salome import sg
 
@@ -70,4 +70,4 @@ alg3D.SetName("algo3D")
 
 box_mesh.Compute()
 
-sg.updateObjBrowser(True)
+sg.updateObjBrowser()
index f8b123616ddc969a1ef714a4900265b389ac4915..bab8d4abb796f0ca2f86a0b97112eb7f3d6e1a48 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # ---- define 2 boxes box1 and box2
@@ -138,4 +138,4 @@ if ret != 0:
 else:
     print("probleme when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 55e0475838d5cea49e49f1c69f1358cc2d595442..5f521343890c7e131c9ec5e5155c2ef41a7e157b 100644 (file)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---- define 3 boxes box1, box2 and box3
 
@@ -148,4 +148,4 @@ if ret != 0:
 else:
     print("probleme when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index d2e6c8e711c8cb76b06d7d6a5722a04a7ad3e444..f4b257c87ac59f0062f9f0393a1d0156d12ba3f2 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---- define a boxe
 
@@ -107,4 +107,4 @@ if ret != 0:
 else:
     print("probleme when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index f7479da0822cf802bd27bec3fef0e12f85b255b1..871ee0913baebc65d314025ef0313ae4cb93a516 100644 (file)
@@ -30,7 +30,7 @@ import SMESH_mechanic
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 mesh = SMESH_mechanic.mesh
 
 # ---- Criterion : AREA > 100
@@ -141,4 +141,4 @@ print("Criterion: Element Diameter 2D > 10 Nb = ", len( anIds ))
   #print anIds[ i ]
 
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 604f21714e0e13987d2bfc855693366541a8788e..68558d27ce1002edd90dd6447d04531a1c033d4b 100755 (executable)
@@ -36,11 +36,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -131,7 +131,7 @@ for i in range(8):
     idEdgeZ.append(geompy.addToStudyInFather(vol,edgeZ[i],"EdgeZ"+str(i+1)))
 
 ### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 # ---- init a Mesh with the volume
 
@@ -176,7 +176,7 @@ for i in range(8):
     smesh.SetName(algo.GetSubMesh(), "SubMeshEdgeZ_"+str(i+1))
   
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
 print("-------------------------- compute the mesh of the volume")
 
@@ -197,4 +197,4 @@ if ret != 0:
 else:
     print("problem when Computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 6462381c2aefc89f574d6a28d66ca895251aec47..b4a4f72244291ad4b164e37452c5d3e275b91dfb 100644 (file)
@@ -30,7 +30,7 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import math
 
index 32eb83eb5564cd26a8554d25014899e871ef93bc..076e13bf264fcc1fd5b5fb1eed919d336f7f961c 100644 (file)
@@ -30,7 +30,7 @@ import SMESH_fixation
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 compshell = SMESH_fixation.compshell
 idcomp = SMESH_fixation.idcomp
@@ -50,7 +50,7 @@ status = geompy.CheckShape(compshell)
 print(" check status ", status)
 
 ### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 # ---- init a Mesh with the compshell
 shape_mesh = salome.IDToObject( idcomp  )
@@ -99,4 +99,4 @@ if ret != 0:
 else:
     print("problem when Computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index c8c00f67fc0da85e058463ab9655a369fb49eeae..ec532d57f7bb69714dbb6a1a422b52cc211f8792 100644 (file)
@@ -30,7 +30,7 @@ import SMESH_fixation
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 compshell = SMESH_fixation.compshell
 idcomp = SMESH_fixation.idcomp
@@ -50,7 +50,7 @@ status = geompy.CheckShape(compshell)
 print(" check status ", status)
 
 ### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 print("-------------------------- create Mesh, algorithm, hypothesis")
 
@@ -76,4 +76,4 @@ if ret != 0:
 else:
     print("problem when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index d01119d5a2bcd3b917e93ba784208e9e94a8ccf5..ecbd2988354ec3f2823f4f6f8b85d594d4b352c1 100644 (file)
@@ -30,7 +30,7 @@ import SMESH_fixation
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 compshell = SMESH_fixation.compshell
 idcomp = SMESH_fixation.idcomp
@@ -50,7 +50,7 @@ status = geompy.CheckShape(compshell)
 print(" check status ", status)
 
 ### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 # ---- init a Mesh with the compshell
 
@@ -123,4 +123,4 @@ if ret != 0:
 else:
     print("problem when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 144a9fab95bb31ecd56fa11b28c14972768306f8..05d1f94f920c11dbc2073ee5d7bfe95969d87baa 100644 (file)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # ---------------------------- GEOM --------------------------------------
@@ -62,7 +62,7 @@ print("number of Edges  in flight : ", len(subEdgeList))
 
 
 ### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 # ---- init a Mesh with the shell
 shape_mesh = salome.IDToObject( idShape )
@@ -107,4 +107,4 @@ if ret != 0:
 else:
     print("probleme when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 6422701aba11325187418a16c8ff18a8fdf8ea59..709e27dad4bc1ea26000c5af53b6e82e70ac3711 100644 (file)
@@ -25,11 +25,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # Create box without one plane
@@ -48,7 +48,7 @@ idbox = geompy.addToStudy( aBox, "box" )
 aBox  = salome.IDToObject( idbox )
 
 # Create mesh
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 mesh = smesh.Mesh(aBox, "Mesh_freebord")
 
@@ -75,4 +75,4 @@ print("Criterion: Free edges Nb = ", len( anIds ))
 for i in range( len( anIds ) ):
   print(anIds[ i ])
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 0373a57f46ede524f3e795ad4862f3a9b2590e5a..5dd1d8f9e0d67f764619137c1ee1e57eded2d80b 100755 (executable)
@@ -24,11 +24,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # -----------------------------------------------------------------------------
 
@@ -58,12 +58,12 @@ idblob = geompy.addToStudy(blob,"blob")
 edgeGroups = geompy.Propagate( blob )
 assert len( edgeGroups ) == 3
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
 # -----------------------------------------------------------------------------
 
 print("-------------------------- mesh")
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 # ---- define a mesh on the geom shape 'blob'
 mesh=smesh.Mesh(blob, "MeshBlob")
@@ -98,4 +98,4 @@ if ok:
 else:
     print("problem when Computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index f74a37208925ebe8d798b8e69415c7d9f65207df..d09e9e78b0a1611f8880467587f6e86378e93dd9 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 from salome.StdMeshers import StdMeshersBuilder
 
@@ -127,7 +127,7 @@ name      = geompy.SubShapeName( sub_face4, mechanic )
 Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
 
 # ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 # -- Init --
 shape_mesh = salome.IDToObject( Id_mechanic )
@@ -188,4 +188,4 @@ print("Number of quadrangles : ", mesh.NbQuadrangles())
 print("Number of volumes     : ", mesh.NbVolumes())
 print("Number of tetrahedrons: ", mesh.NbTetras())
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 7398542300993a02fe000ec5bd787c0490bed44c..de61281744052262228bd3f267436e42a13e7d6f 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---------------------------- GEOM --------------------------------------
 
@@ -234,4 +234,4 @@ mesh.RotationSweepObject(GroupRotate, axisXYZ, angle45, 4, 1e-5)
 #9 reorientation of the submesh1
 mesh.ReorientObject(submesh1)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 388d42e3c3e9d0d350d571610032ba73f46f42f2..5c0c5cefb2d019298269b79c7c8b7b08a9b7ee7a 100644 (file)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---------------------------- GEOM --------------------------------------
 
@@ -135,4 +135,4 @@ if ret != 0:
 else:
     print("problem when computing the mesh")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 284da9268696b4eed9b919db0d0a44613c2d84fc..dc0fdafb2670037d28d1ef85046986b88a9eb900 100644 (file)
@@ -30,11 +30,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---------------------------- GEOM --------------------------------------
 
@@ -158,4 +158,4 @@ print("Number of quadrangles: ", mesh.NbQuadrangles())
 print("Number of volumes     : ", mesh.NbVolumes())
 print("Number of tetrahedrons: ", mesh.NbTetras())
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 2c5aa2465697d6f7cb197de63ffb7a86f5750ef2..80322918cd2a85c973d217654e2aaa0cb849dde1 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 from salome.StdMeshers import StdMeshersBuilder
 
@@ -60,12 +60,12 @@ for f in subShapeList:
   print(name)
   idedge.append( geompy.addToStudyInFather(box, f, name) )
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
 # ---- launch SMESH
 smeshgui = salome.ImportComponentGUI("SMESH")
-smeshgui.Init(salome.myStudyId)
-smesh.SetCurrentStudy(salome.myStudy)
+smeshgui.Init()
+smesh.UpdateStudy()
 
 # ---- Creating meshes
 
@@ -115,5 +115,5 @@ algo = mesh.Triangle()
 algo.MaxElementArea(2500)
 
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
index 0de27458593a11eefc082313469706b68c97ce49..a642a670d8d59ef8210875b87b595e2be1ace887 100644 (file)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---- define a box
 
@@ -63,7 +63,7 @@ ide = geompy.addToStudyInFather(face, edge, name)
 
 # ---- SMESH
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 box = salome.IDToObject(idb)
 mesh = smesh.Mesh(box, "Meshbox")
 
@@ -147,4 +147,4 @@ for a in log:
             ii = ii+1
             print("AddTriangle %i - %i %i %i" % (ind, i1, i2, i3))
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index bc70c54d951bf3c714ff9d132ddc11bdf09a7238..1950f309701bf6ce5bbb52e4b9866ca704b8a9af 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---- define a box
 
@@ -63,4 +63,4 @@ name = geompy.SubShapeName(edge, face)
 print(name)
 idedge = geompy.addToStudyInFather(face, edge, name)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index d9c6f179fb2aea12b62d0e093fa5e46b66474976..caa0fa39df03ebbb0c33be6f41cc4a6fd69cb88b 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---- define a box
 
@@ -110,4 +110,4 @@ print(hypArea2.GetMaxElementArea())
 smesh.SetName(hypArea2, "MaxElementArea_500")
 
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 72fbb578a0459e945468fe38392aa6d6358649a3..b8f54fd7f12650de5e6514460b46ff118d9523dc 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # ---- define a box
 
@@ -111,7 +111,7 @@ smesh.SetName(hypArea2, "MaxElementArea_500")
 
 mesh.Compute()
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
 sg = salome.ImportComponentGUI('SMESH')
 if not isinstance(sg, type(salome.salome_ComponentGUI)):
index 8fa9b8c78928ea72b5c0fde0a9f918ae73a11a40..271d4261e1ae082f8a028942b584abcb135a3366 100644 (file)
@@ -35,4 +35,4 @@ log = mesh.GetLog(0); # no erase trace
 for linelog in log:
     print(linelog)
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index e5209554718ddf37d5bacbadbcaccd522c154ad8..5f9e9c615334b7f8c6d2480cc513645acf6a36dc 100644 (file)
@@ -29,11 +29,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import math
 
 pi = math.pi
index d1d6ce701afabe3a58e02c009fab9fd97fd3f9ef..cd380cf5c62cda72bff17678f72cc23d92ac9c39 100755 (executable)
@@ -25,11 +25,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # ---- GEOM
@@ -47,7 +47,7 @@ face = salome.IDToObject(idface)
 
 # ---- SMESH
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 mesh = smesh.Mesh(box, "Meshbox")
 
 # Set 1D algorithm/hypotheses to mesh
@@ -77,4 +77,4 @@ if len(faces) > 1:
     group1.Add(faces[:int(len(faces)/2)])
     group2.Add(faces[int(len(faces)/2):])
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 2b8dcaaa42e0bd7bd00853f6869a4ac2d11bd49d..9ae62fbd4755d2aaa42954d992c9ee3dbf6277b3 100644 (file)
@@ -28,11 +28,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import CORBA
 import os
@@ -81,4 +81,4 @@ for iFile in range(len(aListDir)) :
         ConvertMED2UNV(aPath,aFileName)
         #break
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index feacca7971cb929a338c1e7623cd78ae074f6640..2a0894a19a0dd84f548b71507d4e26a5885a8320 100644 (file)
@@ -992,10 +992,9 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
         if not self.nbLayers is None:
             self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
             self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
-        study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
-        self.mesh.smeshpyD.SetCurrentStudy( None )
+        self.mesh.smeshpyD.SetEnablePublish( False ) # prevents publishing own 1D hypothesis
         hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
-        self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
+        self.mesh.smeshpyD.SetEnablePublish( True ) # enables publishing
         if not self.distribHyp:
             self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
         self.distribHyp.SetLayerDistribution( hyp )
@@ -1159,10 +1158,9 @@ class StdMeshersBuilder_RadialAlgorithm(Mesh_Algorithm):
             self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
         else:
             self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
-        study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
-        self.mesh.smeshpyD.SetCurrentStudy( None )
+        self.mesh.smeshpyD.SetEnablePublish( False )
         hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
-        self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
+        self.mesh.smeshpyD.SetEnablePublish( True )
         self.distribHyp.SetLayerDistribution( hyp )
         return hyp
 
diff --git a/src/SMESH_SWIG/batchmode_mefisto.py b/src/SMESH_SWIG/batchmode_mefisto.py
deleted file mode 100644 (file)
index 6e9e228..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-import os
-import re
-
-import batchmode_salome
-import batchmode_geompy
-import batchmode_smesh
-from salome.StdMeshers import StdMeshersBuilder
-
-smesh = batchmode_smesh.smesh
-smesh.SetCurrentStudy(batchmode_salome.myStudy)
-
-def CreateMesh (theFileName, area, len = None, nbseg = None):
-    
-    if not(os.path.isfile(theFileName)) or re.search("\.brep$", theFileName) is None :
-        print("Incorrect file name !")
-        return
-
-    if (len is None) and (nbseg is None):
-        print("Define length or number of segments !")
-        return
-
-    if (len is not None) and (nbseg is not None):
-        print("Only one Hypothesis (from length and number of segments) can be defined !")
-        return
-
-    
-    # ----  Import shape from BREP file and add it to the study  
-    shape_mesh = batchmode_geompy.Import(theFileName, "BREP")
-    Id_shape = batchmode_geompy.addToStudy(shape_mesh, "shape_mesh")
-
-
-    # ---- SMESH
-    print("-------------------------- create mesh")
-    mesh = smesh.Mesh(shape_mesh)
-      
-    print("-------------------------- create Hypothesis")
-    if (len is not None):
-        print("-------------------------- LocalLength")
-        algoReg = mesh.Segment()
-        hypLength1 = algoReg.LocalLength(len)
-        print("Hypothesis type : ", hypLength1.GetName())
-        print("Hypothesis ID   : ", hypLength1.GetId())
-        print("Hypothesis Value: ", hypLength1.GetLength())
-    
-    if (nbseg is not None):   
-        print("-------------------------- NumberOfSegments")
-        algoReg = mesh.Segment()
-        hypNbSeg1 = algoReg.NumberOfSegments(nbseg)
-        print("Hypothesis type : ", hypNbSeg1.GetName())
-        print("Hypothesis ID   : ", hypNbSeg1.GetId())
-        print("Hypothesis Value: ", hypNbSeg1.GetNumberOfSegments())
-
-    if (area == "LengthFromEdges"):
-        print("-------------------------- LengthFromEdges")
-        algoMef = mesh.Triangle()
-        hypLengthFromEdges = algoMef.LengthFromEdges(1)
-        print("Hypothesis type     : ", hypLengthFromEdges.GetName())
-        print("Hypothesis ID       : ", hypLengthFromEdges.GetId())
-        print("LengthFromEdges Mode: ", hypLengthFromEdges.GetMode())
-       
-    else:
-        print("-------------------------- MaxElementArea")
-        algoMef = mesh.Triangle()
-        hypArea1 = algoMef.MaxElementArea(area)
-        print("Hypothesis type : ", hypArea1.GetName())
-        print("Hypothesis ID   : ", hypArea1.GetId())
-        print("Hypothesis Value: ", hypArea1.GetMaxElementArea())
-              
-    
-    print("-------------------------- Regular_1D")
-    listHyp = algoReg.GetCompatibleHypothesis()
-    for hyp in listHyp:
-        print(hyp)
-    
-    print("Algo name: ", algoReg.GetName())
-    print("Algo ID  : ", algoReg.GetId())
-   
-    print("-------------------------- MEFISTO_2D")
-    listHyp = algoMef.GetCompatibleHypothesis()
-    for hyp in listHyp:
-        print(hyp)
-        
-    print("Algo name: ", algoMef.GetName())
-    print("Algo ID  : ", algoMef.GetId())
-
-
-    # ---- add hypothesis to shape
-
-    print("-------------------------- compute mesh")
-    ret = mesh.Compute()
-    print("Compute Mesh .... ", end=' ') 
-    print(ret)
-    log = mesh.GetLog(0); # no erase trace
-    #for linelog in log:
-    #    print linelog
-
-    print("------------ INFORMATION ABOUT MESH ------------")
-    
-    print("Number of nodes    : ", mesh.NbNodes())
-    print("Number of edges    : ", mesh.NbEdges())
-    print("Number of faces    : ", mesh.NbFaces())
-    print("Number of triangles: ", mesh.NbTriangles())
-
-    return mesh
diff --git a/src/SMESH_SWIG/batchmode_smesh.py b/src/SMESH_SWIG/batchmode_smesh.py
deleted file mode 100644 (file)
index 6815bbb..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-#  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-#  File   : batchmode_smesh.py
-#  Author : Oksana TCHEBANOVA
-#  Module : SMESH
-#  $Header$
-#
-from batchmode_salome import *
-from batchmode_geompy import ShapeType
-import SMESH
-
-#--------------------------------------------------------------------------
-modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
-
-smesh = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
-smesh.SetCurrentStudy(myStudy)
-myStudyBuilder = myStudy.NewBuilder()
-
-if myStudyBuilder is None:
-    raise RuntimeError(" Null myStudyBuilder")
-
-father = myStudy.FindComponent("SMESH")
-if father is None:
-    father = myStudyBuilder.NewComponent("SMESH")
-    FName = myStudyBuilder.FindOrCreateAttribute(father, "AttributeName")
-    Comp = modulecatalog.GetComponent("SMESH")
-    FName.SetValue(Comp._get_componentusername())
-    aPixmap = myStudyBuilder.FindOrCreateAttribute(father, "AttributePixMap")
-    aPixmap.SetPixMap("ICON_OBJBROWSER_Mesh")
-
-myStudyBuilder.DefineComponentInstance(father,smesh)
-
-mySComponentMesh = father._narrow(SALOMEDS.SComponent)
-
-Tag_HypothesisRoot  = 1
-Tag_AlgorithmsRoot  = 2
-
-Tag_RefOnShape      = 1
-Tag_RefOnAppliedHypothesis = 2
-Tag_RefOnAppliedAlgorithms = 3
-
-Tag_SubMeshOnVertex = 4
-Tag_SubMeshOnEdge = 5
-Tag_SubMeshOnFace = 6
-Tag_SubMeshOnSolid = 7
-Tag_SubMeshOnCompound = 8
-
-Tag = {"HypothesisRoot":1,"AlgorithmsRoot":2,"RefOnShape":1,"RefOnAppliedHypothesis":2,"RefOnAppliedAlgorithms":3,"SubMeshOnVertex":4,"SubMeshOnEdge":5,"SubMeshOnFace":6,"SubMeshOnSolid":7,"SubMeshOnCompound":8}
-
-#------------------------------------------------------------
-def Init():
-    pass
-#------------------------------------------------------------
-def AddNewMesh(IOR):
-    # VSR: added temporarily - objects are published automatically by the engine
-    aSO = myStudy.FindObjectIOR( IOR )
-    if aSO is not None:
-        return aSO.GetID()
-    # VSR ######################################################################
-
-    res,HypothesisRoot = mySComponentMesh.FindSubObject ( Tag_HypothesisRoot )
-    if HypothesisRoot is None or res == 0:
-        HypothesisRoot = myStudyBuilder.NewObjectToTag(mySComponentMesh, Tag_HypothesisRoot)
-        aName = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeName")
-        aName.SetValue("Hypotheses")
-        aPixmap = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributePixMap")
-        aPixmap.SetPixMap( "mesh_tree_hypo.png" )
-        aSelAttr = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeSelectable")
-        aSelAttr.SetSelectable(0)
-
-    res, AlgorithmsRoot = mySComponentMesh.FindSubObject (Tag_AlgorithmsRoot)
-    if AlgorithmsRoot is None  or res == 0:
-        AlgorithmsRoot = myStudyBuilder.NewObjectToTag (mySComponentMesh, Tag_AlgorithmsRoot)
-        aName = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeName")
-        aName.SetValue("Algorithms")
-        aPixmap = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributePixMap")
-        aPixmap.SetPixMap( "mesh_tree_algo.png" )
-        aSelAttr = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeSelectable")
-        aSelAttr.SetSelectable(0)
-
-    HypothesisRoot = HypothesisRoot._narrow(SALOMEDS.SObject)
-    newMesh = myStudyBuilder.NewObject(mySComponentMesh)
-    aPixmap = myStudyBuilder.FindOrCreateAttribute(newMesh, "AttributePixMap")
-    aPixmap.SetPixMap( "mesh_tree_mesh.png" )
-    anIOR = myStudyBuilder.FindOrCreateAttribute(newMesh, "AttributeIOR")
-    anIOR.SetValue(IOR)
-    return newMesh.GetID()
-
-#------------------------------------------------------------
-def AddNewHypothesis(IOR):
-    # VSR: added temporarily - objects are published automatically by the engine
-    aSO = myStudy.FindObjectIOR( IOR )
-    if aSO is not None:
-        return aSO.GetID()
-    # VSR ######################################################################
-
-    res, HypothesisRoot = mySComponentMesh.FindSubObject (Tag_HypothesisRoot)
-    if HypothesisRoot is None or res == 0:
-        HypothesisRoot = myStudyBuilder.NewObjectToTag (mySComponentMesh, Tag_HypothesisRoot)
-        aName = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeName")
-        aName.SetValue("Hypotheses")
-        aSelAttr = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeSelectable")
-        aSelAttr.SetSelectable(0)
-        aPixmap = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributePixMap")
-        aPixmap.SetPixMap( "mesh_tree_hypo.png" )
-
-    # Add New Hypothesis
-    newHypo = myStudyBuilder.NewObject(HypothesisRoot)
-    aPixmap = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributePixMap")
-    H = orb.string_to_object(IOR)
-    aType = H.GetName()
-    aPixmap.SetPixMap( "mesh_tree_hypo.png_" + aType )
-    anIOR = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributeIOR")
-    anIOR.SetValue(IOR)
-    return newHypo.GetID()
-
-#------------------------------------------------------------
-def AddNewAlgorithms(IOR):
-    # VSR: added temporarily - objects are published automatically by the engine
-    aSO = myStudy.FindObjectIOR( IOR )
-    if aSO is not None:
-        return aSO.GetID()
-    # VSR ######################################################################
-
-    res, AlgorithmsRoot = mySComponentMesh.FindSubObject (Tag_AlgorithmsRoot)
-    if  AlgorithmsRoot is None or res == 0:
-        AlgorithmsRoot = myStudyBuilder.NewObjectToTag (mySComponentMesh, Tag_AlgorithmsRoot)
-        aName = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeName")
-        aName.SetValue("Algorithms")
-        aSelAttr = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeSelectable")
-        aSelAttr.SetSelectable(0)
-        aPixmap = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributePixMap")
-        aPixmap.SetPixMap( "mesh_tree_algo.png" )
-
-  # Add New Algorithms
-    newHypo = myStudyBuilder.NewObject(AlgorithmsRoot)
-    aPixmap = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributePixMap")
-    aPixmap = aPixmap._narrow(SALOMEDS.AttributePixMap)
-    H = orb.string_to_object(IOR)
-    aType = H.GetName();    #QString in fact
-    aPixmap.SetPixMap( "mesh_tree_algo.png_" + aType )
-    anIOR = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributeIOR")
-    anIOR.SetValue(IOR)
-    return newHypo.GetID()
-
-
-#------------------------------------------------------------
-def SetShape(ShapeEntry, MeshEntry):
-    SO_MorSM = myStudy.FindObjectID( MeshEntry )
-    SO_GeomShape = myStudy.FindObjectID( ShapeEntry )
-
-    if SO_MorSM is not None and SO_GeomShape is not None :
-        # VSR: added temporarily - shape reference is published automatically by the engine
-        res, Ref = SO_MorSM.FindSubObject( Tag_RefOnShape )
-        if res == 1 :
-            return
-        # VSR ######################################################################
-
-        SO = myStudyBuilder.NewObjectToTag (SO_MorSM, Tag_RefOnShape)
-        myStudyBuilder.Addreference (SO,SO_GeomShape)
-
-
-#------------------------------------------------------------
-def SetHypothesis(Mesh_Or_SubMesh_Entry, Hypothesis_Entry):
-    SO_MorSM = myStudy.FindObjectID( Mesh_Or_SubMesh_Entry )
-    SO_Hypothesis =  myStudy.FindObjectID( Hypothesis_Entry )
-
-    if  SO_MorSM is not None and SO_Hypothesis is not None :
-
-    #Find or Create Applied Hypothesis root
-        res, AHR = SO_MorSM.FindSubObject (Tag_RefOnAppliedHypothesis)
-        if  AHR is None or res == 0:
-            AHR = myStudyBuilder.NewObjectToTag (SO_MorSM, Tag_RefOnAppliedHypothesis)
-            aName = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeName")
-
-            # The same name as in SMESH_Mesh_i::AddHypothesis() ##################
-            aName.SetValue("Applied hypotheses")
-
-            aSelAttr = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeSelectable")
-            aSelAttr.SetSelectable(0)
-            aPixmap = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributePixMap")
-            aPixmap.SetPixMap( "mesh_tree_hypo.png" )
-
-        # VSR: added temporarily - reference to applied hypothesis is published automatically by the engine
-        else :
-            it = myStudy.NewChildIterator(AHR)
-            while it.More() :
-                res, Ref = it.Value().ReferencedObject()
-                if res and Ref is not None and Ref.GetID() == Hypothesis_Entry :
-                    return
-                it.Next()
-        # VSR ######################################################################
-
-        SO = myStudyBuilder.NewObject(AHR)
-        myStudyBuilder.Addreference (SO,SO_Hypothesis)
-
-#------------------------------------------------------------
-def SetAlgorithms(Mesh_Or_SubMesh_Entry, Algorithms_Entry):
-    SO_MorSM = myStudy.FindObjectID( Mesh_Or_SubMesh_Entry )
-    SO_Algorithms = myStudy.FindObjectID( Algorithms_Entry )
-    if  SO_MorSM != None and SO_Algorithms != None :
-        #Find or Create Applied Algorithms root
-        res, AHR = SO_MorSM.FindSubObject (Tag_RefOnAppliedAlgorithms)
-        if AHR is None or res == 0:
-            AHR = myStudyBuilder.NewObjectToTag (SO_MorSM, Tag_RefOnAppliedAlgorithms)
-            aName = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeName")
-
-            # The same name as in SMESH_Mesh_i::AddHypothesis() ##################
-            aName.SetValue("Applied algorithms")
-
-            aSelAttr = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeSelectable")
-            aSelAttr.SetSelectable(0)
-            aPixmap = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributePixMap")
-            aPixmap.SetPixMap( "mesh_tree_algo.png" )
-
-        # VSR: added temporarily - reference to applied hypothesis is published automatically by the engine
-        else :
-            it = myStudy.NewChildIterator(AHR)
-            while it.More() :
-                res, Ref = it.Value().ReferencedObject()
-                if res and Ref is not None and Ref.GetID() == Algorithms_Entry :
-                    return
-                it.Next()
-        # VSR ######################################################################
-
-        SO = myStudyBuilder.NewObject(AHR)
-        myStudyBuilder.Addreference (SO,SO_Algorithms)
-
-
-#------------------------------------------------------------
-def UnSetHypothesis( Applied_Hypothesis_Entry ):
-    SO_Applied_Hypothesis = myStudy.FindObjectID( Applied_Hypothesis_Entry )
-    if SO_Applied_Hypothesis :
-        myStudyBuilder.RemoveObject(SO_Applied_Hypothesis)
-
-
-#------------------------------------------------------------
-def AddSubMesh ( SO_Mesh_Entry, SM_IOR, ST):
-    # VSR: added temporarily - objects are published automatically by the engine
-    aSO = myStudy.FindObjectIOR( SM_IOR )
-    if aSO is not None:
-        return aSO.GetID()
-    # VSR ######################################################################
-
-    SO_Mesh = myStudy.FindObjectID( SO_Mesh_Entry )
-    if ( SO_Mesh ) :
-
-        if  ST == ShapeType["COMPSOLID"] :
-            Tag_Shape = Tag_SubMeshOnSolid
-            Name = "SubMeshes on Solid"
-        elif ST == ShapeType["FACE"] :
-            Tag_Shape = Tag_SubMeshOnFace
-            Name = "SubMeshes on Face"
-        elif ST == ShapeType["EDGE"] :
-            Tag_Shape = Tag_SubMeshOnEdge
-            Name = "SubMeshes on Edge"
-        elif ST == ShapeType["VERTEX"] :
-            Tag_Shape = Tag_SubMeshOnVertex
-            Name = "SubMeshes on Vertex"
-        else :
-            Tag_Shape = Tag_SubMeshOnCompound
-            Name = "SubMeshes on Compound"
-
-        res, SubmeshesRoot = SO_Mesh.FindSubObject (Tag_Shape)
-        if SubmeshesRoot is None or res == 0:
-            SubmeshesRoot = myStudyBuilder.NewObjectToTag (SO_Mesh, Tag_Shape)
-            aName = myStudyBuilder.FindOrCreateAttribute(SubmeshesRoot, "AttributeName")
-            aName.SetValue(Name)
-            aSelAttr = myStudyBuilder.FindOrCreateAttribute(SubmeshesRoot, "AttributeSelectable")
-            aSelAttr.SetSelectable(0)
-
-        SO = myStudyBuilder.NewObject (SubmeshesRoot)
-        anIOR = myStudyBuilder.FindOrCreateAttribute(SO, "AttributeIOR")
-        anIOR.SetValue(SM_IOR)
-        return  SO.GetID()
-
-    return None
-
-#------------------------------------------------------------
-def AddSubMeshOnShape (Mesh_Entry, GeomShape_Entry, SM_IOR, ST) :
-    # VSR: added temporarily - objects are published automatically by the engine
-    aSO = myStudy.FindObjectIOR( SM_IOR )
-    if aSO is not None:
-        return aSO.GetID()
-    # VSR ######################################################################
-    SO_GeomShape = myStudy.FindObjectID( GeomShape_Entry )
-    if  SO_GeomShape != None :
-        SM_Entry = AddSubMesh (Mesh_Entry,SM_IOR,ST)
-        SO_SM = myStudy.FindObjectID( SM_Entry )
-
-        if  SO_SM != None :
-            SetShape (GeomShape_Entry, SM_Entry)
-            return SM_Entry
-
-    return None
-
-
-#------------------------------------------------------------
-def SetName(Entry, Name):
-    SO = myStudy.FindObjectID( Entry )
-    if SO != None :
-        aName = myStudyBuilder.FindOrCreateAttribute(SO, "AttributeName")
-        aName.SetValue(Name)
index d2930389803d237054be1e5240fbf9b255b8c8f5..17a4a01f126b0ccf84999e0995b3ff0ddfb90f5a 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -323,4 +323,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index eca7e708dd6d40810fcd7204c581e8afd27d6d12..e47fde7e70679949cc4ed79d89d4dac19e4e15dd 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -125,4 +125,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 4d4205988c6b11b477098fdf088ddaae9422d4f2..302256fa1194d4ea6034df2022067f3f74a9b46f 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -112,4 +112,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 74709a2882291ab0d86215246e0e58c22a874641..96cb23479e23a05f017a75b4ef32f27b5c79f09d 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -117,4 +117,4 @@ mixed.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 63049972cb12fab9ab79f98f933847d74f2fde80..da8c97525a7855843e9d00b2071ea58169fb6cad 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -152,4 +152,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 252b4e896bc3870b265ce2ebfdc2d7b18c57b5da..dc59840dacc8e74e52c6e7f9aff20763e409f2ce 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -169,4 +169,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 099204117f2a2703a25b934d43984bdaa093f5a4..20de60dec649de490e637fa506663f01430797b1 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -109,4 +109,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index a9d4579c869f54daee8a19f363e1497bfe569467..d4577d2fab1e5a0c4bda45cd573aa5c274a7df2a 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -142,4 +142,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 63222cb3695d5165550baa5eb1dc8681ee354c00..b610ac554a54f370e6dd3abb570ff78d8b51f21a 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -145,4 +145,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 24cd31d44d1dbb075b7ab35af6c055803c5f6e7d..6fb26f2d5954d2b481af09f634f708e6b0b43f4d 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -107,4 +107,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 91b6a3d269ec9f1b42bf07a8f58c4f355985ba54..ae75f84c1874b61c15d5ecdecc60a67c9c40a3c2 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -128,4 +128,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 55164b7778e578751d408f59afa60c92486686ef..02e468333657748d8a6c002f9ffac984ea8e6564 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -143,4 +143,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 6cb4b1c2ddac575b226a3287c62d7148178b1ff0..6982aa6069f920e5012e789b0a2114e5a3b10993 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -261,4 +261,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index f908a3d7670c59c5876b208a276feecc3e2a5edd..1167d6390a68d4d63d5a4c9fcd4f148406f713f4 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometrie
 # =========
@@ -146,4 +146,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 42cfbaad7111077bba685412751bf3208b98dd73..46be8da3b275314d27e75cde829d61e1b70c873f 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometrie
 # =========
@@ -205,4 +205,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index d7ec0ea1d6b1890e212e1063dd3d2f31914fe2c3..cb8ce46f02e596e4059e6d1296160dea2e83e993 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -149,4 +149,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 4d8b06aeb165ae7ff8f0454a384b6e592811bc87..22a9c1d1ebb4692c258e9e0e63c4e0632934dda1 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometrie
 # =========
@@ -107,4 +107,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 3721e9a6b51d4ad8dc91070aa1876fe613ccf17c..afd7dc26f26a99621756ff37450941ddcb3a25f1 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import math
 
@@ -145,4 +145,4 @@ hexa.Compute()
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 4528d532324e46d8dde196d169ce97fcb1791e20..2bc7abf55c94053d5e4b357dfc90ffe772c5a699 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometrie
 # =========
@@ -190,4 +190,4 @@ hexa_groupe = hexa.Group(groupe)
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 034037120aa85e62557611344349dd69409abe7e..04e7d4d2b636236e561dd4e390e15529db830dc3 100644 (file)
@@ -27,11 +27,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Geometry
 # ========
@@ -136,4 +136,4 @@ tetra.Group(group)
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
\ No newline at end of file
+salome.sg.updateObjBrowser()
\ No newline at end of file
index 87b4cfbe0cd8486a3de616e0ee75f87c574a9da2..57b7c1ff13c4a0fb5f90211b5433a02df5dc44e2 100644 (file)
@@ -26,11 +26,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 geo = geompy
 
@@ -103,7 +103,7 @@ geompy.DifferenceList(group_1, [group_1_box])
 # Mesh the blocks with hexahedral
 # -------------------------------
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 def discretize(x, y, z,  n, s=blocks):
     p = geompy.MakeVertex(x, y, z)
@@ -134,4 +134,4 @@ hexa.Group(group_1)
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 1848af2fc43e7f31c20a948d9ac4fafb610e2fec..7edfad86d23a08a8a25b6328234e5313a7dd1b57 100644 (file)
@@ -25,19 +25,22 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import os
 
 # Values
 # ------
 
+tmpDir = os.getenv('SALOME_TMP_DIR', '/tmp')
+print("Output directory:", tmpDir)
+
 # Path for ".med" files
-path = "/tmp/ex29_%s_" % os.getenv('USER','unknown')
+path = os.path.join( tmpDir, "ex29_%s_" % os.getenv('USER','unknown'))
 
 # Name of the shape and the mesh
 name = "Carre"
@@ -229,4 +232,4 @@ MyMesh.ExportMED(path+str(NbCells4)+"_triangles.med", 0)
 # Update the object browser
 # -------------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index 7b9f96c33994ec3e89b9cd045aef20f9cd0956d1..76a0593fda983e20efa6279dac9a88bd6fae30c0 100755 (executable)
@@ -22,18 +22,18 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import math
 
 global Face_1
 Face_1 = geompy.MakeFaceHW(100, 100, 1)
 geompy.addToStudy( Face_1, "Face_1" )
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 from salome.StdMeshers import StdMeshersBuilder
 pattern = smesh.GetPattern()
 Mesh_1 = smesh.Mesh(Face_1)
@@ -87,5 +87,5 @@ aIntGrp=Mesh_1.IntersectListOfGroups([aRedGroup, aGreenGroup, aBlueGroup], "IntG
 # CutListOfGroups()
 aCutGrp=Mesh_1.CutListOfGroups([aRedGroup],[aGreenGroup,aBlueGroup],"CutGrp")
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
 
index 0c75c37946f2969aa159e43aee814c90364330e6..de69b2c8d1d1a78b41ac51518cedcfcfc628b91d 100644 (file)
@@ -26,11 +26,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Parameters
 # ----------
@@ -53,7 +53,7 @@ geompy.addToStudy(cylinder, "Cylinder")
 # Define a mesh on a geometry
 # ---------------------------
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 
 m = smesh.Mesh(cylinder)
 
@@ -93,4 +93,4 @@ else:
 # Update object browser
 # ---------------------
 
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
index b1777f5119ba225a80a72c30608438a7f54db194..db8a03c63fb2de14829e0ddf06584af00269cf31 100755 (executable)
@@ -22,18 +22,18 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 import math
 
 global Box_1
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
 geompy.addToStudy( Box_1, "Box_1" )
 
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
 from salome.StdMeshers import StdMeshersBuilder
 Mesh_1 = smesh.Mesh(Box_1)
 Regular_1D = Mesh_1.Segment()
@@ -60,5 +60,5 @@ 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(True)
+salome.sg.updateObjBrowser()
 
index 81226496113d188537ddf1f870a44c991b587377..92a88aaf3ac2364294328bb88c2ff852c24863de 100644 (file)
@@ -43,7 +43,7 @@ from salome.smesh import smeshBuilder
 try:
     # get instance of class smeshBuilder
     engineSmesh = salome.lcc.FindOrLoadComponent( "FactoryServer", "SMESH" )
-    smesh = smeshBuilder.New(salome.myStudy, engineSmesh)
+    smesh = smeshBuilder.New(True,engineSmesh)
 except:
     print("exception in smesh.py: instance creation failed")
     smesh = None
@@ -100,14 +100,13 @@ replace
 -------
 
 import smesh, SMESH
-smesh.SetCurrentStudy(theStudy)
 
 with
 ----
 
 import SMESH
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
 
 you also need to modify some lines where smeshBuilder is used instead of smesh
 
index 9ce830c28d6a544da3afdafddd489ab93af5ec5c..6da2aaf29ba637d254f751255cb7afb9f1fd2a2c 100644 (file)
@@ -263,13 +263,8 @@ def GetName(obj):
         except:
             ior = None
         if ior:
-            # CORBA object
-            studies = salome.myStudyManager.GetOpenStudies()
-            for sname in studies:
-                s = salome.myStudyManager.GetStudyByName(sname)
-                if not s: continue
-                sobj = s.FindObjectIOR(ior)
-                if not sobj: continue
+            sobj = salome.myStudy.FindObjectIOR(ior)
+            if sobj:
                 return sobj.GetName()
             if hasattr(obj, "GetName"):
                 # unknown CORBA object, having GetName() method
@@ -340,12 +335,7 @@ def TreatHypoStatus(status, hypName, geomName, isAlgo, mesh):
 def AssureGeomPublished(mesh, geom, name=''):
     if not isinstance( geom, geomBuilder.GEOM._objref_GEOM_Object ):
         return
-    if not geom.GetStudyEntry() and \
-           mesh.smeshpyD.GetCurrentStudy():
-        ## set the study
-        studyID = mesh.smeshpyD.GetCurrentStudy()._get_StudyId()
-        if studyID != mesh.geompyD.myStudyId:
-            mesh.geompyD.init_geom( mesh.smeshpyD.GetCurrentStudy())
+    if not geom.GetStudyEntry():
         ## get a name
         if not name and geom.GetShapeType() != geomBuilder.GEOM.COMPOUND:
             # for all groups SubShapeName() return "Compound_-1"
@@ -458,8 +448,8 @@ class smeshBuilder(SMESH._objref_SMESH_Gen):
     ## Dump component to the Python script
     #  This method overrides IDL function to allow default values for the parameters.
     #  @ingroup l1_auxiliary
-    def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
-        return SMESH._objref_SMESH_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
+    def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
+        return SMESH._objref_SMESH_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
 
     ## Set mode of DumpPython(), \a historical or \a snapshot.
     #  In the \a historical mode, the Python Dump script includes all commands
@@ -472,14 +462,14 @@ class smeshBuilder(SMESH._objref_SMESH_Gen):
         else:            val = "false"
         SMESH._objref_SMESH_Gen.SetOption(self, "historical_python_dump", val)
 
-    ## Set the current study and Geometry component
+    ## Set Geometry component
     #  @ingroup l1_auxiliary
-    def init_smesh(self,theStudy,geompyD = None):
+    def init_smesh(self,isPublished = True,geompyD = None):
         #print "init_smesh"
-        self.SetCurrentStudy(theStudy,geompyD)
-        if theStudy:
+        self.UpdateStudy(geompyD)
+        if isPublished:
             global notebook
-            notebook.myStudy = theStudy
+            notebook.myStudy = salome.myStudy
 
     ## Create a mesh. This can be either an empty mesh, possibly having an underlying geometry,
     #  or a mesh wrapping a CORBA mesh given as a parameter.
@@ -596,34 +586,32 @@ class smeshBuilder(SMESH._objref_SMESH_Gen):
     #  @ingroup l1_auxiliary
     def IsEmbeddedMode(self):
         return SMESH._objref_SMESH_Gen.IsEmbeddedMode(self)
-
-    ## Set the current study. Calling SetCurrentStudy( None ) allows to
-    #  switch OFF automatic pubilishing in the Study of mesh objects.
+    
+    ## Update the current study. Calling UpdateStudy() allows to 
+    #  update meshes at switching GEOM->SMESH
     #  @ingroup l1_auxiliary
-    def SetCurrentStudy( self, theStudy, geompyD = None ):
+    def UpdateStudy( self, geompyD = None  ):
+        #self.UpdateStudy()
         if not geompyD:
             from salome.geom import geomBuilder
             geompyD = geomBuilder.geom
             pass
         self.geompyD=geompyD
         self.SetGeomEngine(geompyD)
-        SMESH._objref_SMESH_Gen.SetCurrentStudy(self,theStudy)
-        global notebook
-        if theStudy:
-            notebook = salome_notebook.NoteBook( theStudy )
-        else:
-            notebook = salome_notebook.NoteBook( salome_notebook.PseudoStudyForNoteBook() )
-        if theStudy:
-            sb = theStudy.NewBuilder()
-            sc = theStudy.FindComponent("SMESH")
-            if sc: sb.LoadWith(sc, self)
-            pass
+        SMESH._objref_SMESH_Gen.UpdateStudy(self)
+        sb = salome.myStudy.NewBuilder()
+        sc = salome.myStudy.FindComponent("SMESH")
+        if sc: sb.LoadWith(sc, self)
         pass
-
-    ## Get the current study
+        
+    ## Sets enable publishing in the study. Calling SetEnablePublish( false ) allows to
+    #  switch OFF publishing in the Study of mesh objects.
     #  @ingroup l1_auxiliary
-    def GetCurrentStudy(self):
-        return SMESH._objref_SMESH_Gen.GetCurrentStudy(self)
+    def SetEnablePublish( self, theIsEnablePublish ):
+        #self.SetEnablePublish(theIsEnablePublish)
+        SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish)
+        global notebook
+        notebook = salome_notebook.NoteBook( theIsEnablePublish )
 
     ## Create a Mesh object importing data from the given UNV file
     #  @return an instance of Mesh class
@@ -833,7 +821,7 @@ class smeshBuilder(SMESH._objref_SMESH_Gen):
                     raise ValueError("Group type mismatches Element type")
                 aCriterion.ThresholdStr = aThreshold.GetName()
                 aCriterion.ThresholdID  = salome.orb.object_to_string( aThreshold )
-                study = self.GetCurrentStudy()
+                study = salome.myStudy
                 if study:
                     so = study.FindObjectIOR( aCriterion.ThresholdID )
                     if so:
@@ -1238,13 +1226,13 @@ omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder)
 #    import salome
 #    salome.salome_init()
 #    from salome.smesh import smeshBuilder
-#    smesh = smeshBuilder.New(salome.myStudy)
+#    smesh = smeshBuilder.New()
 #  \endcode
-#  @param  study     SALOME study, generally obtained by salome.myStudy.
+#  @param  isPublished If False, the notebool will not be used.
 #  @param  instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
 #  @return smeshBuilder instance
 
-def New( study, instance=None):
+def New( isPublished = True, instance=None):
     """
     Create a new smeshBuilder instance.The smeshBuilder class provides the Python
     interface to create or load meshes.
@@ -1253,10 +1241,10 @@ def New( study, instance=None):
         import salome
         salome.salome_init()
         from salome.smesh import smeshBuilder
-        smesh = smeshBuilder.New(salome.myStudy)
+        smesh = smeshBuilder.New()
 
     Parameters:
-        study     SALOME study, generally obtained by salome.myStudy.
+        isPublished If False, the notebool will not be used.
         instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
     Returns:
         smeshBuilder instance
@@ -1269,7 +1257,7 @@ def New( study, instance=None):
         doLcc = True
     smeshInst = smeshBuilder()
     assert isinstance(smeshInst,smeshBuilder), "Smesh engine class is %s but should be smeshBuilder.smeshBuilder. Import salome.smesh.smeshBuilder before creating the instance."%smeshInst.__class__
-    smeshInst.init_smesh(study)
+    smeshInst.init_smesh(isPublished)
     return smeshInst
 
 
@@ -1306,12 +1294,9 @@ class Mesh(metaclass=MeshMeta):
                 self.geom = obj
                 objHasName = True
                 # publish geom of mesh (issue 0021122)
-                if not self.geom.GetStudyEntry() and smeshpyD.GetCurrentStudy():
+                if not self.geom.GetStudyEntry():
                     objHasName = False
-                    studyID = smeshpyD.GetCurrentStudy()._get_StudyId()
-                    if studyID != geompyD.myStudyId:
-                        geompyD.init_geom( smeshpyD.GetCurrentStudy())
-                        pass
+                    geompyD.init_geom()
                     if name:
                         geo_name = name + " shape"
                     else:
@@ -1588,12 +1573,12 @@ class Mesh(metaclass=MeshMeta):
                 print(msg)
                 print(allReasons)
             pass
-        if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
+        if salome.sg.hasDesktop():
             if not isinstance( refresh, list): # not a call from subMesh.Compute()
                 smeshgui = salome.ImportComponentGUI("SMESH")
-                smeshgui.Init(self.mesh.GetStudyId())
+                smeshgui.Init()
                 smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
-                if refresh: salome.sg.updateObjBrowser(True)
+                if refresh: salome.sg.updateObjBrowser()
 
         return ok
 
@@ -1618,11 +1603,9 @@ class Mesh(metaclass=MeshMeta):
         try:
             shapeText = ""
             mainIOR  = salome.orb.object_to_string( self.GetShape() )
-            for sname in salome.myStudyManager.GetOpenStudies():
-                s = salome.myStudyManager.GetStudyByName(sname)
-                if not s: continue
-                mainSO = s.FindObjectIOR(mainIOR)
-                if not mainSO: continue
+            s = salome.myStudy
+            mainSO = s.FindObjectIOR(mainIOR)
+            if mainSO:
                 if subShapeID == 1:
                     shapeText = '"%s"' % mainSO.GetName()
                 subIt = s.NewChildIterator(mainSO)
@@ -1639,7 +1622,6 @@ class Mesh(metaclass=MeshMeta):
                         continue
                     if ids == subShapeID:
                         shapeText = '"%s"' % subSO.GetName()
-                        break
             if not shapeText:
                 shape = self.geompyD.GetSubShape( self.GetShape(), [subShapeID])
                 if shape:
@@ -1710,12 +1692,11 @@ class Mesh(metaclass=MeshMeta):
     #  @ingroup l2_construct
     def Clear(self, refresh=False):
         self.mesh.Clear()
-        if ( salome.sg.hasDesktop() and
-             salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() ) ):
+        if ( salome.sg.hasDesktop() ):
             smeshgui = salome.ImportComponentGUI("SMESH")
-            smeshgui.Init(self.mesh.GetStudyId())
+            smeshgui.Init()
             smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
-            if refresh: salome.sg.updateObjBrowser(True)
+            if refresh: salome.sg.updateObjBrowser()
 
     ## Remove all nodes and elements of indicated shape
     #  @param refresh if @c True, Object browser is automatically updated (when running in GUI)
@@ -1725,9 +1706,9 @@ class Mesh(metaclass=MeshMeta):
         self.mesh.ClearSubMesh(geomId)
         if salome.sg.hasDesktop():
             smeshgui = salome.ImportComponentGUI("SMESH")
-            smeshgui.Init(self.mesh.GetStudyId())
+            smeshgui.Init()
             smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
-            if refresh: salome.sg.updateObjBrowser(True)
+            if refresh: salome.sg.updateObjBrowser()
 
     ## Compute a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron
     #  @param fineness [0.0,1.0] defines mesh fineness
@@ -2327,12 +2308,6 @@ class Mesh(metaclass=MeshMeta):
     def GetId(self):
         return self.mesh.GetId()
 
-    ## Get the study Id
-    #  @return integer value, which is the study Id of the mesh
-    #  @ingroup l1_auxiliary
-    def GetStudyId(self):
-        return self.mesh.GetStudyId()
-
     ## Check the group names for duplications.
     #  Consider the maximum group name length stored in MED file.
     #  @return True or False
@@ -2755,9 +2730,14 @@ class Mesh(metaclass=MeshMeta):
 
     ## Return an element based on all given nodes.
     #  @ingroup l1_meshinfo
-    def FindElementByNodes(self,nodes):
+    def FindElementByNodes(self, nodes):
         return self.mesh.FindElementByNodes(nodes)
 
+    ## Return elements including all given nodes.
+    #  @ingroup l1_meshinfo
+    def GetElementsByNodes(self, nodes, elemType=SMESH.ALL):
+        return self.mesh.GetElementsByNodes( nodes, elemType )
+
     ## Return true if the given element is a polygon
     #  @ingroup l1_meshinfo
     def IsPoly(self, id):
@@ -5157,11 +5137,11 @@ class submeshProxy(SMESH._objref_SMESH_subMesh):
 
         ok = self.mesh.Compute( self.GetSubShape(),refresh=[] )
 
-        if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
+        if salome.sg.hasDesktop():
             smeshgui = salome.ImportComponentGUI("SMESH")
-            smeshgui.Init(self.mesh.GetStudyId())
+            smeshgui.Init()
             smeshgui.SetMeshIcon( salome.ObjectToID( self ), ok, (self.GetNumberOfElements()==0) )
-            if refresh: salome.sg.updateObjBrowser(True)
+            if refresh: salome.sg.updateObjBrowser()
             pass
 
         return ok
@@ -5245,10 +5225,11 @@ omniORB.registerObjref(SMESH._objref_SMESH_Pattern._NP_RepositoryId, Pattern)
 ## Private class used to bind methods creating algorithms to the class Mesh
 #
 class algoCreator:
-    def __init__(self):
+    def __init__(self, method):
         self.mesh = None
         self.defaultAlgoType = ""
         self.algoTypeToClass = {}
+        self.method = method
 
     # Store a python class of algorithm
     def add(self, algoClass):
@@ -5262,26 +5243,50 @@ class algoCreator:
 
     # Create a copy of self and assign mesh to the copy
     def copy(self, mesh):
-        other = algoCreator()
+        other = algoCreator( self.method )
         other.defaultAlgoType = self.defaultAlgoType
-        other.algoTypeToClass  = self.algoTypeToClass
+        other.algoTypeToClass = self.algoTypeToClass
         other.mesh = mesh
         return other
 
     # Create an instance of algorithm
     def __call__(self,algo="",geom=0,*args):
-        algoType = self.defaultAlgoType
-        for arg in args + (algo,geom):
-            if isinstance( arg, geomBuilder.GEOM._objref_GEOM_Object ):
-                geom = arg
-            if isinstance( arg, str ) and arg:
+        algoType = ""
+        shape = 0
+        if isinstance( algo, str ):
+            algoType = algo
+        elif ( isinstance( algo, geomBuilder.GEOM._objref_GEOM_Object ) and \
+               not isinstance( geom, geomBuilder.GEOM._objref_GEOM_Object )):
+            shape = algo
+        elif algo:
+            args += (algo,)
+
+        if isinstance( geom, geomBuilder.GEOM._objref_GEOM_Object ):
+            shape = geom
+        elif not algoType and isinstance( geom, str ):
+            algoType = geom
+        elif geom:
+            args += (geom,)
+        for arg in args:
+            if isinstance( arg, geomBuilder.GEOM._objref_GEOM_Object ) and not shape:
+                shape = arg
+            elif isinstance( arg, str ) and not algoType:
                 algoType = arg
+            else:
+                import traceback, sys
+                msg = "Warning. Unexpected argument in mesh.%s() --->  %s" % ( self.method, arg )
+                sys.stderr.write( msg + '\n' )
+                tb = traceback.extract_stack(None,2)
+                traceback.print_list( [tb[0]] )
+        if not algoType:
+            algoType = self.defaultAlgoType
         if not algoType and self.algoTypeToClass:
             algoType = list(self.algoTypeToClass.keys())[0]
         if algoType in self.algoTypeToClass:
             #print "Create algo",algoType
-            return self.algoTypeToClass[ algoType ]( self.mesh, geom )
-        raise RuntimeError("No class found for algo type %s" % algoType)
+
+            return self.algoTypeToClass[ algoType ]( self.mesh, shape )
+        raise RuntimeError( "No class found for algo type %s" % algoType)
         return None
 
 ## Private class used to substitute and store variable parameters of hypotheses.
@@ -5362,7 +5367,7 @@ for pluginName in os.environ[ "SMESH_MeshersList" ].split( ":" ):
         if inspect.isclass(algo) and hasattr(algo, "meshMethod"):
             #print "                     meshMethod:" , str(algo.meshMethod)
             if not hasattr( Mesh, algo.meshMethod ):
-                setattr( Mesh, algo.meshMethod, algoCreator()
+                setattr( Mesh, algo.meshMethod, algoCreator( algo.meshMethod ))
                 pass
             getattr( Mesh, algo.meshMethod ).add( algo )
             pass
index 8d0946de12b043839edf5fca4d9348caa1ed5bf2..d30f7f21af0e92b661f6c982bec900d888cf4d05 100644 (file)
@@ -70,7 +70,7 @@ class Mesh_Algorithm:
     #  Finds only the hypotheses created in smeshpyD engine.
     #  @return SMESH.SMESH_Hypothesis
     def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD):
-        study = smeshpyD.GetCurrentStudy()
+        study = salome.myStudy
         if not study: return None
         #to do: find component by smeshpyD object, not by its data type
         scomp = study.FindComponent(smeshpyD.ComponentDataType())
@@ -114,7 +114,7 @@ class Mesh_Algorithm:
     #  Finds only the algorithms, which have been created in smeshpyD engine.
     #  @return SMESH.SMESH_Algo
     def FindAlgorithm (self, algoname, smeshpyD):
-        study = smeshpyD.GetCurrentStudy()
+        study = salome.myStudy
         if not study: return None
         #to do: find component by smeshpyD object, not by its data type
         scomp = study.FindComponent(smeshpyD.ComponentDataType())
index 5cc7c942297f3b328972a6a488db05ba53efc6dd..b609055e24416d50f89e19a3f6903d835bee2c39 100644 (file)
@@ -28,7 +28,7 @@ sm_gui = libSMESH_Swig.SMESH_Swig()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 import GEOM
 
index 82e130067fd56e1c42b4d0c17f06194c0c9f47cb..253ff7528b74ff635f49edd0bff2bbf0924f3306 100644 (file)
@@ -52,6 +52,7 @@ ADD_DEFINITIONS(
 SET(_link_LIBRARIES
   ${KERNEL_SalomeGenericObj}
   ${KERNEL_SALOMELocalTrace}
+  ${KERNEL_SalomeKernelHelpers}
   ${GUI_CAM}
   ${GUI_suit}
   ${GUI_qtx}
@@ -98,6 +99,7 @@ SET(_swig_SCRIPTS
 
 SWIG_ADD_MODULE(libSMESH_Swig python ${SMESH_Swig_SOURCES})
 SWIG_LINK_LIBRARIES(libSMESH_Swig ${_link_LIBRARIES})
+SWIG_CHECK_GENERATION(libSMESH_Swig)
 IF(WIN32)
   SET_TARGET_PROPERTIES(_libSMESH_Swig PROPERTIES DEBUG_OUTPUT_NAME _libSMESH_Swig_d)
 ENDIF(WIN32)
index 231dd33b5eb7a132013d734008dc5fdcad81441f..4d7bb2ae15a422f0fbd123af8360d64118c4082d 100644 (file)
@@ -35,6 +35,7 @@
 #include <Utils_ORB_INIT.hxx>
 #include <Utils_SINGLETON.hxx>
 #include <SALOMEDSClient_ClientFactory.hxx>
+#include <SALOME_KernelServices.hxx>
 
 #include <utilities.h>
 
@@ -202,14 +203,13 @@ namespace
   void
   SetDomain(const char*                       theMeshOrSubMeshEntry,
             const char*                       theDomainEntry,
-            const SALOMEDS::Study_var&        theStudy,
             const SALOMEDS::StudyBuilder_var& theStudyBuilder,
             long                              theRefOnAppliedDomainTag,
             const QString&                    theAppliedDomainMEN,
             const QString&                    theAppliedDomainICON)
   {
-    SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
-    SALOMEDS::SObject_var    aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
+    SALOMEDS::SObject_var aMeshOrSubMeshSO = KERNEL::getStudyServant()->FindObjectID(theMeshOrSubMeshEntry);
+    SALOMEDS::SObject_var    aHypothesisSO = KERNEL::getStudyServant()->FindObjectID(theDomainEntry);
 
     if(!aMeshOrSubMeshSO->_is_nil() && !aHypothesisSO->_is_nil()){
       //Find or Create Applied Hypothesis root
@@ -245,12 +245,10 @@ namespace
   void
   SetHypothesis(const char*                       theMeshOrSubMeshEntry,
                 const char*                       theDomainEntry,
-                const SALOMEDS::Study_var&        theStudy,
                 const SALOMEDS::StudyBuilder_var& theStudyBuilder)
   {
     SetDomain(theMeshOrSubMeshEntry,
               theDomainEntry,
-              theStudy,
               theStudyBuilder,
               SMESH::Tag_RefOnAppliedHypothesis,
               QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
@@ -262,12 +260,10 @@ namespace
   void
   SetAlgorithms(const char*                       theMeshOrSubMeshEntry,
                 const char*                       theDomainEntry,
-                const SALOMEDS::Study_var&        theStudy,
                 const SALOMEDS::StudyBuilder_var& theStudyBuilder)
   {
     SetDomain(theMeshOrSubMeshEntry,
               theDomainEntry,
-              theStudy,
               theStudyBuilder,
               SMESH::Tag_RefOnAppliedAlgorithms,
               QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
@@ -313,21 +309,15 @@ SMESH_Swig::SMESH_Swig()
 
 //===============================================================
 void
-SMESH_Swig::Init(int theStudyID)
+SMESH_Swig::Init()
 {
   class TEvent: public SALOME_Event
   {
-    int                         myStudyID;
-    SALOMEDS::Study_var&        myStudy;
     SALOMEDS::StudyBuilder_var& myStudyBuilder;
     SALOMEDS::SComponent_var&   mySComponentMesh;
   public:
-    TEvent(int                         theStudyID,
-           SALOMEDS::Study_var&        theStudy,
-           SALOMEDS::StudyBuilder_var& theStudyBuilder,
+    TEvent(SALOMEDS::StudyBuilder_var& theStudyBuilder,
            SALOMEDS::SComponent_var&   theSComponentMesh):
-      myStudyID       (theStudyID),
-      myStudy         (theStudy),
       myStudyBuilder  (theStudyBuilder),
       mySComponentMesh(theSComponentMesh)
     {}
@@ -345,26 +335,22 @@ SMESH_Swig::Init(int theStudyID)
       SUIT_Application* anApplication = aSession->activeApplication();
       SalomeApp_Application* anApp    = dynamic_cast<SalomeApp_Application*>(anApplication);
 
-      SALOME_NamingService* aNamingService = anApp->namingService();
-      CORBA::Object_var anObject           = aNamingService->Resolve("/myStudyManager");
-      SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
-      myStudy = aStudyMgr->GetStudyByID(myStudyID);
+      SALOMEDS::Study_var aStudy = KERNEL::getStudyServant();
 
       SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
-      aSMESHGen->SetCurrentStudy( myStudy.in() );
 
-      myStudyBuilder = myStudy->NewBuilder();
+      myStudyBuilder = aStudy->NewBuilder();
 
       SALOMEDS::GenericAttribute_var anAttr;
       SALOMEDS::AttributeName_var    aName;
       SALOMEDS::AttributePixMap_var  aPixmap;
 
-      SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
+      SALOMEDS::SComponent_var aSComponent = aStudy->FindComponent("SMESH");
       if ( aSComponent->_is_nil() )
       {
-        bool aLocked = myStudy->GetProperties()->IsLocked();
+        bool aLocked = aStudy->GetProperties()->IsLocked();
         if (aLocked)
-          myStudy->GetProperties()->SetLocked(false);
+          aStudy->GetProperties()->SetLocked(false);
 
         SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI();
         //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
@@ -387,13 +373,13 @@ SMESH_Swig::Init(int theStudyID)
         aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
         aPixmap->UnRegister();
 
-        SALOMEDS::UseCaseBuilder_var useCaseBuilder = myStudy->GetUseCaseBuilder();
+        SALOMEDS::UseCaseBuilder_var useCaseBuilder = KERNEL::getStudyServant()->GetUseCaseBuilder();
         useCaseBuilder->SetRootCurrent();
         useCaseBuilder->Append( aSComponent.in() );
   
         myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
         if (aLocked)
-          myStudy->GetProperties()->SetLocked(true);
+          KERNEL::getStudyServant()->GetProperties()->SetLocked(true);
       }
 
       mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
@@ -404,9 +390,7 @@ SMESH_Swig::Init(int theStudyID)
 
   //MESSAGE("Init");
 
-  ProcessVoidEvent(new TEvent(theStudyID,
-                              myStudy,
-                              myStudyBuilder,
+  ProcessVoidEvent(new TEvent(myStudyBuilder,
                               mySComponentMesh));
 }
 
@@ -423,7 +407,7 @@ const char* SMESH_Swig::AddNewMesh(const char* theIOR)
 {
 
   // VSR: added temporarily - to be removed - objects are published automatically by engine
-  SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
+  SALOMEDS::SObject_var aSObject = KERNEL::getStudyServant()->FindObjectIOR(theIOR);
   if (aSObject->_is_nil())
   {
     //Find or Create Hypothesis root
@@ -482,8 +466,8 @@ const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
 void SMESH_Swig::SetShape(const char* theShapeEntry,
                           const char* theMeshEntry)
 {
-  SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
-  SALOMEDS::SObject_var      aMeshSO = myStudy->FindObjectID( theMeshEntry );
+  SALOMEDS::SObject_var aGeomShapeSO = KERNEL::getStudyServant()->FindObjectID( theShapeEntry );
+  SALOMEDS::SObject_var      aMeshSO = KERNEL::getStudyServant()->FindObjectID( theMeshEntry );
 
   if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
     SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
@@ -501,7 +485,6 @@ void SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
 {
   ::SetHypothesis(theMeshOrSubMeshEntry,
                   theDomainEntry,
-                  myStudy,
                   myStudyBuilder);
 }
 
@@ -512,7 +495,6 @@ void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
 {
   ::SetAlgorithms(theMeshOrSubMeshEntry,
                   theDomainEntry,
-                  myStudy,
                   myStudyBuilder);
 }
 
@@ -521,7 +503,7 @@ void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
 void
 SMESH_Swig::UnSetHypothesis(const char* theDomainEntry)
 {
-  SALOMEDS::SObject_var aDomainSO = myStudy->FindObjectID(theDomainEntry);
+  SALOMEDS::SObject_var aDomainSO = KERNEL::getStudyServant()->FindObjectID(theDomainEntry);
   if(!aDomainSO->_is_nil())
     myStudyBuilder->RemoveObject(aDomainSO);
 }
@@ -530,7 +512,7 @@ const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
                                    const char* theSubMeshIOR,
                                    int theShapeType)
 {
-  SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
+  SALOMEDS::SObject_var aMeshSO = KERNEL::getStudyServant()->FindObjectID(theMeshEntry);
   if(!aMeshSO->_is_nil()) {
     long aShapeTag;
     QString aSubMeshName;
@@ -593,11 +575,11 @@ const char* SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
                                           const char* theSubMeshIOR,
                                           int         ShapeType)
 {
-  SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
+  SALOMEDS::SObject_var aGeomShapeSO = KERNEL::getStudyServant()->FindObjectID(theGeomShapeEntry);
   if(!aGeomShapeSO->_is_nil())
   {
     const char *       aSubMeshEntry = AddSubMesh(theMeshEntry,theSubMeshIOR,ShapeType);
-    SALOMEDS::SObject_var aSubMeshSO = myStudy->FindObjectID(aSubMeshEntry);
+    SALOMEDS::SObject_var aSubMeshSO = KERNEL::getStudyServant()->FindObjectID(aSubMeshEntry);
     if ( !aSubMeshSO->_is_nil()) {
       SetShape( theGeomShapeEntry, aSubMeshEntry );
       CORBA::String_var aString = aSubMeshSO->GetID();
@@ -818,7 +800,7 @@ void SMESH_Swig::EraseActor( const char* Mesh_Entry, const bool allViewers )
 void SMESH_Swig::SetName(const char* theEntry,
                          const char* theName)
 {
-  SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
+  SALOMEDS::SObject_var aSObject = KERNEL::getStudyServant()->FindObjectID(theEntry);
   SALOMEDS::GenericAttribute_var anAttr;
   SALOMEDS::AttributeName_var aName;
   if(!aSObject->_is_nil()){
@@ -844,15 +826,12 @@ void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
 {
   class TEvent: public SALOME_Event
   {
-    SALOMEDS::Study_var myStudy;
     std::string         myMeshEntry;
     bool                myIsComputed, myIsEmpty;
   public:
-    TEvent(const SALOMEDS::Study_var& theStudy,
-           const std::string&         theMeshEntry,
+    TEvent(const std::string&         theMeshEntry,
            const bool                 theIsComputed,
            const bool                 isEmpty):
-      myStudy     (theStudy),
       myMeshEntry (theMeshEntry),
       myIsComputed(theIsComputed),
       myIsEmpty   (isEmpty)
@@ -862,15 +841,14 @@ void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
     void
     Execute()
     {
-      SALOMEDS::SObject_ptr aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
+      SALOMEDS::SObject_ptr aMeshSO = KERNEL::getStudyServant()->FindObjectID(myMeshEntry.c_str());
       if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
         SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
       // aMeshSO->UnRegister();  ~aMesh() already called UnRegister()!
     }
   };
 
-  ProcessVoidEvent(new TEvent(myStudy,
-                              theMeshEntry,
+  ProcessVoidEvent(new TEvent(theMeshEntry,
                               theIsComputed,
                               isEmpty));
 }
index 86682ff5b79baa3465050fe6d74d9862fefae85e..ae0f32dcfdcfc4edde940d707435827772e20cd9 100644 (file)
@@ -95,7 +95,7 @@ public:
   SMESH_Swig();
   ~SMESH_Swig();
     
-  void                       Init( int );
+  void                       Init();
 
   const char*                AddNewMesh( const char* );
 
@@ -134,7 +134,6 @@ public:
   void select( const char *id, int id1, bool append = false );
 
 private:
-  SALOMEDS::Study_var        myStudy;
   SALOMEDS::StudyBuilder_var myStudyBuilder;
   SALOMEDS::SComponent_var   mySComponentMesh;
 };
index ac732d4672e8f64d8626a71b65cd20528cbd8f98..fa59fbeaa8f5d1c3ca04dd97f3df67e806a17e03 100644 (file)
@@ -105,7 +105,7 @@ class SMESH_Swig
   SMESH_Swig();
   ~SMESH_Swig();
 
-  void Init(int studyID);
+  void Init();
 
   const char* AddNewMesh(const char* IOR);
   const char* AddNewHypothesis(const char* IOR);
index ba2e031ac96c00f8c70f1a5b408b45d1e26a4638..8d98249022e7c0f9b0028b576e6b394ed347d4c8 100644 (file)
@@ -155,7 +155,7 @@ namespace // internal utils
   class AdaptiveAlgo : public StdMeshers_Regular_1D
   {
   public:
-    AdaptiveAlgo(int hypId, int studyId, SMESH_Gen* gen);
+    AdaptiveAlgo(int hypId, SMESH_Gen* gen);
     virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape );
     virtual bool Evaluate(SMESH_Mesh &         theMesh,
                           const TopoDS_Shape & theShape,
@@ -916,9 +916,8 @@ namespace // internal utils
 //function : StdMeshers_Adaptive1D
 //purpose  : Constructor
 StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(int         hypId,
-                                             int         studyId,
                                              SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   myMinSize       = 1e-10;
   myMaxSize       = 1e+10;
@@ -1076,7 +1075,7 @@ SMESH_Algo* StdMeshers_Adaptive1D::GetAlgo() const
   if ( !myAlgo )
   {
     AdaptiveAlgo* newAlgo = 
-      new AdaptiveAlgo( _gen->GetANewId(), _studyId, _gen );
+      new AdaptiveAlgo( _gen->GetANewId(), _gen );
     newAlgo->SetHypothesis( this );
 
     ((StdMeshers_Adaptive1D*) this)->myAlgo = newAlgo;
@@ -1091,9 +1090,8 @@ SMESH_Algo* StdMeshers_Adaptive1D::GetAlgo() const
 //================================================================================
 
 AdaptiveAlgo::AdaptiveAlgo(int        hypId,
-                           int        studyId,
                            SMESH_Gen* gen)
-  : StdMeshers_Regular_1D( hypId, studyId, gen ),
+  : StdMeshers_Regular_1D( hypId, gen ),
     myHyp(NULL)
 {
   _name = "AdaptiveAlgo_1D";
index 601aeae0b05198156e629cd5a9dbd573efa1e1f6..39ea38e876d641d9d9f7d4f25a593708f0d77b13 100644 (file)
@@ -37,7 +37,7 @@
 class STDMESHERS_EXPORT StdMeshers_Adaptive1D : public SMESH_Hypothesis
 {
  public:
-  StdMeshers_Adaptive1D(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_Adaptive1D(int hypId, SMESH_Gen * gen);
   ~StdMeshers_Adaptive1D();
 
   /*!
index a06202a8e925228ae6311d830df07c65f16bdfa8..629ade75fa65025f4555b14a9941a2594e882d97 100644 (file)
@@ -48,8 +48,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, SMESH_Gen * gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _begLength = 1.;
   _endLength = 10.;
index 8705897525c16b78a1b2146e5cfe5444de22e87d..7dd89459be51a82dbc8a2f63047af03e44e8f2b6 100644 (file)
@@ -41,7 +41,7 @@ class STDMESHERS_EXPORT StdMeshers_Arithmetic1D:
   public SMESH_Hypothesis
 {
 public:
-  StdMeshers_Arithmetic1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Arithmetic1D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Arithmetic1D();
 
   void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
index ad5f5263f42152e2100bbfa441c0470d718e2e70..f3fb2428f65d1e1cc32d73a808977ad87c1f8f02 100644 (file)
@@ -47,8 +47,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_AutomaticLength::StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_AutomaticLength::StdMeshers_AutomaticLength(int hypId, SMESH_Gen * gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _name = "AutomaticLength";
   _param_algo_dim = 1; // is used by SMESH_Regular_1D
index 2e30f8c106f4378a3ea97eb13a558444a3829839..f9188e374c07865f96bcfcd1f091fdd3f211f90c 100644 (file)
@@ -49,7 +49,7 @@ class TopoDS_TShape;
 class STDMESHERS_EXPORT StdMeshers_AutomaticLength:public SMESH_Hypothesis
 {
 public:
-  StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_AutomaticLength(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_AutomaticLength();
 
   /*!
index f55687ca3ead5a1d620edcf7fa12213d71735f36..ea5f440cc8cca93ae7e1bffa801260ae6ffa0cda 100644 (file)
@@ -61,9 +61,8 @@ using namespace std;
 //=======================================================================
 
 StdMeshers_CartesianParameters3D::StdMeshers_CartesianParameters3D(int         hypId,
-                                                                   int         studyId,
                                                                    SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
+  : SMESH_Hypothesis(hypId, gen),
     _sizeThreshold( 4.0 ), // default according to the customer specification
     _toAddEdges( false )
 {
index f87cd346bc17e602274ef88f4f5e82f4f02049b3..e5ef065ccd75b3942a6701bbc032e1fb95c21621 100644 (file)
@@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_CartesianParameters3D:  public SMESH_Hypothes
 {
 public:
   // Constructor
-  StdMeshers_CartesianParameters3D( int hypId, int studyId, SMESH_Gen * gen );
+  StdMeshers_CartesianParameters3D( int hypId, SMESH_Gen * gen );
 
   /*!
    * Sets coordinates of node positions along an axis (countered from 0)
index aebd779eea189c77019b1ac01a7b7bc6ea636687..4220d7d18211ae7f39086b4c9a860b2e8d4a681b 100644 (file)
@@ -108,8 +108,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(int hypId, SMESH_Gen * gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "Cartesian_3D";
   _shapeType = (1 << TopAbs_SOLID);       // 1 bit /shape type
index 2cc4855015a0bad836c02ca2f8cf002939358366..91e0587127116256c9ac7977d17432f1a2330bae 100644 (file)
@@ -41,7 +41,7 @@ class StdMeshers_CartesianParameters3D;
 class STDMESHERS_EXPORT StdMeshers_Cartesian_3D : public SMESH_3D_Algo
 {
 public:
-  StdMeshers_Cartesian_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Cartesian_3D(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
                                const TopoDS_Shape& aShape,
index d80d072a928b1ff93f40043b8857f985d95e910a..431de7ef9cc0bc1cf66e6e043eda2a246b5bf5cb 100644 (file)
@@ -267,8 +267,8 @@ private:
  */
 //================================================================================
 
-StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "CompositeHexa_3D";
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
index f1082b73f02278a6c628ec363925a5b74f2913b7..0b8e8f80d0a6e8a38325bfde41e609a175c27776 100644 (file)
@@ -42,7 +42,7 @@ struct _QuadFaceGrid;
 class STDMESHERS_EXPORT StdMeshers_CompositeHexa_3D: public SMESH_3D_Algo
 {
 public:
-  StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen);
   //virtual ~StdMeshers_CompositeHexa_3D();
 
   virtual bool Compute(SMESH_Mesh&         aMesh,
index 9a66a56334c295bb11f540a4f5269b1fcdc3edfc..3992bc81add4db55f2f1c76d67818ecdc66049dc 100644 (file)
@@ -243,9 +243,8 @@ namespace {
 //=============================================================================
 
 StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D(int         hypId,
-                                                               int         studyId,
                                                                SMESH_Gen * gen)
-  :StdMeshers_Regular_1D(hypId, studyId, gen)
+  :StdMeshers_Regular_1D(hypId, gen)
 {
   _name = AlgoName();
 }
index 5380a65f551ada40df36f02ec855545f1d43efbd..86436bd1839f727ca631f73ac23504b81d98de43 100644 (file)
@@ -39,7 +39,7 @@ class TopoDS_Face;
 class STDMESHERS_EXPORT StdMeshers_CompositeSegment_1D: public StdMeshers_Regular_1D
 {
 public:
-  StdMeshers_CompositeSegment_1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_CompositeSegment_1D(int hypId, SMESH_Gen* gen);
 
   virtual bool Compute(SMESH_Mesh&         aMesh,
                        const TopoDS_Shape& aShape);
index 6181e8cbf2c9e742d2cdaaed52490592ecd45b0e..2db55f223e851bd1e93d654b06e7fd762b79d8d8 100644 (file)
@@ -50,9 +50,8 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Deflection1D::StdMeshers_Deflection1D(int         hypId,
-                                                 int         studyId,
                                                  SMESH_Gen * gen)
-     :SMESH_Hypothesis(hypId, studyId, gen)
+     :SMESH_Hypothesis(hypId, gen)
 {
   _value = 1.;
   _name = "Deflection1D";
index 664a4a094712833deb6fe53de35c317a667e279f..34a2d34ee65c110b8fca2dc58ea4f87725b181a3 100644 (file)
@@ -35,7 +35,7 @@
 class STDMESHERS_EXPORT StdMeshers_Deflection1D:public SMESH_Hypothesis
 {
  public:
-  StdMeshers_Deflection1D(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_Deflection1D(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_Deflection1D();
 
   void SetDeflection(double value) throw(SALOME_Exception);
index 9f5929e3681a9a4bcb5b2957c64bf752ac1781f6..b0d36a59ccb5bd25c9f7aa58a6a9006e4b6e2605 100644 (file)
@@ -88,13 +88,13 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&   theFace,
  */
 //================================================================================
 
-StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&      theFace,
-                                         std::list<TopoDS_Edge>& theEdges,
-                                         SMESH_Mesh*             theMesh,
-                                         const bool              theIsForward,
-                                         const bool              theIgnoreMediumNodes,
-                                         SMESH_MesherHelper*     theFaceHelper,
-                                         SMESH_ProxyMesh::Ptr    theProxyMesh)
+StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&            theFace,
+                                         const std::list<TopoDS_Edge>& theEdges,
+                                         SMESH_Mesh*                   theMesh,
+                                         const bool                    theIsForward,
+                                         const bool                    theIgnoreMediumNodes,
+                                         SMESH_MesherHelper*           theFaceHelper,
+                                         SMESH_ProxyMesh::Ptr          theProxyMesh)
 {
   int nbEdges = theEdges.size();
   myEdge.resize      ( nbEdges );
@@ -125,7 +125,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&      theFace,
   SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
 
   int nbDegen = 0;
-  std::list<TopoDS_Edge>::iterator edge = theEdges.begin();
+  std::list<TopoDS_Edge>::const_iterator edge = theEdges.begin();
   for ( int index = 0; edge != theEdges.end(); ++index, ++edge )
   {
     int i = theIsForward ? index : nbEdges-index-1;
@@ -166,6 +166,14 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&      theFace,
         myC3dAdaptor[i].Load( C3d, 0, 0.5 * BRep_Tool::Tolerance( V ));
       }
     }
+    else if ( myEdgeLength[i] > DBL_MIN )
+    {
+      Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],myFirst[i], myLast[i] );
+      myC3dAdaptor[i].Load( C3d, myFirst[i], myLast[i] );
+      if ( myEdge[i].Orientation() == TopAbs_REVERSED )
+        std::swap( myFirst[i], myLast[i] );
+    }
+
     // reverse a proxy sub-mesh
     if ( !theIsForward )
       reverseProxySubmesh( myEdge[i] );
@@ -1243,7 +1251,7 @@ gp_Pnt StdMeshers_FaceSide::Value3d(double U) const
   // check parametrization of curve
   if( !myIsUniform[i] )
   {
-    double aLen3dU = r * myEdgeLength[i] * ( myFirst[i]>myLast[i] ? -1. : 1.);
+    double aLen3dU = r * myEdgeLength[i] * ( myFirst[i] > myLast[i] ? -1. : 1. );
     GCPnts_AbscissaPoint AbPnt
       ( const_cast<GeomAdaptor_Curve&>( myC3dAdaptor[i]), aLen3dU, myFirst[i] );
     if( AbPnt.IsDone() ) {
index 6759f50a920ce7ccbd08c67e1b46c9a9b0c239f5..1964638fea6b65467a415bc6fff2a38d092b529b 100644 (file)
@@ -82,13 +82,13 @@ public:
   /*!
    * \brief Wrap several edges. Edges must be properly ordered and oriented.
    */
-  StdMeshers_FaceSide(const TopoDS_Face&      theFace,
-                      std::list<TopoDS_Edge>& theEdges,
-                      SMESH_Mesh*             theMesh,
-                      const bool              theIsForward,
-                      const bool              theIgnoreMediumNodes,
-                      SMESH_MesherHelper*     theFaceHelper = NULL,
-                      SMESH_ProxyMesh::Ptr    theProxyMesh = SMESH_ProxyMesh::Ptr());
+  StdMeshers_FaceSide(const TopoDS_Face&            theFace,
+                      const std::list<TopoDS_Edge>& theEdges,
+                      SMESH_Mesh*                   theMesh,
+                      const bool                    theIsForward,
+                      const bool                    theIgnoreMediumNodes,
+                      SMESH_MesherHelper*           theFaceHelper = NULL,
+                      SMESH_ProxyMesh::Ptr          theProxyMesh = SMESH_ProxyMesh::Ptr());
   /*!
    * \brief Simulate a side from a vertex using data from other FaceSide
    */
@@ -120,13 +120,13 @@ public:
   { return StdMeshers_FaceSidePtr
       ( new StdMeshers_FaceSide( Face,Edge,Mesh,IsForward,IgnoreMediumNodes,FaceHelper,ProxyMesh ));
   }
-  static StdMeshers_FaceSidePtr New (const TopoDS_Face&      Face,
-                                     std::list<TopoDS_Edge>& Edges,
-                                     SMESH_Mesh*             Mesh,
-                                     const bool              IsForward,
-                                     const bool              IgnoreMediumNodes,
-                                     SMESH_MesherHelper*     FaceHelper = NULL,
-                                     SMESH_ProxyMesh::Ptr    ProxyMesh = SMESH_ProxyMesh::Ptr())
+  static StdMeshers_FaceSidePtr New (const TopoDS_Face&            Face,
+                                     const std::list<TopoDS_Edge>& Edges,
+                                     SMESH_Mesh*                   Mesh,
+                                     const bool                    IsForward,
+                                     const bool                    IgnoreMediumNodes,
+                                     SMESH_MesherHelper*           FaceHelper = NULL,
+                                     SMESH_ProxyMesh::Ptr          ProxyMesh = SMESH_ProxyMesh::Ptr())
   { return StdMeshers_FaceSidePtr
       ( new StdMeshers_FaceSide( Face,Edges,Mesh,IsForward,IgnoreMediumNodes,FaceHelper,ProxyMesh ));
   }
@@ -141,9 +141,11 @@ public:
       ( new StdMeshers_FaceSide( Side,Node,Pnt2d1,Pnt2d2,C2d,UFirst,ULast ));
   }
   static StdMeshers_FaceSidePtr New (UVPtStructVec&     theSideNodes,
-                                     const TopoDS_Face& theFace = TopoDS_Face())
+                                     const TopoDS_Face& theFace = TopoDS_Face(),
+                                     const TopoDS_Edge& theEdge = TopoDS_Edge(),
+                                     SMESH_Mesh*        theMesh = 0)
   {
-    return StdMeshers_FaceSidePtr( new StdMeshers_FaceSide( theSideNodes, theFace ));
+    return StdMeshers_FaceSidePtr( new StdMeshers_FaceSide( theSideNodes, theFace, theEdge, theMesh ));
   }
 
   /*!
index e316cb11af7bee8039e66d0d8c10d8a935207fa6..9f32b2d862f8196203af2e5d7e31644fb313448d 100644 (file)
@@ -35,9 +35,9 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId, int studyId,
+StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId,
                                                    SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _name = "FixedPoints1D";
   _param_algo_dim = 1;
index 4855f03074fc8ad227b42f42616cfd3ac390107f..f8d8f6a755962e37aa44bf311a0b8730db669b56 100644 (file)
@@ -38,7 +38,7 @@ class STDMESHERS_EXPORT StdMeshers_FixedPoints1D:
   public SMESH_Hypothesis
 {
 public:
-  StdMeshers_FixedPoints1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_FixedPoints1D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_FixedPoints1D();
 
   void SetPoints(std::vector<double>& listParams)
index 33b091783985e0b21ca881ca7a118ff52eed1511..b7eafade5dd0f93c4e122ff3f09810cd17180009 100644 (file)
@@ -42,8 +42,8 @@
  */
 //=============================================================================
 
-StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen * gen)
-  :StdMeshers_Reversible1D(hypId, studyId, gen)
+StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, SMESH_Gen * gen)
+  :StdMeshers_Reversible1D(hypId, gen)
 {
   _begLength = 1.;
   _ratio = 1.;
index 1dc38b1e2443a9c9ef07d05db745f22393999826..8810ad9855ffa7c9c629ca1a34a5e1f61ad964ca 100644 (file)
@@ -35,7 +35,7 @@
 class STDMESHERS_EXPORT StdMeshers_Geometric1D: public StdMeshers_Reversible1D
 {
 public:
-  StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Geometric1D(int hypId, SMESH_Gen* gen);
 
   void SetStartLength(double length) throw(SALOME_Exception);
   void SetCommonRatio(double factor) throw(SALOME_Exception);
index 12ae7326fe23332323e1de39f919cb7ae1efed15..13c897d1828ed487c7f44f699420bddea39fbc85 100644 (file)
@@ -1022,8 +1022,8 @@ namespace
 //purpose  : 
 //=======================================================================
 
-StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, SMESH_Gen* gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "HexaFromSkin_3D";
 }
index d694319772d86165ccc29e939f6e148fd7be17f2..e530ffeb159703b37d3016fdf3215f9573a24484 100644 (file)
@@ -34,7 +34,7 @@
 class STDMESHERS_EXPORT StdMeshers_HexaFromSkin_3D : public SMESH_3D_Algo
 {
 public:
-  StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_HexaFromSkin_3D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_HexaFromSkin_3D();
 
   virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
index 335a36a788b8cea444ca57efa21dc221dca77efd..a968121c58e6fda028db3d8c65cee8487daacbef 100644 (file)
@@ -70,8 +70,8 @@ static bool EvaluatePentahedralMesh(SMESH_Mesh &, const TopoDS_Shape &,
  */
 //=============================================================================
 
-StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, SMESH_Gen * gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "Hexa_3D";
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
@@ -367,7 +367,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   TopExp::MapShapes( aShape, TopAbs_FACE, FF);
   if ( FF.Extent() != 6)
   {
-    static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), 0, _gen);
+    static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), _gen);
     if ( !compositeHexa.Compute( aMesh, aShape ))
       return error( compositeHexa.GetComputeError() );
     return true;
@@ -377,7 +377,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   // ---------------------
   
   FaceQuadStructPtr quad[ 6 ];
-  StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen);
+  StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), _gen);
   for ( int i = 0; i < 6; ++i )
   {
     if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ),
@@ -699,7 +699,7 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
   }
   if (meshFaces.size() != 6) {
     //return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in a block");
-    static StdMeshers_CompositeHexa_3D compositeHexa(-10, 0, aMesh.GetGen());
+    static StdMeshers_CompositeHexa_3D compositeHexa(-10, aMesh.GetGen());
     return compositeHexa.Evaluate(aMesh, aShape, aResMap);
   }
   
@@ -809,7 +809,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper
   static StdMeshers_HexaFromSkin_3D * algo = 0;
   if ( !algo ) {
     SMESH_Gen* gen = aMesh.GetGen();
-    algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), 0, gen );
+    algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), gen );
   }
   algo->InitComputeError();
   algo->Compute( aMesh, aHelper );
@@ -877,7 +877,7 @@ SMESH_ComputeErrorPtr ComputePentahedralMesh(SMESH_Mesh &          aMesh,
     static StdMeshers_Prism_3D * aPrism3D = 0;
     if ( !aPrism3D ) {
       SMESH_Gen* gen = aMesh.GetGen();
-      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), 0, gen );
+      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), gen );
     }
     SMESH_Hypothesis::Hypothesis_Status aStatus;
     if ( aPrism3D->CheckHypothesis( aMesh, aShape, aStatus ) ) {
@@ -908,7 +908,7 @@ bool EvaluatePentahedralMesh(SMESH_Mesh & aMesh,
     static StdMeshers_Prism_3D * aPrism3D = 0;
     if ( !aPrism3D ) {
       SMESH_Gen* gen = aMesh.GetGen();
-      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), 0, gen );
+      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), gen );
     }
     SMESH_Hypothesis::Hypothesis_Status aStatus;
     if ( aPrism3D->CheckHypothesis( aMesh, aShape, aStatus ) ) {
index 3673cdba94bce03dba713c5b3dd18719ca512069..2f50e330f7eba7f3ed0246cd679e3faa2f2c2c15 100644 (file)
@@ -40,7 +40,7 @@ class SMESH_MesherHelper;
 class STDMESHERS_EXPORT StdMeshers_Hexa_3D : public SMESH_3D_Algo
 {
 public:
-  StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Hexa_3D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Hexa_3D();
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
@@ -54,6 +54,10 @@ public:
   virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
                         MapShapeNbElems& aResMap);
 
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
 
  protected:
index 0ee9c4b4130e3c4d3a657be6f6de35863f08739d..b737c57563a678fa75902b47adb47b337181e2e6 100644 (file)
@@ -49,9 +49,8 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(int         hypId,
-                                                     int         studyId,
                                                      SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen),
+  :SMESH_Hypothesis(hypId, gen),
    _toCopyMesh(false),
    _toCopyGroups(false)
 {
@@ -66,9 +65,8 @@ StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(int         hypId,
 //=============================================================================
 
 StdMeshers_ImportSource2D::StdMeshers_ImportSource2D(int         hypId,
-                                                     int         studyId,
                                                      SMESH_Gen * gen)
-  :StdMeshers_ImportSource1D(hypId, studyId, gen)
+  :StdMeshers_ImportSource1D(hypId, gen)
 {
   _name = "ImportSource2D";
   _param_algo_dim = 2; // is used by StdMeshers_Import_2D;
@@ -206,7 +204,7 @@ const std::vector<SMESH_Group*>&  StdMeshers_ImportSource1D::GetGroups(bool load
 {
   // filter off deleted groups
   vector<SMESH_Group*> okGroups = getValidGroups( _groups,
-                                                  _gen->GetStudyContext(_studyId),
+                                                  _gen->GetStudyContext(),
                                                   loaded);
   if ( okGroups.size() != _groups.size() )
     ((StdMeshers_ImportSource1D*)this)->_groups = okGroups;
@@ -247,7 +245,7 @@ std::vector<SMESH_Mesh*> StdMeshers_ImportSource1D::GetSourceMeshes() const
   vector<SMESH_Mesh*> meshes;
   if ( !meshIDs.empty() )
   {
-    StudyContextStruct* studyContext = _gen->GetStudyContext(_studyId);
+    StudyContextStruct* studyContext = _gen->GetStudyContext();
     for ( set<int>::iterator id = meshIDs.begin(); id != meshIDs.end(); ++id )
     {
       map<int, SMESH_Mesh*>::iterator itm = studyContext->mapMesh.begin();
@@ -400,7 +398,7 @@ void StdMeshers_ImportSource1D::RestoreGroups(const std::vector<SMESH_Group*>& g
     int key1 = _resultGroupsStorage[i++];
     int key2 = _resultGroupsStorage[i++];
     pair<int, int> resMapKey( key1, key2 );
-    SMESH_Mesh* mesh = getTgtMeshByKey( resMapKey, _gen->GetStudyContext(_studyId));
+    SMESH_Mesh* mesh = getTgtMeshByKey( resMapKey, _gen->GetStudyContext());
     // restore mesh ids at least
     _resultGroups.insert( make_pair (resMapKey,vector<SMESH_Group*>() )); 
 
@@ -463,7 +461,7 @@ StdMeshers_ImportSource1D::GetResultGroups(const SMESHDS_Mesh& srcMesh,
   if ( key2groups == _resultGroups.end() )
     return 0;
   vector<SMESH_Group*> vec = getValidGroups((*key2groups).second,
-                                            _gen->GetStudyContext(_studyId) );
+                                            _gen->GetStudyContext() );
   if ( vec.size() != key2groups->second.size())
     key2groups->second = vec;
 
index c4d40d00586a7abab27740c9dac0af4603dc485a..cb2febf3b8524c74423f439c61bb044f8ed7447a 100644 (file)
@@ -48,7 +48,7 @@ class SMESH_subMesh;
 class STDMESHERS_EXPORT StdMeshers_ImportSource1D : public SMESH_Hypothesis
 {
  public:
-  StdMeshers_ImportSource1D(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_ImportSource1D(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_ImportSource1D();
 
   void SetGroups(const std::vector<SMESH_Group*>& groups);
@@ -95,6 +95,6 @@ private:
 class STDMESHERS_EXPORT StdMeshers_ImportSource2D : public StdMeshers_ImportSource1D
 {
  public:
-  StdMeshers_ImportSource2D(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_ImportSource2D(int hypId, SMESH_Gen * gen);
 };
 #endif
index 193448010e2ca3ae596a8d70a97d2678e8215c41..61b6cf65b7bca7c20f4ce2b8ec81256b86d86387 100644 (file)
@@ -60,8 +60,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_1D_Algo(hypId, studyId, gen), _sourceHyp(0)
+StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, SMESH_Gen * gen)
+  :SMESH_1D_Algo(hypId, gen), _sourceHyp(0)
 {
   _name = "Import_1D";
   _shapeType = (1 << TopAbs_EDGE);
index 2c016630848dea419d60d36c62e71b0ff82b25c7..bbd752247c0624b7ac082e73e494cb325d355c3e 100644 (file)
@@ -39,7 +39,7 @@ class StdMeshers_ImportSource1D;
 class STDMESHERS_EXPORT StdMeshers_Import_1D: public SMESH_1D_Algo
 {
 public:
-  StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Import_1D(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
                                const TopoDS_Shape& aShape,
index 0d4a369e881b5970018fe4e2d679ea76caefd457..e0e2df6664e4181ebdf98d7e3cc4fc5f1133c272 100644 (file)
@@ -95,8 +95,8 @@ namespace
  */
 //=============================================================================
 
-StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_2D_Algo(hypId, studyId, gen), _sourceHyp(0)
+StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, SMESH_Gen * gen)
+  :SMESH_2D_Algo(hypId, gen), _sourceHyp(0)
 {
   _name = "Import_1D2D";
   _shapeType = (1 << TopAbs_FACE);
index a260f1d2d7cd69104b5e465005ca4a79eb89208e..8dc16d87e10e9e289767acab00e42bad821bbea9 100644 (file)
@@ -39,7 +39,7 @@ class StdMeshers_ImportSource1D;
 class STDMESHERS_EXPORT StdMeshers_Import_1D2D: public SMESH_2D_Algo
 {
 public:
-  StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Import_1D2D(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
                                const TopoDS_Shape& aShape,
index 05f0b2fd62e1503d9d1878e190155d364c8ba8c9..8a12ac3d2e3abaa5f9a37a4d6c64a13c8bb497bd 100644 (file)
@@ -40,9 +40,9 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId, int studyId,
+StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId,
                                                            SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "LayerDistribution"; // used by RadialPrism_3D
   _param_algo_dim = 3; // 3D
index 8f7fb5e970a7aafc81b233d51ad056484026f4d7..7e3fe8384ed5a4c0a85363a497647c1aea98af1b 100644 (file)
@@ -51,7 +51,7 @@ class STDMESHERS_EXPORT StdMeshers_LayerDistribution:  public SMESH_Hypothesis
 {
 public:
   // Constructor
-  StdMeshers_LayerDistribution( int hypId, int studyId, SMESH_Gen * gen );
+  StdMeshers_LayerDistribution( int hypId, SMESH_Gen * gen );
   // Destructor
   virtual ~StdMeshers_LayerDistribution();
 
index 664995684537c90450d3f1f3976160a2d17567bf..75cdd43f962604a927c39420d951d37a814bfa1f 100644 (file)
@@ -36,9 +36,8 @@
 //=============================================================================
 
 StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D(int hypId,
-                                                               int studyId,
                                                                SMESH_Gen * gen)
-  : StdMeshers_LayerDistribution(hypId, studyId, gen)
+  : StdMeshers_LayerDistribution(hypId, gen)
 {
   _name = "LayerDistribution2D"; // used by RadialQuadrangle_1D2D
   _param_algo_dim = 2; // 2D
index 91510d103d488d6c4f9fba3d4e07165d509e1380..704b59f5e72dfa26ea5228eaf1ebc832c7fa707f 100644 (file)
@@ -43,7 +43,7 @@ class STDMESHERS_EXPORT StdMeshers_LayerDistribution2D
 {
 public:
   // Constructor
-  StdMeshers_LayerDistribution2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_LayerDistribution2D(int hypId, SMESH_Gen* gen);
   // Destructor
   virtual ~StdMeshers_LayerDistribution2D();
 
index 026d858ae7d0006b03f784608cc4eebc0c436db7..3bcb1f6e5ed69f5ef28c549d765b95ab1238cb7f 100644 (file)
@@ -38,8 +38,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(int hypId, SMESH_Gen* gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _mode =1;
   _name = "LengthFromEdges";
index 1d210433cb4937eb4286ff890e4d477d79fdab91..7b7cd162dda6b77657616a1b32205549849e6e20 100644 (file)
@@ -38,7 +38,7 @@ class STDMESHERS_EXPORT StdMeshers_LengthFromEdges:
   public SMESH_Hypothesis
 {
 public:
-  StdMeshers_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_LengthFromEdges(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_LengthFromEdges();
 
   void SetMode(int mode)
index d4ebdfb0afb94f1ac27522bbbc1af8f6ecf312a9..898d940f4ed19d14b6dfa7559b0aaa52112b755b 100644 (file)
@@ -52,8 +52,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_LocalLength::StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_LocalLength::StdMeshers_LocalLength(int hypId, SMESH_Gen * gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _length = 1.;
   _precision = Precision::Confusion();
index c6de5797be915781f04442db175dd1b1cb8b5312..29f6b166dd2fd873e2efa8fd4363c91de9b68965 100644 (file)
@@ -37,7 +37,7 @@
 class STDMESHERS_EXPORT StdMeshers_LocalLength: public SMESH_Hypothesis
 {
  public:
-  StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_LocalLength(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_LocalLength();
 
   void SetLength(double length) throw(SALOME_Exception);
index 972d4b12c04314e0fdf18256625d2a0da1cc0f40..50b79a6cc568381eb920532ff618b3eac746d316 100644 (file)
@@ -79,8 +79,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, int studyId, SMESH_Gen * gen):
-  SMESH_2D_Algo(hypId, studyId, gen)
+StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, SMESH_Gen * gen):
+  SMESH_2D_Algo(hypId, gen)
 {
   _name = "MEFISTO_2D";
   _shapeType = (1 << TopAbs_FACE);
index 3c9d69b9be48295a404510ff9ee1812a6a5d9048..bcf22d59e3dff5a6eecff7fa8a1b285cf77dc1ad 100644 (file)
@@ -47,7 +47,7 @@ class StdMeshers_FaceSide;
 class STDMESHERS_EXPORT StdMeshers_MEFISTO_2D: public SMESH_2D_Algo
 {
 public:
-  StdMeshers_MEFISTO_2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_MEFISTO_2D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_MEFISTO_2D();
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
index 513536da152b8d91226be22ecd21c46d0954a8bf..77cefa46e9e5b34b38af6d445ea800f8767e8847 100644 (file)
@@ -48,8 +48,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(int hypId, SMESH_Gen* gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _maxArea =1.;
   _name = "MaxElementArea";
index 187c514c1d97f382ebb038f443abdf6fe2ad6a2e..10de97599f8ba65105cd46c36d0837b0846747ee 100644 (file)
@@ -37,7 +37,7 @@
 class STDMESHERS_EXPORT StdMeshers_MaxElementArea:public SMESH_Hypothesis
 {
 public:
-  StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_MaxElementArea(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_MaxElementArea();
 
   void SetMaxArea(double maxArea) throw(SALOME_Exception);
index 7cdb3e488a6b9497011a9f351c037a68e0e284e3..86c4f2aa4e5dbe2fa40f7c306e2c1f7683c3cb1c 100644 (file)
@@ -48,8 +48,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(int hypId, SMESH_Gen* gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _maxVolume = 1.;
   _name = "MaxElementVolume";
index 88d0218c9cbd2b7e4f5083c53e6e5db87764f3c4..3ad0e6175200924262c29ce408ab2cf7df4f9f00 100644 (file)
@@ -38,7 +38,7 @@ class STDMESHERS_EXPORT StdMeshers_MaxElementVolume:
   public SMESH_Hypothesis
 {
 public:
-  StdMeshers_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_MaxElementVolume(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_MaxElementVolume();
 
   void SetMaxVolume(double maxVolume)
index a5774bbc7e17516b84ba912f2de133eed84b5769..7b0d7fbb6cae218dddf16434464583a46b5f936a 100644 (file)
@@ -47,8 +47,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_MaxLength::StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_MaxLength::StdMeshers_MaxLength(int hypId, SMESH_Gen * gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _length = 1.;
   _preestimated = 0.;
index 1024d6af5c6458a46cb0cc672e71b6b119167a65..575bbaafd0a365924c8f6d530062a00da1fb0a87 100644 (file)
@@ -32,7 +32,7 @@
 class STDMESHERS_EXPORT StdMeshers_MaxLength: public SMESH_Hypothesis
 {
  public:
-  StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_MaxLength(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_MaxLength();
 
   void SetLength(double length) throw(SALOME_Exception);
index a3ab8278d5e10f65ee0999b6b8d1ac210ce6f499..ca597ee523cea3a1577edaa3a0adac32c06914f9 100644 (file)
@@ -36,8 +36,8 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(int hypId, SMESH_Gen* gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "NotConformAllowed";
   _param_algo_dim = -1; 
index 79c4d021009ce41c632ff37512e9f0a27915c2a7..2f80da9a5bafde0f35daac85ce766801e15366d9 100644 (file)
@@ -37,7 +37,7 @@ class STDMESHERS_EXPORT StdMeshers_NotConformAllowed:
   public SMESH_Hypothesis
 {
 public:
-  StdMeshers_NotConformAllowed(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_NotConformAllowed(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_NotConformAllowed();
 
   virtual std::ostream & SaveTo(std::ostream & save);
index 55967940c81e29139fa115333ee4ff1c14c0a74b..e560a6ee63fb97b872e9bc7c19c8e39627b07db8 100644 (file)
@@ -42,9 +42,9 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId, int studyId,
+StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId,
                                                      SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "NumberOfLayers"; // used by RadialPrism_3D
   _param_algo_dim = 3; // 3D
index b8dc0c0d7ca14beac4ddb14781debae58395ea10..b4f7ff2de6e27602ed066a5a218af565c9d7c4ab 100644 (file)
@@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_NumberOfLayers:  public SMESH_Hypothesis
 {
 public:
   // Constructor
-  StdMeshers_NumberOfLayers( int hypId, int studyId, SMESH_Gen * gen );
+  StdMeshers_NumberOfLayers( int hypId, SMESH_Gen * gen );
   // Destructor
   virtual ~StdMeshers_NumberOfLayers();
 
index 74d6b0c9ac112bb052b4cbb478ebda35036e239f..fef954c5a6f4dd07f51334ca5948e0fb8f2d0871 100644 (file)
@@ -36,9 +36,8 @@
 //=============================================================================
 
 StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D(int hypId,
-                                                         int studyId,
                                                          SMESH_Gen * gen)
-  : StdMeshers_NumberOfLayers(hypId, studyId, gen)
+  : StdMeshers_NumberOfLayers(hypId, gen)
 {
   _name = "NumberOfLayers2D"; // used by RadialQuadrangle_1D2D
   _param_algo_dim = 2; // 2D
index 4514debc561bcd8585232f0db389aa7612db7c3d..d2df75fe9805d91c7949f67767103ca609dfa096 100644 (file)
@@ -43,7 +43,7 @@ class STDMESHERS_EXPORT StdMeshers_NumberOfLayers2D
 {
 public:
   // Constructor
-  StdMeshers_NumberOfLayers2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_NumberOfLayers2D(int hypId, SMESH_Gen* gen);
   // Destructor
   virtual ~StdMeshers_NumberOfLayers2D();
 };
index 2ff7274fc2b0827483a13c14ec9adc555f7477c7..b26904eb231fef34897c9c5519a5e7c35fd208d1 100644 (file)
@@ -66,9 +66,8 @@ const double PRECISION = 1e-7;
 //=============================================================================
 
 StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(int         hypId,
-                                                         int         studyId,
                                                          SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
+  : SMESH_Hypothesis(hypId, gen),
     _numberOfSegments(15),//issue 19923
     _distrType(DT_Regular),
     _scaleFactor(1.),
index 459c286a19e6a36252c1f9c3ce38fc39ccb40613..95273c5fa981c499b7421b77eca8a6773449e3dc 100644 (file)
@@ -45,7 +45,7 @@ class STDMESHERS_EXPORT StdMeshers_NumberOfSegments:
   public SMESH_Hypothesis
 {
 public:
-  StdMeshers_NumberOfSegments(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_NumberOfSegments(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_NumberOfSegments();
 
   // Builds point distribution according to passed function
index 78c4d62e5728cb26ab06988240050b5b413cd1f3..37054e80ec3c706467dc9918b7a1d221676ce03e 100644 (file)
@@ -49,9 +49,8 @@ using namespace std;
 //=======================================================================
 
 StdMeshers_PolygonPerFace_2D::StdMeshers_PolygonPerFace_2D(int        hypId,
-                                                           int        studyId,
                                                            SMESH_Gen* gen)
-  :SMESH_2D_Algo(hypId, studyId, gen)
+  :SMESH_2D_Algo(hypId, gen)
 {
   _name = "PolygonPerFace_2D";
 }
index 57a7afc8b49c7a4bfb8db8a9b3527b2bc23465ea..a3ff18e1876375aeeffa6d7e5560155638036254 100644 (file)
@@ -32,7 +32,7 @@
 class STDMESHERS_EXPORT StdMeshers_PolygonPerFace_2D: public SMESH_2D_Algo
 {
  public:
-  StdMeshers_PolygonPerFace_2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_PolygonPerFace_2D(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
                                const TopoDS_Shape&                  aShape,
index a7dae02832c902abde6f7a23301d04c86bc7c1a8..d326cd157684bc09e383b123d6c0ac6a1fc6fed8 100644 (file)
@@ -51,6 +51,7 @@
 #include <Geom2d_Line.hxx>
 #include <GeomLib_IsPlanarSurface.hxx>
 #include <Geom_Curve.hxx>
+#include <Standard_ErrorHandler.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
@@ -95,15 +96,14 @@ namespace {
    */
   struct TQuadrangleAlgo : public StdMeshers_Quadrangle_2D
   {
-    TQuadrangleAlgo(int studyId, SMESH_Gen* gen)
-      : StdMeshers_Quadrangle_2D( gen->GetANewId(), studyId, gen)
+    TQuadrangleAlgo(SMESH_Gen* gen)
+      : StdMeshers_Quadrangle_2D( gen->GetANewId(), gen)
     {
     }
     static StdMeshers_Quadrangle_2D* instance( SMESH_Algo*         fatherAlgo,
                                                SMESH_MesherHelper* helper=0)
     {
-      static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetStudyId(),
-                                                          fatherAlgo->GetGen() );
+      static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetGen() );
       if ( helper &&
            algo->myProxyMesh &&
            algo->myProxyMesh->GetMesh() != helper->GetMesh() )
@@ -125,16 +125,15 @@ namespace {
   {
     StdMeshers_ProjectionSource1D myHyp;
 
-    TProjction1dAlgo(int studyId, SMESH_Gen* gen)
-      : StdMeshers_Projection_1D( gen->GetANewId(), studyId, gen),
-        myHyp( gen->GetANewId(), studyId, gen)
+    TProjction1dAlgo(SMESH_Gen* gen)
+      : StdMeshers_Projection_1D( gen->GetANewId(), gen),
+        myHyp( gen->GetANewId(), gen)
     {
       StdMeshers_Projection_1D::_sourceHypo = & myHyp;
     }
     static TProjction1dAlgo* instance( SMESH_Algo* fatherAlgo )
     {
-      static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetStudyId(),
-                                                            fatherAlgo->GetGen() );
+      static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetGen() );
       return algo;
     }
   };
@@ -146,16 +145,15 @@ namespace {
   {
     StdMeshers_ProjectionSource2D myHyp;
 
-    TProjction2dAlgo(int studyId, SMESH_Gen* gen)
-      : StdMeshers_Projection_1D2D( gen->GetANewId(), studyId, gen),
-        myHyp( gen->GetANewId(), studyId, gen)
+    TProjction2dAlgo(SMESH_Gen* gen)
+      : StdMeshers_Projection_1D2D( gen->GetANewId(), gen),
+        myHyp( gen->GetANewId(), gen)
     {
       StdMeshers_Projection_2D::_sourceHypo = & myHyp;
     }
     static TProjction2dAlgo* instance( SMESH_Algo* fatherAlgo )
     {
-      static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetStudyId(),
-                                                            fatherAlgo->GetGen() );
+      static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetGen() );
       return algo;
     }
     const NSProjUtils::TNodeNodeMap& GetNodesMap()
@@ -528,6 +526,27 @@ namespace {
     return nbSides;
   }
 
+  //================================================================================
+  /*!
+   * \brief Set/get wire index to FaceQuadStruct
+   */
+  //================================================================================
+
+  void setWireIndex( TFaceQuadStructPtr& quad, int iWire )
+  {
+    quad->iSize = iWire;
+  }
+  int getWireIndex( const TFaceQuadStructPtr& quad )
+  {
+    return quad->iSize;
+  }
+
+  //================================================================================
+  /*!
+   * \brief Print Python commands adding given points to a mesh
+   */
+  //================================================================================
+
   void pointsToPython(const std::vector<gp_XYZ>& p)
   {
 #ifdef _DEBUG_
@@ -545,8 +564,8 @@ namespace {
 //purpose  : 
 //=======================================================================
 
-StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name                    = "Prism_3D";
   _shapeType               = (1 << TopAbs_SOLID); // 1 bit per shape type
@@ -558,6 +577,7 @@ StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen)
 
   //myProjectTriangles       = false;
   mySetErrorToSM           = true;  // to pass an error to a sub-mesh of a current solid or not
+  myPrevBottomSM           = 0;     // last treated bottom sub-mesh with a suitable algorithm
 }
 
 //================================================================================
@@ -580,39 +600,6 @@ bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh&                          a
                                           const TopoDS_Shape&                  aShape,
                                           SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
-  // Check shape geometry
-/*  PAL16229
-  aStatus = SMESH_Hypothesis::HYP_BAD_GEOMETRY;
-
-  // find not quadrangle faces
-  list< TopoDS_Shape > notQuadFaces;
-  int nbEdge, nbWire, nbFace = 0;
-  TopExp_Explorer exp( aShape, TopAbs_FACE );
-  for ( ; exp.More(); exp.Next() ) {
-    ++nbFace;
-    const TopoDS_Shape& face = exp.Current();
-    nbEdge = NSProjUtils::Count( face, TopAbs_EDGE, 0 );
-    nbWire = NSProjUtils::Count( face, TopAbs_WIRE, 0 );
-    if (  nbEdge!= 4 || nbWire!= 1 ) {
-      if ( !notQuadFaces.empty() ) {
-        if ( NSProjUtils::Count( notQuadFaces.back(), TopAbs_EDGE, 0 ) != nbEdge ||
-             NSProjUtils::Count( notQuadFaces.back(), TopAbs_WIRE, 0 ) != nbWire )
-          RETURN_BAD_RESULT("Different not quad faces");
-      }
-      notQuadFaces.push_back( face );
-    }
-  }
-  if ( !notQuadFaces.empty() )
-  {
-    if ( notQuadFaces.size() != 2 )
-      RETURN_BAD_RESULT("Bad nb not quad faces: " << notQuadFaces.size());
-
-    // check total nb faces
-    nbEdge = NSProjUtils::Count( notQuadFaces.back(), TopAbs_EDGE, 0 );
-    if ( nbFace != nbEdge + 2 )
-      RETURN_BAD_RESULT("Bad nb of faces: " << nbFace << " but must be " << nbEdge + 2);
-  }
-*/
   // no hypothesis
   aStatus = SMESH_Hypothesis::HYP_OK;
   return true;
@@ -627,6 +614,7 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
 {
   SMESH_MesherHelper helper( theMesh );
   myHelper = &helper;
+  myPrevBottomSM = 0;
 
   int nbSolids = helper.Count( theShape, TopAbs_SOLID, /*skipSame=*/false );
   if ( nbSolids < 1 )
@@ -943,7 +931,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
   list< TopoDS_Edge >::iterator edge = thePrism.myBottomEdges.begin();
   std::list< int >::iterator     nbE = thePrism.myNbEdgesInWires.begin();
   std::list< int > nbQuadsPerWire;
-  int iE = 0;
+  int iE = 0, iWire = 0;
   while ( edge != thePrism.myBottomEdges.end() )
   {
     ++iE;
@@ -977,7 +965,10 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
                 return toSM( error(TCom("Composite 'horizontal' edges are not supported")));
           }
           if ( faceMap.Add( face ))
+          {
+            setWireIndex( quadList.back(), iWire ); // for use in makeQuadsForOutInProjection()
             thePrism.myWallQuads.push_back( quadList );
+          }
           break;
         }
       }
@@ -995,6 +986,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
     if ( iE == *nbE )
     {
       iE = 0;
+      ++iWire;
       ++nbE;
       int nbQuadPrev = std::accumulate( nbQuadsPerWire.begin(), nbQuadsPerWire.end(), 0 );
       nbQuadsPerWire.push_back( thePrism.myWallQuads.size() - nbQuadPrev );
@@ -1129,13 +1121,8 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
     return toSM( error( SMESH_ComputeError::New(COMPERR_CANCELED)));
 
   // Assure the bottom is meshed
-  SMESH_subMesh * botSM = myHelper->GetMesh()->GetSubMesh( thePrism.myBottom );
-  if (( botSM->IsEmpty() ) &&
-      ( ! botSM->GetAlgo() ||
-        ! _gen->Compute( *botSM->GetFather(), botSM->GetSubShape(), /*shapeOnly=*/true )))
-    return error( COMPERR_BAD_INPUT_MESH,
-                  TCom( "No mesher defined to compute the base face #")
-                  << shapeID( thePrism.myBottom ));
+  if ( !computeBase( thePrism ))
+    return false;
 
   // Make all side FACEs of thePrism meshed with quads
   if ( !computeWalls( thePrism ))
@@ -1160,7 +1147,8 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
   // else if ( !trsf.empty() )
   //   bottomToTopTrsf = trsf.back();
 
-  // To compute coordinates of a node inside a block, it is necessary to know
+  // To compute coordinates of a node inside a block using "block approach",
+  // it is necessary to know
   // 1. normalized parameters of the node by which
   // 2. coordinates of node projections on all block sub-shapes are computed
 
@@ -1173,7 +1161,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
 
   // Projections on the top and bottom faces are taken from nodes existing
   // on these faces; find correspondence between bottom and top nodes
-  myUseBlock = false;
+  myUseBlock = false; // is set to true if projection is done using "block approach"
   myBotToColumnMap.clear();
   if ( !assocOrProjBottom2Top( bottomToTopTrsf, thePrism ) ) // it also fills myBotToColumnMap
     return false;
@@ -1181,38 +1169,62 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
 
   // Create nodes inside the block
 
-  // use transformation (issue 0020680, IPAL0052499)
-  StdMeshers_Sweeper sweeper;
-  double tol;
-  bool allowHighBndError;
-
   if ( !myUseBlock )
   {
+    // use transformation (issue 0020680, IPAL0052499) or a "straight line" approach
+    StdMeshers_Sweeper sweeper;
+    sweeper.myHelper  = myHelper;
+    sweeper.myBotFace = thePrism.myBottom;
+    sweeper.myTopFace = thePrism.myTop;
+
     // load boundary nodes into sweeper
     bool dummy;
+    std::set< const SMDS_MeshNode* > usedEndNodes;
     list< TopoDS_Edge >::const_iterator edge = thePrism.myBottomEdges.begin();
     for ( ; edge != thePrism.myBottomEdges.end(); ++edge )
     {
       int edgeID = meshDS->ShapeToIndex( *edge );
       TParam2ColumnMap* u2col = const_cast<TParam2ColumnMap*>
         ( myBlock.GetParam2ColumnMap( edgeID, dummy ));
-      TParam2ColumnMap::iterator u2colIt = u2col->begin();
-      for ( ; u2colIt != u2col->end(); ++u2colIt )
+
+      TParam2ColumnMap::iterator u2colIt = u2col->begin(), u2colEnd = u2col->end();
+      const SMDS_MeshNode* n0 = u2colIt->second[0];
+      const SMDS_MeshNode* n1 = u2col->rbegin()->second[0];
+      if ( !usedEndNodes.insert ( n0 ).second ) ++u2colIt;
+      if ( !usedEndNodes.insert ( n1 ).second ) --u2colEnd;
+
+      for ( ; u2colIt != u2colEnd; ++u2colIt )
         sweeper.myBndColumns.push_back( & u2colIt->second );
     }
-    // load node columns inside the bottom face
+    // load node columns inside the bottom FACE
+    sweeper.myIntColumns.reserve( myBotToColumnMap.size() );
     TNode2ColumnMap::iterator bot_column = myBotToColumnMap.begin();
     for ( ; bot_column != myBotToColumnMap.end(); ++bot_column )
       sweeper.myIntColumns.push_back( & bot_column->second );
 
-    tol = getSweepTolerance( thePrism );
-    allowHighBndError = !isSimpleBottom( thePrism );
-  }
+    myHelper->SetElementsOnShape( true );
 
-  if ( !myUseBlock && sweeper.ComputeNodes( *myHelper, tol, allowHighBndError ))
-  {
+    // If all "vertical" EDGEs are straight, then all nodes of an internal node column
+    // are located on a line connecting the top node and the bottom node.
+    bool isStrightColunm = allVerticalEdgesStraight( thePrism );
+    if ( !isStrightColunm )
+    {
+      double tol = getSweepTolerance( thePrism );
+      bool allowHighBndError = !isSimpleBottom( thePrism );
+      myUseBlock = !sweeper.ComputeNodesByTrsf( tol, allowHighBndError );
+    }
+    else if ( sweeper.CheckSameZ() )
+    {
+      myUseBlock = !sweeper.ComputeNodesOnStraightSameZ();
+    }
+    else
+    {
+      myUseBlock = !sweeper.ComputeNodesOnStraight();
+    }
+    myHelper->SetElementsOnShape( false );
   }
-  else // use block approach
+
+  if ( myUseBlock ) // use block approach
   {
     // loop on nodes inside the bottom face
     Prism_3D::TNode prevBNode;
@@ -1227,6 +1239,14 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
       // column nodes; middle part of the column are zero pointers
       TNodeColumn& column = bot_column->second;
 
+      // check if a column is already computed using non-block approach
+      size_t i;
+      for ( i = 0; i < column.size(); ++i )
+        if ( !column[ i ])
+          break;
+      if ( i == column.size() )
+        continue; // all nodes created
+
       gp_XYZ botParams, topParams;
       if ( !tBotNode.HasParams() )
       {
@@ -1361,6 +1381,75 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
   return true;
 }
 
+//=======================================================================
+//function : computeBase
+//purpose  : Compute the base face of a prism
+//=======================================================================
+
+bool StdMeshers_Prism_3D::computeBase(const Prism_3D::TPrismTopo& thePrism)
+{
+  SMESH_Mesh*     mesh = myHelper->GetMesh();
+  SMESH_subMesh* botSM = mesh->GetSubMesh( thePrism.myBottom );
+  if (( botSM->IsEmpty() ) &&
+      ( ! botSM->GetAlgo() ||
+        ! _gen->Compute( *botSM->GetFather(), botSM->GetSubShape(), /*shapeOnly=*/true )))
+  {
+    // find any applicable algorithm assigned to any FACE of the main shape
+    std::vector< TopoDS_Shape > faces;
+    if ( myPrevBottomSM &&
+         myPrevBottomSM->GetAlgo()->IsApplicableToShape( thePrism.myBottom, /*all=*/false ))
+      faces.push_back( myPrevBottomSM->GetSubShape() );
+
+    TopExp_Explorer faceIt( mesh->GetShapeToMesh(), TopAbs_FACE );
+    for ( ; faceIt.More(); faceIt.Next() )
+      faces.push_back( faceIt.Current() );
+
+    faces.push_back( TopoDS_Shape() ); // to try quadrangle algorithm
+
+    SMESH_Algo* algo = 0;
+    for ( size_t i = 0; i < faces.size() &&  botSM->IsEmpty(); ++i )
+    {
+      if ( faces[i].IsNull() ) algo = TQuadrangleAlgo::instance( this, myHelper );
+      else                     algo = mesh->GetSubMesh( faces[i] )->GetAlgo();
+      if ( algo && algo->IsApplicableToShape( thePrism.myBottom, /*all=*/false ))
+      {
+        // try to compute the bottom FACE
+        if ( algo->NeedDiscreteBoundary() )
+        {
+          // compute sub-shapes
+          SMESH_subMeshIteratorPtr smIt = botSM->getDependsOnIterator(false,false);
+          bool subOK = true;
+          while ( smIt->more() && subOK )
+          {
+            SMESH_subMesh* sub = smIt->next();
+            sub->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+            subOK = sub->IsMeshComputed();
+          }
+          if ( !subOK )
+            continue;
+        }
+        try {
+          OCC_CATCH_SIGNALS;
+          algo->InitComputeError();
+          algo->Compute( *mesh, botSM->GetSubShape() );
+        }
+        catch (...) {
+        }
+      }
+    }
+  }
+
+  if ( botSM->IsEmpty() )
+    return error( COMPERR_BAD_INPUT_MESH,
+                  TCom( "No mesher defined to compute the base face #")
+                  << shapeID( thePrism.myBottom ));
+
+  if ( botSM->GetAlgo() )
+    myPrevBottomSM = botSM;
+
+  return true;
+}
+
 //=======================================================================
 //function : computeWalls
 //purpose  : Compute 2D mesh on walls FACEs of a prism
@@ -1391,6 +1480,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
     for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
     {
       StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
+      lftSide->Reverse(); // to go up
       for ( int i = 0; i < lftSide->NbEdges(); ++i )
       {
         ++wgt[ iW ];
@@ -1418,6 +1508,11 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
   for ( size_t iW = 0; iW != nbWalls; ++iW )
     wgt2quad.insert( make_pair( wgt[ iW ], iW ));
 
+  // artificial quads to do outer <-> inner wall projection
+  std::map< int, FaceQuadStruct > iW2oiQuads;
+  std::map< int, FaceQuadStruct >::iterator w2oiq;
+  makeQuadsForOutInProjection( thePrism, wgt2quad, iW2oiQuads );
+
   // Project 'vertical' EDGEs, from left to right
   multimap< int, int >::reverse_iterator w2q = wgt2quad.rbegin();
   for ( ; w2q != wgt2quad.rend(); ++w2q )
@@ -1434,10 +1529,25 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
       if ( swapLeftRight )
         std::swap( lftSide, rgtSide );
 
+      bool isArtificialQuad = (( w2oiq = iW2oiQuads.find( iW )) != iW2oiQuads.end() );
+      if ( isArtificialQuad )
+      {
+        // reset sides to perform the outer <-> inner projection
+        FaceQuadStruct& oiQuad = w2oiq->second;
+        rgtSide = oiQuad.side[ QUAD_RIGHT_SIDE ];
+        lftSide = oiQuad.side[ QUAD_LEFT_SIDE ];
+        iW2oiQuads.erase( w2oiq );
+      }
+
       // assure that all the source (left) EDGEs are meshed
       int nbSrcSegments = 0;
       for ( int i = 0; i < lftSide->NbEdges(); ++i )
       {
+        if ( isArtificialQuad )
+        {
+          nbSrcSegments = lftSide->NbPoints()-1;
+          continue;
+        }
         const TopoDS_Edge& srcE = lftSide->Edge(i);
         SMESH_subMesh*    srcSM = mesh->GetSubMesh( srcE );
         if ( !srcSM->IsMeshComputed() ) {
@@ -1513,7 +1623,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
         const UVPtStructVec&  srcNodeStr = lftSide->GetUVPtStruct();
         if ( srcNodeStr.size() == 0 )
           return toSM( error( TCom("Invalid node positions on edge #") <<
-                              shapeID( lftSide->Edge(0) )));
+                              lftSide->EdgeID(0) ));
         vector< SMDS_MeshNode* > newNodes( srcNodeStr.size() );
         for ( int is2ndV = 0; is2ndV < 2; ++is2ndV )
         {
@@ -1521,12 +1631,12 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
           TopoDS_Vertex      v = myHelper->IthVertex( is2ndV, E );
           mesh->GetSubMesh( v )->ComputeStateEngine( SMESH_subMesh::COMPUTE );
           const SMDS_MeshNode* n = SMESH_Algo::VertexNode( v, meshDS );
-          newNodes[ is2ndV ? 0 : newNodes.size()-1 ] = (SMDS_MeshNode*) n;
+          newNodes[ is2ndV ? newNodes.size()-1 : 0 ] = (SMDS_MeshNode*) n;
         }
 
         // compute nodes on target EDGEs
         DBGOUT( "COMPUTE V edge (proj) " << shapeID( lftSide->Edge(0)));
-        rgtSide->Reverse(); // direct it same as the lftSide
+        //rgtSide->Reverse(); // direct it same as the lftSide
         myHelper->SetElementsOnShape( false ); // myHelper holds the prism shape
         TopoDS_Edge tgtEdge;
         for ( size_t iN = 1; iN < srcNodeStr.size()-1; ++iN ) // add nodes
@@ -1695,9 +1805,8 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
 }
 
 //=======================================================================
-/*!
- * \brief Returns a source EDGE of propagation to a given EDGE
- */
+//function : findPropagationSource
+//purpose  : Returns a source EDGE of propagation to a given EDGE
 //=======================================================================
 
 TopoDS_Edge StdMeshers_Prism_3D::findPropagationSource( const TopoDS_Edge& E )
@@ -1710,9 +1819,93 @@ TopoDS_Edge StdMeshers_Prism_3D::findPropagationSource( const TopoDS_Edge& E )
   return TopoDS_Edge();
 }
 
+//=======================================================================
+//function : makeQuadsForOutInProjection
+//purpose  : Create artificial wall quads for vertical projection between
+//           the outer and inner walls
+//=======================================================================
+
+void StdMeshers_Prism_3D::makeQuadsForOutInProjection( const Prism_3D::TPrismTopo& thePrism,
+                                                       multimap< int, int >&       wgt2quad,
+                                                       map< int, FaceQuadStruct >& iQ2oiQuads)
+{
+  if ( thePrism.NbWires() <= 1 )
+    return;
+
+  std::set< int > doneWires; // processed wires
+
+  SMESH_Mesh*      mesh = myHelper->GetMesh();
+  const bool  isForward = true;
+  const bool skipMedium = myHelper->GetIsQuadratic();
+
+  // make a source side for all projections
+
+  multimap< int, int >::reverse_iterator w2q = wgt2quad.rbegin();
+  const int iQuad = w2q->second;
+  const int iWire = getWireIndex( thePrism.myWallQuads[ iQuad ].front() );
+  doneWires.insert( iWire );
+
+  UVPtStructVec srcNodes;
+
+  Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iQuad ].begin();
+  for ( ; quad != thePrism.myWallQuads[ iQuad ].end(); ++quad )
+  {
+    StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
+
+    // assure that all the source (left) EDGEs are meshed
+    for ( int i = 0; i < lftSide->NbEdges(); ++i )
+    {
+      const TopoDS_Edge& srcE = lftSide->Edge(i);
+      SMESH_subMesh*    srcSM = mesh->GetSubMesh( srcE );
+      if ( !srcSM->IsMeshComputed() ) {
+        srcSM->ComputeSubMeshStateEngine( SMESH_subMesh::COMPUTE );
+        srcSM->ComputeStateEngine       ( SMESH_subMesh::COMPUTE );
+      }
+      if ( !srcSM->IsMeshComputed() )
+        return;
+    }
+    const UVPtStructVec& subNodes = lftSide->GetUVPtStruct();
+    UVPtStructVec::const_iterator subBeg = subNodes.begin(), subEnd = subNodes.end();
+    if ( !srcNodes.empty() ) ++subBeg;
+    srcNodes.insert( srcNodes.end(), subBeg, subEnd );
+  }
+  StdMeshers_FaceSidePtr srcSide = StdMeshers_FaceSide::New( srcNodes );
+
+  // make the quads
+
+  list< TopoDS_Edge > sideEdges;
+  TopoDS_Face face;
+  for ( ++w2q; w2q != wgt2quad.rend(); ++w2q )
+  {
+    const int                  iQuad = w2q->second;
+    const Prism_3D::TQuadList& quads = thePrism.myWallQuads[ iQuad ];
+    const int                  iWire = getWireIndex( quads.front() );
+    if ( !doneWires.insert( iWire ).second )
+      continue;
+
+    sideEdges.clear();
+    for ( quad = quads.begin(); quad != quads.end(); ++quad )
+    {
+      StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
+      for ( int i = 0; i < lftSide->NbEdges(); ++i )
+        sideEdges.push_back( lftSide->Edge( i ));
+      face = lftSide->Face();
+    }
+    StdMeshers_FaceSidePtr tgtSide =
+      StdMeshers_FaceSide::New( face, sideEdges, mesh, isForward, skipMedium, myHelper );
+
+    FaceQuadStruct& newQuad = iQ2oiQuads[ iQuad ];
+    newQuad.side.resize( 4 );
+    newQuad.side[ QUAD_LEFT_SIDE  ] = srcSide;
+    newQuad.side[ QUAD_RIGHT_SIDE ] = tgtSide;
+
+    wgt2quad.insert( *w2q ); // to process this quad after processing the newQuad
+  }
+}
+
 //=======================================================================
 //function : Evaluate
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh&         theMesh,
@@ -2094,7 +2287,7 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top( const gp_Trsf & bottomToTopTrsf
     TNode2ColumnMap::iterator bN_col =
       myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
     TNodeColumn & column = bN_col->second;
-    column.resize( zSize );
+    column.resize( zSize, 0 );
     column.front() = botNode;
     column.back()  = topNode;
   }
@@ -2274,7 +2467,7 @@ bool StdMeshers_Prism_3D::projectBottomToTop( const gp_Trsf &             bottom
 
   // Check the projected mesh
 
-  if ( thePrism.myNbEdgesInWires.size() > 1 && // there are holes
+  if ( thePrism.NbWires() > 1 && // there are holes
        topHelper.IsDistorted2D( topSM, /*checkUV=*/false ))
   {
     SMESH_MeshEditor editor( topHelper.GetMesh() );
@@ -2400,7 +2593,7 @@ double StdMeshers_Prism_3D::getSweepTolerance( const Prism_3D::TPrismTopo& thePr
 
 bool StdMeshers_Prism_3D::isSimpleBottom( const Prism_3D::TPrismTopo& thePrism )
 {
-  if ( thePrism.myBottomEdges.size() != 4 )
+  if ( thePrism.myNbEdgesInWires.front() != 4 )
     return false;
 
   // analyse angles between edges
@@ -2432,6 +2625,43 @@ bool StdMeshers_Prism_3D::isSimpleBottom( const Prism_3D::TPrismTopo& thePrism )
   return true;
 }
 
+//=======================================================================
+//function : allVerticalEdgesStraight
+//purpose  : Defines if all "vertical" EDGEs are straight
+//=======================================================================
+
+bool StdMeshers_Prism_3D::allVerticalEdgesStraight( const Prism_3D::TPrismTopo& thePrism )
+{
+  for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
+  {
+    const Prism_3D::TQuadList& quads = thePrism.myWallQuads[i];
+    Prism_3D::TQuadList::const_iterator quadIt = quads.begin();
+    TopoDS_Edge prevQuadEdge;
+    for ( ; quadIt != quads.end(); ++quadIt )
+    {
+      StdMeshers_FaceSidePtr rightSide = (*quadIt)->side[ QUAD_RIGHT_SIDE ];
+
+      if ( !prevQuadEdge.IsNull() &&
+           !SMESH_Algo::IsContinuous( rightSide->Edge( 0 ), prevQuadEdge ))
+        return false;
+
+      for ( int iE = 0; iE < rightSide->NbEdges(); ++iE )
+      {
+        const TopoDS_Edge & rightE = rightSide->Edge( iE );
+        if ( !SMESH_Algo::IsStraight( rightE, /*degenResult=*/true ))
+          return false;
+
+        if ( iE > 0 &&
+             !SMESH_Algo::IsContinuous( rightSide->Edge( iE-1 ), rightE ))
+          return false;
+
+        prevQuadEdge = rightE;
+      }
+    }
+  }
+  return true;
+}
+
 //=======================================================================
 //function : project2dMesh
 //purpose  : Project mesh faces from a source FACE of one prism (theSrcFace)
@@ -3364,10 +3594,10 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper*         helper,
       if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
         return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
                      << "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
-
-      if ( !faceColumns.empty() && (int)faceColumns.begin()->second.size() != VerticalSize() )
-        return error(COMPERR_BAD_INPUT_MESH, "Different 'vertical' discretization");
     }
+    if ( !faceColumns.empty() && (int)faceColumns.begin()->second.size() != VerticalSize() )
+      return error(COMPERR_BAD_INPUT_MESH, "Different 'vertical' discretization");
+
     // edge columns
     int id = MeshDS()->ShapeToIndex( *edgeIt );
     bool isForward = true; // meaningless for intenal wires
@@ -4667,6 +4897,7 @@ bool StdMeshers_Sweeper::projectIntPoints(const vector< gp_XYZ >&    fromBndPoin
                                           const vector< gp_XYZ >&    toBndPoints,
                                           const vector< gp_XYZ >&    fromIntPoints,
                                           vector< gp_XYZ >&          toIntPoints,
+                                          const double               r,
                                           NSProjUtils::TrsfFinder3D& trsf,
                                           vector< gp_XYZ > *         bndError)
 {
@@ -4691,54 +4922,34 @@ bool StdMeshers_Sweeper::projectIntPoints(const vector< gp_XYZ >&    fromBndPoin
       (*bndError)[ iP ]  = toBndPoints[ iP ] - fromTrsf;
     }
   }
-  return true;
-}
-
-//================================================================================
-/*!
- * \brief Add boundary error to ineternal points
- */
-//================================================================================
 
-void StdMeshers_Sweeper::applyBoundaryError(const vector< gp_XYZ >& bndPoints,
-                                            const vector< gp_XYZ >& bndError1,
-                                            const vector< gp_XYZ >& bndError2,
-                                            const double            r,
-                                            vector< gp_XYZ >&       intPoints,
-                                            vector< double >&       int2BndDist)
-{
-  // fix each internal point
-  const double eps = 1e-100;
-  for ( size_t iP = 0; iP < intPoints.size(); ++iP )
+  // apply boundary error
+  if ( bndError && toIntPoints.size() == myTopBotTriangles.size() )
   {
-    gp_XYZ & intPnt = intPoints[ iP ];
-
-    // compute distance from intPnt to each boundary node
-    double int2BndDistSum = 0;
-    for ( size_t iBnd = 0; iBnd < bndPoints.size(); ++iBnd )
-    {
-      int2BndDist[ iBnd ] = 1 / (( intPnt - bndPoints[ iBnd ]).SquareModulus() + eps );
-      int2BndDistSum += int2BndDist[ iBnd ];
-    }
-
-    // apply bndError
-    for ( size_t iBnd = 0; iBnd < bndPoints.size(); ++iBnd )
+    for ( size_t iP = 0; iP < toIntPoints.size(); ++iP )
     {
-      intPnt += bndError1[ iBnd ] * ( 1 - r ) * int2BndDist[ iBnd ] / int2BndDistSum;
-      intPnt += bndError2[ iBnd ] * r         * int2BndDist[ iBnd ] / int2BndDistSum;
+      const TopBotTriangles& tbTrias = myTopBotTriangles[ iP ];
+      for ( int i = 0; i < 3; ++i ) // boundary errors at 3 triangle nodes
+      {
+        toIntPoints[ iP ] +=
+          ( (*bndError)[ tbTrias.myBotTriaNodes[i] ] * tbTrias.myBotBC[i] * ( 1 - r ) +
+            (*bndError)[ tbTrias.myTopTriaNodes[i] ] * tbTrias.myTopBC[i] * ( r     ));
+      }
     }
   }
+
+  return true;
 }
 
 //================================================================================
 /*!
- * \brief Creates internal nodes of the prism
+ * \brief Create internal nodes of the prism by computing an affine transformation
+ *        from layer to layer
  */
 //================================================================================
 
-bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
-                                       const double        tol,
-                                       const bool          allowHighBndError)
+bool StdMeshers_Sweeper::ComputeNodesByTrsf( const double tol,
+                                             const bool   allowHighBndError)
 {
   const size_t zSize = myBndColumns[0]->size();
   const size_t zSrc = 0, zTgt = zSize-1;
@@ -4754,6 +4965,10 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
     intPntsOfLayer[ zTgt ][ iP ] = intPoint( iP, zTgt );
   }
 
+  // for each internal column find boundary nodes whose error to use for correction
+  prepareTopBotDelaunay();
+  bool isErrorCorrectable = findDelaunayTriangles();
+
   // compute coordinates of internal nodes by projecting (transfroming) src and tgt
   // nodes towards the central layer
 
@@ -4780,10 +4995,12 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
     }
     if (! projectIntPoints( fromSrcBndPnts, toSrcBndPnts,
                             intPntsOfLayer[ zS-1 ], intPntsOfLayer[ zS ],
+                            zS / ( zSize - 1.),
                             trsfOfLayer   [ zS-1 ], & bndError[ zS-1 ]))
       return false;
     if (! projectIntPoints( fromTgtBndPnts, toTgtBndPnts,
                             intPntsOfLayer[ zT+1 ], intPntsOfLayer[ zT ],
+                            zT / ( zSize - 1.),
                             trsfOfLayer   [ zT+1 ], & bndError[ zT+1 ]))
       return false;
 
@@ -4808,6 +5025,22 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
     fromSrcBndPnts.swap( toSrcBndPnts );
   }
 
+  // Evaluate an error of boundary points
+
+  if ( !isErrorCorrectable && !allowHighBndError )
+  {
+    for ( size_t iP = 0; iP < myBndColumns.size(); ++iP )
+    {
+      double sumError = 0;
+      for ( size_t z = 1; z < zS; ++z ) // loop on layers
+        sumError += ( bndError[ z-1     ][ iP ].Modulus() +
+                      bndError[ zSize-z ][ iP ].Modulus() );
+
+      if ( sumError > tol )
+        return false;
+    }
+  }
+
   // Compute two projections of internal points to the central layer
   // in order to evaluate an error of internal points
 
@@ -4822,10 +5055,12 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
   }
   if (! projectIntPoints( fromSrcBndPnts, toSrcBndPnts,
                           intPntsOfLayer[ zS-1 ], centerSrcIntPnts,
+                          zS / ( zSize - 1.),
                           trsfOfLayer   [ zS-1 ], & bndError[ zS-1 ]))
     return false;
   if (! projectIntPoints( fromTgtBndPnts, toTgtBndPnts,
                           intPntsOfLayer[ zT+1 ], centerTgtIntPnts,
+                          zT / ( zSize - 1.),
                           trsfOfLayer   [ zT+1 ], & bndError[ zT+1 ]))
     return false;
 
@@ -4844,24 +5079,7 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
         (intPntsOfLayer[ zS-1 ][ iP ] - centerTgtIntPnts[ iP ]).SquareModulus() < tol*tol;
   }
 
-  // Evaluate an error of boundary points
-
-  bool bndErrorIsSmall = true;
-  for ( size_t iP = 0; ( iP < myBndColumns.size() && bndErrorIsSmall ); ++iP )
-  {
-    double sumError = 0;
-    for ( size_t z = 1; z < zS; ++z ) // loop on layers
-      sumError += ( bndError[ z-1     ][ iP ].Modulus() +
-                    bndError[ zSize-z ][ iP ].Modulus() );
-
-    bndErrorIsSmall = ( sumError < tol );
-  }
-
-  if ( !bndErrorIsSmall && !allowHighBndError )
-    return false;
-
   // compute final points on the central layer
-  std::vector< double > int2BndDist( myBndColumns.size() ); // work array of applyBoundaryError()
   double r = zS / ( zSize - 1.);
   if ( zS == zT )
   {
@@ -4870,11 +5088,6 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
       intPntsOfLayer[ zS ][ iP ] =
         ( 1 - r ) * centerSrcIntPnts[ iP ] + r * centerTgtIntPnts[ iP ];
     }
-    if ( !bndErrorIsSmall )
-    {
-      applyBoundaryError( toSrcBndPnts, bndError[ zS-1 ], bndError[ zS+1 ], r,
-                          intPntsOfLayer[ zS ], int2BndDist );
-    }
   }
   else
   {
@@ -4885,17 +5098,8 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
       intPntsOfLayer[ zT ][ iP ] =
         r * intPntsOfLayer[ zT ][ iP ] + ( 1 - r ) * centerTgtIntPnts[ iP ];
     }
-    if ( !bndErrorIsSmall )
-    {
-      applyBoundaryError( toSrcBndPnts, bndError[ zS-1 ], bndError[ zS+1 ], r,
-                          intPntsOfLayer[ zS ], int2BndDist );
-      applyBoundaryError( toTgtBndPnts, bndError[ zT+1 ], bndError[ zT-1 ], r,
-                          intPntsOfLayer[ zT ], int2BndDist );
-    }
   }
 
-  centerIntErrorIsSmall = true; // 3D_mesh_Extrusion_00/A3
-  bndErrorIsSmall = true;
   if ( !centerIntErrorIsSmall )
   {
     // Compensate the central error; continue adding projection
@@ -4927,9 +5131,11 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
       }
       projectIntPoints( fromSrcBndPnts, toSrcBndPnts,
                         fromSrcIntPnts, toSrcIntPnts,
+                        zS / ( zSize - 1.),
                         trsfOfLayer[ zS+1 ], & srcBndError );
       projectIntPoints( fromTgtBndPnts, toTgtBndPnts,
                         fromTgtIntPnts, toTgtIntPnts,
+                        zT / ( zSize - 1.),
                         trsfOfLayer[ zT-1 ], & tgtBndError );
 
       // if ( zS == zTgt - 1 )
@@ -4960,15 +5166,6 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
         zTIntPnts[ iP ] = r * zTIntPnts[ iP ]  +  ( 1 - r ) * toTgtIntPnts[ iP ];
       }
 
-      // compensate bnd error
-      if ( !bndErrorIsSmall )
-      {
-        applyBoundaryError( toSrcBndPnts, srcBndError, bndError[ zS+1 ], r,
-                            intPntsOfLayer[ zS ], int2BndDist );
-        applyBoundaryError( toTgtBndPnts, tgtBndError, bndError[ zT-1 ], r,
-                            intPntsOfLayer[ zT ], int2BndDist );
-      }
-
       fromSrcBndPnts.swap( toSrcBndPnts );
       fromSrcIntPnts.swap( toSrcIntPnts );
       fromTgtBndPnts.swap( toTgtBndPnts );
@@ -4976,27 +5173,8 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
     }
   }  // if ( !centerIntErrorIsSmall )
 
-  else if ( !bndErrorIsSmall )
-  {
-    zS = zSrc + 1;
-    zT = zTgt - 1;
-    for ( ; zS < zT; ++zS, --zT ) // vertical loop on layers
-    {
-      for ( size_t iP = 0; iP < myBndColumns.size(); ++iP )
-      {
-        toSrcBndPnts[ iP ] = bndPoint( iP, zS );
-        toTgtBndPnts[ iP ] = bndPoint( iP, zT );
-      }
-      // compensate bnd error
-      applyBoundaryError( toSrcBndPnts, bndError[ zS-1 ], bndError[ zS-1 ], 0.5,
-                          intPntsOfLayer[ zS ], int2BndDist );
-      applyBoundaryError( toTgtBndPnts, bndError[ zT+1 ], bndError[ zT+1 ], 0.5,
-                          intPntsOfLayer[ zT ], int2BndDist );
-    }
-  }
 
-  // cout << "centerIntErrorIsSmall = " << centerIntErrorIsSmall<< endl;
-  // cout << "bndErrorIsSmall = " << bndErrorIsSmall<< endl;
+  //cout << "centerIntErrorIsSmall = " << centerIntErrorIsSmall<< endl;
 
   // Create nodes
   for ( size_t iP = 0; iP < myIntColumns.size(); ++iP )
@@ -5005,10 +5183,304 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
     for ( size_t z = zSrc + 1; z < zTgt; ++z ) // vertical loop on layers
     {
       const gp_XYZ & xyz = intPntsOfLayer[ z ][ iP ];
-      if ( !( nodeCol[ z ] = helper.AddNode( xyz.X(), xyz.Y(), xyz.Z() )))
+      if ( !( nodeCol[ z ] = myHelper->AddNode( xyz.X(), xyz.Y(), xyz.Z() )))
         return false;
     }
   }
 
   return true;
 }
+
+//================================================================================
+/*!
+ * \brief Check if all nodes of each layers have same logical Z
+ */
+//================================================================================
+
+bool StdMeshers_Sweeper::CheckSameZ()
+{
+  myZColumns.resize( myBndColumns.size() );
+  fillZColumn( myZColumns[0], *myBndColumns[0] );
+
+  bool sameZ = true;
+  const double tol = 0.1 * 1./ myBndColumns[0]->size();
+
+  // check columns based on VERTEXes
+
+  vector< int > vertexIndex;
+  vertexIndex.push_back( 0 );
+  for ( size_t iC = 1; iC < myBndColumns.size() &&  sameZ; ++iC )
+  {
+    if ( myBndColumns[iC]->front()->GetPosition()->GetDim() > 0 )
+      continue; // not on VERTEX
+
+    vertexIndex.push_back( iC );
+    fillZColumn( myZColumns[iC], *myBndColumns[iC] );
+
+    for ( size_t iZ = 0; iZ < myZColumns[0].size() &&  sameZ; ++iZ )
+      sameZ = ( Abs( myZColumns[0][iZ] - myZColumns[iC][iZ]) < tol );
+  }
+
+  // check columns based on EDGEs, one per EDGE
+
+  for ( size_t i = 1; i < vertexIndex.size() &&  sameZ; ++i )
+  {
+    if ( vertexIndex[i] - vertexIndex[i-1] < 2 )
+      continue;
+
+    int iC = ( vertexIndex[i] + vertexIndex[i-1] ) / 2;
+    fillZColumn( myZColumns[iC], *myBndColumns[iC] );
+
+    for ( size_t iZ = 0; iZ < myZColumns[0].size() &&  sameZ; ++iZ )
+      sameZ = ( Abs( myZColumns[0][iZ] - myZColumns[iC][iZ]) < tol );
+  }
+
+  if ( sameZ )
+  {
+    myZColumns.resize(1);
+  }
+  else
+  {
+    for ( size_t iC = 1; iC < myBndColumns.size(); ++iC )
+      fillZColumn( myZColumns[iC], *myBndColumns[iC] );
+  }
+
+  return sameZ;
+}
+
+//================================================================================
+/*!
+ * \brief Create internal nodes of the prism all located on straight lines with
+ *        the same distribution along the lines.
+ */
+//================================================================================
+
+bool StdMeshers_Sweeper::ComputeNodesOnStraightSameZ()
+{
+  TZColumn& z = myZColumns[0];
+
+  for ( size_t i = 0; i < myIntColumns.size(); ++i )
+  {
+    TNodeColumn& nodes = *myIntColumns[i];
+    SMESH_NodeXYZ n0( nodes[0] ), n1( nodes.back() );
+
+    for ( size_t iZ = 0; iZ < z.size(); ++iZ )
+    {
+      gp_XYZ p = n0 * ( 1 - z[iZ] ) + n1 * z[iZ];
+      nodes[ iZ+1 ] = myHelper->AddNode( p.X(), p.Y(), p.Z() );
+    }
+  }
+
+  return true;
+}
+
+//================================================================================
+/*!
+ * \brief Create internal nodes of the prism all located on straight lines with
+ *        different distributions along the lines.
+ */
+//================================================================================
+
+bool StdMeshers_Sweeper::ComputeNodesOnStraight()
+{
+  prepareTopBotDelaunay();
+
+  const SMDS_MeshNode     *botNode, *topNode;
+  const BRepMesh_Triangle *topTria;
+  double botBC[3], topBC[3]; // barycentric coordinates
+  int    botTriaNodes[3], topTriaNodes[3];
+  bool   checkUV = true;
+
+  int nbInternalNodes = myIntColumns.size();
+  myBotDelaunay->InitTraversal( nbInternalNodes );
+
+  while (( botNode = myBotDelaunay->NextNode( botBC, botTriaNodes )))
+  {
+    TNodeColumn* column = myIntColumns[ myNodeID2ColID( botNode->GetID() )];
+
+    // find a Delaunay triangle containing the topNode
+    topNode = column->back();
+    gp_XY topUV = myHelper->GetNodeUV( myTopFace, topNode, NULL, &checkUV );
+    // get a starting triangle basing on that top and bot boundary nodes have same index
+    topTria = myTopDelaunay->GetTriangleNear( botTriaNodes[0] );
+    topTria = myTopDelaunay->FindTriangle( topUV, topTria, topBC, topTriaNodes );
+    if ( !topTria )
+      return false;
+
+    // create nodes along a line
+    SMESH_NodeXYZ botP( botNode ), topP( topNode );
+    for ( size_t iZ = 0; iZ < myZColumns[0].size(); ++iZ )
+    {
+      // use barycentric coordinates as weight of Z of boundary columns
+      double botZ = 0, topZ = 0;
+      for ( int i = 0; i < 3; ++i )
+      {
+        botZ += botBC[i] * myZColumns[ botTriaNodes[i] ][ iZ ];
+        topZ += topBC[i] * myZColumns[ topTriaNodes[i] ][ iZ ];
+      }
+      double rZ = double( iZ + 1 ) / ( myZColumns[0].size() + 1 );
+      double z = botZ * ( 1 - rZ ) + topZ * rZ;
+      gp_XYZ p = botP * ( 1 - z  ) + topP * z;
+      (*column)[ iZ+1 ] = myHelper->AddNode( p.X(), p.Y(), p.Z() );
+    }
+  }
+
+  return myBotDelaunay->NbVisitedNodes() == nbInternalNodes;
+}
+
+//================================================================================
+/*!
+ * \brief Compute Z of nodes of a straight column
+ */
+//================================================================================
+
+void StdMeshers_Sweeper::fillZColumn( TZColumn&    zColumn,
+                                      TNodeColumn& nodes )
+{
+  if ( zColumn.size() == nodes.size() - 2 )
+    return;
+
+  gp_Pnt p0 = SMESH_NodeXYZ( nodes[0] );
+  gp_Vec line( p0, SMESH_NodeXYZ( nodes.back() ));
+  double len2 = line.SquareMagnitude();
+
+  zColumn.resize( nodes.size() - 2 );
+  for ( size_t i = 0; i < zColumn.size(); ++i )
+  {
+    gp_Vec vec( p0, SMESH_NodeXYZ( nodes[ i+1] ));
+    zColumn[i] = ( line * vec ) / len2; // param [0,1] on the line
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Initialize *Delaunay members
+ */
+//================================================================================
+
+void StdMeshers_Sweeper::prepareTopBotDelaunay()
+{
+  UVPtStructVec botUV( myBndColumns.size() );
+  UVPtStructVec topUV( myBndColumns.size() );
+  for ( size_t i = 0; i < myBndColumns.size(); ++i )
+  {
+    TNodeColumn& nodes = *myBndColumns[i];
+    botUV[i].node = nodes[0];
+    botUV[i].SetUV( myHelper->GetNodeUV( myBotFace, nodes[0] ));
+    topUV[i].node = nodes.back();
+    topUV[i].SetUV( myHelper->GetNodeUV( myTopFace, nodes.back() ));
+    botUV[i].node->setIsMarked( true );
+  }
+  TopoDS_Edge dummyE;
+  SMESH_Mesh* mesh = myHelper->GetMesh();
+  TSideVector botWires( 1, StdMeshers_FaceSide::New( botUV, myBotFace, dummyE, mesh ));
+  TSideVector topWires( 1, StdMeshers_FaceSide::New( topUV, myTopFace, dummyE, mesh ));
+
+  // Delaunay mesh on the FACEs.
+  bool checkUV = false;
+  myBotDelaunay.reset( new NSProjUtils::Delaunay( botWires, checkUV ));
+  myTopDelaunay.reset( new NSProjUtils::Delaunay( topWires, checkUV ));
+
+  if ( myHelper->GetIsQuadratic() )
+  {
+    // mark all medium nodes of faces on botFace to avoid their treating
+    SMESHDS_SubMesh* smDS = myHelper->GetMeshDS()->MeshElements( myBotFace );
+    SMDS_ElemIteratorPtr eIt = smDS->GetElements();
+    while ( eIt->more() )
+    {
+      const SMDS_MeshElement* e = eIt->next();
+      for ( int i = e->NbCornerNodes(), nb = e->NbNodes(); i < nb; ++i )
+        e->GetNode( i )->setIsMarked( true );
+    }
+  }
+
+  // map to get a node column by a bottom node
+  myNodeID2ColID.Clear(/*doReleaseMemory=*/false);
+  myNodeID2ColID.ReSize( myIntColumns.size() );
+
+  // un-mark nodes to treat (internal bottom nodes) to be returned by myBotDelaunay
+  for ( size_t i = 0; i < myIntColumns.size(); ++i )
+  {
+    const SMDS_MeshNode* botNode = myIntColumns[i]->front();
+    botNode->setIsMarked( false );
+    myNodeID2ColID.Bind( botNode->GetID(), i );
+  }
+}
+
+//================================================================================
+/*!
+ * \brief For each internal node column, find Delaunay triangles including it
+ *        and Barycentric Coordinates within the triangles. Fill in myTopBotTriangles
+ */
+//================================================================================
+
+bool StdMeshers_Sweeper::findDelaunayTriangles()
+{
+  const SMDS_MeshNode     *botNode, *topNode;
+  const BRepMesh_Triangle *topTria;
+  TopBotTriangles          tbTrias;
+  bool  checkUV = true;
+
+  int nbInternalNodes = myIntColumns.size();
+  myTopBotTriangles.resize( nbInternalNodes );
+
+  myBotDelaunay->InitTraversal( nbInternalNodes );
+
+  while (( botNode = myBotDelaunay->NextNode( tbTrias.myBotBC, tbTrias.myBotTriaNodes )))
+  {
+    int colID = myNodeID2ColID( botNode->GetID() );
+    TNodeColumn* column = myIntColumns[ colID ];
+
+    // find a Delaunay triangle containing the topNode
+    topNode = column->back();
+    gp_XY topUV = myHelper->GetNodeUV( myTopFace, topNode, NULL, &checkUV );
+    // get a starting triangle basing on that top and bot boundary nodes have same index
+    topTria = myTopDelaunay->GetTriangleNear( tbTrias.myBotTriaNodes[0] );
+    topTria = myTopDelaunay->FindTriangle( topUV, topTria,
+                                           tbTrias.myTopBC, tbTrias.myTopTriaNodes );
+    if ( !topTria )
+      tbTrias.SetTopByBottom();
+
+    myTopBotTriangles[ colID ] = tbTrias;
+  }
+
+  if ( myBotDelaunay->NbVisitedNodes() < nbInternalNodes )
+  {
+    myTopBotTriangles.clear();
+    return false;
+  }
+
+  myBotDelaunay.reset();
+  myTopDelaunay.reset();
+  myNodeID2ColID.Clear();
+
+  return true;
+}
+
+//================================================================================
+/*!
+ * \brief Initialize fields
+ */
+//================================================================================
+
+StdMeshers_Sweeper::TopBotTriangles::TopBotTriangles()
+{
+  myBotBC[0] = myBotBC[1] = myBotBC[2] = myTopBC[0] = myTopBC[1] = myTopBC[2] = 0.;
+  myBotTriaNodes[0] = myBotTriaNodes[1] = myBotTriaNodes[2] = 0;
+  myTopTriaNodes[0] = myTopTriaNodes[1] = myTopTriaNodes[2] = 0;
+}
+
+//================================================================================
+/*!
+ * \brief Set top data equal to bottom data
+ */
+//================================================================================
+
+void StdMeshers_Sweeper::TopBotTriangles::SetTopByBottom()
+{
+  for ( int i = 0; i < 3; ++i )
+  {
+    myTopBC[i]        = myBotBC[i];
+    myTopTriaNodes[i] = myBotTriaNodes[0];
+  }
+}
index ddfbff96a13a5c917b54248cfedad4d506334b9b..d9103b72b62a999486a72826f0fd14741b86be36 100644 (file)
 
 #include "SMESH_StdMeshers.hxx"
 
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_TypeOfPosition.hxx"
 #include "SMESHDS_Mesh.hxx"
-#include "SMESH_Algo.hxx"
 #include "SMESH_Block.hxx"
 #include "SMESH_Comment.hxx"
 #include "SMESH_Mesh.hxx"
 #include "SMESH_MesherHelper.hxx"
 #include "SMESH_TypeDefs.hxx"
 #include "SMESH_subMesh.hxx"
+#include "StdMeshers_ProjectionUtils.hxx"
 
 #include <Adaptor2d_Curve2d.hxx>
 #include <Adaptor3d_Curve.hxx>
 #include <Adaptor3d_Surface.hxx>
 #include <BRepAdaptor_Surface.hxx>
+#include <TColStd_DataMapOfIntegerInteger.hxx>
 #include <TopTools_IndexedMapOfOrientedShape.hxx>
 #include <TopoDS_Face.hxx>
 #include <gp_Trsf.hxx>
@@ -56,10 +55,6 @@ namespace Prism_3D
   struct TNode;
   struct TPrismTopo;
 }
-namespace StdMeshers_ProjectionUtils
-{
-  class TrsfFinder3D;
-}
 class SMESHDS_SubMesh;
 class TopoDS_Edge;
 
@@ -106,12 +101,14 @@ namespace Prism_3D
     TopoDS_Face              myBottom;
     TopoDS_Face              myTop;
     std::list< TopoDS_Edge > myBottomEdges;
-    std::vector< TQuadList>  myWallQuads; // wall sides can be vertically composite
+    std::vector< TQuadList>  myWallQuads;      // wall sides can be vertically composite
     std::vector< int >       myRightQuadIndex; // index of right neighbour wall quad
     std::list< int >         myNbEdgesInWires;
 
     bool                     myNotQuadOnTop;
 
+    size_t NbWires() const { return myNbEdgesInWires.size(); }
+
     void Clear();
     void SetUpsideDown();
   };
@@ -418,12 +415,22 @@ private:
  */
 struct StdMeshers_Sweeper
 {
+  // input data
+  SMESH_MesherHelper*         myHelper;
+  TopoDS_Face                 myBotFace;
+  TopoDS_Face                 myTopFace;
   std::vector< TNodeColumn* > myBndColumns; // boundary nodes
+  // output data
   std::vector< TNodeColumn* > myIntColumns; // internal nodes
 
-  bool ComputeNodes( SMESH_MesherHelper& helper,
-                     const double        tol,
-                     const bool          allowHighBndError );
+  bool ComputeNodesByTrsf( const double tol,
+                           const bool   allowHighBndError );
+
+  bool CheckSameZ();
+
+  bool ComputeNodesOnStraightSameZ();
+
+  bool ComputeNodesOnStraight();
 
 private:
 
@@ -433,19 +440,36 @@ private:
   gp_XYZ intPoint( int iP, int z ) const
   { return SMESH_TNodeXYZ( (*myIntColumns[ iP ])[ z ]); }
 
-  static bool projectIntPoints(const std::vector< gp_XYZ >& fromBndPoints,
-                               const std::vector< gp_XYZ >& toBndPoints,
-                               const std::vector< gp_XYZ >& fromIntPoints,
-                               std::vector< gp_XYZ >&       toIntPoints,
-                               StdMeshers_ProjectionUtils::TrsfFinder3D& trsf,
-                               std::vector< gp_XYZ > *      bndError);
-
-  static void applyBoundaryError(const std::vector< gp_XYZ >& bndPoints,
-                                 const std::vector< gp_XYZ >& bndError1,
-                                 const std::vector< gp_XYZ >& bndError2,
-                                 const double                 r,
-                                 std::vector< gp_XYZ >&       toIntPoints,
-                                 std::vector< double >&       int2BndDist);
+  bool projectIntPoints(const std::vector< gp_XYZ >& fromBndPoints,
+                        const std::vector< gp_XYZ >& toBndPoints,
+                        const std::vector< gp_XYZ >& fromIntPoints,
+                        std::vector< gp_XYZ >&       toIntPoints,
+                        const double                 r,
+                        StdMeshers_ProjectionUtils::TrsfFinder3D& trsf,
+                        std::vector< gp_XYZ > *      bndError);
+
+  typedef std::vector< double > TZColumn;
+  static void fillZColumn( TZColumn&    zColumn,
+                           TNodeColumn& nodes );
+
+  void prepareTopBotDelaunay();
+  bool findDelaunayTriangles();
+
+  std::vector< TZColumn >                 myZColumns; // Z distribution of boundary nodes
+
+  StdMeshers_ProjectionUtils::DelaunayPtr myTopDelaunay;
+  StdMeshers_ProjectionUtils::DelaunayPtr myBotDelaunay;
+  TColStd_DataMapOfIntegerInteger         myNodeID2ColID;
+
+  // top and bottom Delaulay triangles including an internal column
+  struct TopBotTriangles
+  {
+    double myBotBC[3], myTopBC[3]; // barycentric coordinates of a node within a triangle
+    int    myBotTriaNodes[3], myTopTriaNodes[3]; // indices of boundary columns
+    TopBotTriangles();
+    void SetTopByBottom();
+  };
+  std::vector< TopBotTriangles> myTopBotTriangles;
 };
 
 // ===============================================
@@ -455,7 +479,7 @@ private:
 class STDMESHERS_EXPORT StdMeshers_Prism_3D: public SMESH_3D_Algo
 {
 public:
-  StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Prism_3D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
@@ -486,6 +510,10 @@ public:
                          SMESH_MesherHelper*               helper);
 
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
 
  private:
 
@@ -508,11 +536,22 @@ public:
    */
   bool compute(const Prism_3D::TPrismTopo& thePrism);
 
+  /*!
+   * \brief Compute the base face of a prism
+   */
+  bool computeBase(const Prism_3D::TPrismTopo& thePrism);
+
   /*!
    * \brief Compute 2D mesh on walls FACEs of a prism
    */
   bool computeWalls(const Prism_3D::TPrismTopo& thePrism);
 
+  /*!
+   * \brief Create artificial wall quads for vertical projection between the outer and inner walls
+   */
+  void makeQuadsForOutInProjection( const Prism_3D::TPrismTopo&      thePrism,
+                                    std::multimap< int, int >&       wgt2quad,
+                                    std::map< int, FaceQuadStruct >& iW2oiQuads);
   /*!
    * \brief Returns a source EDGE of propagation to a given EDGE
    */
@@ -545,6 +584,11 @@ public:
    */
   bool isSimpleBottom( const Prism_3D::TPrismTopo& thePrism );
 
+  /*!
+   * \brief Defines if all "vertical" EDGEs are straight
+   */
+  bool allVerticalEdgesStraight( const Prism_3D::TPrismTopo& thePrism );
+
   /*!
    * \brief Project mesh faces from a source FACE of one prism to
    *        a source FACE of another prism
@@ -578,6 +622,7 @@ private:
 
   StdMeshers_PrismAsBlock myBlock;
   SMESH_MesherHelper*     myHelper;
+  SMESH_subMesh*          myPrevBottomSM;
 
   std::vector<gp_XYZ>     myShapeXYZ; // point on each sub-shape of the block
 
index c3dd4ec00d02ac9616b8711a1653f7559e3dde6c..7dd9a452fb5a1630c1da8e8abfa0b665781b0ee2 100644 (file)
@@ -44,9 +44,9 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId, int studyId,
+StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId,
                                                              SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "ProjectionSource1D"; // used by Projection_1D
   _param_algo_dim = 1; // 1D
index 122e7fa31bb716d5923930bfb826aad4b25c324c..d58535e2d60f5eb89fa76f1e5c838882547eb753 100644 (file)
@@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_ProjectionSource1D: public SMESH_Hypothesis
 {
 public:
   // Constructor
-  StdMeshers_ProjectionSource1D( int hypId, int studyId, SMESH_Gen * gen );
+  StdMeshers_ProjectionSource1D( int hypId, SMESH_Gen * gen );
   // Destructor
   virtual ~StdMeshers_ProjectionSource1D();
 
index 0a0f3a81a4793523957d2bc3a14af4f3c2fb540f..ded88d4b74f4d92d3fbcd9dd2835a9670a2690a5 100644 (file)
@@ -45,9 +45,9 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId, int studyId,
+StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId,
                                                              SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "ProjectionSource2D"; // used by Projection_2D
   _param_algo_dim = 2; // 2D
index b98847ae6bc4c75c5a924e1ca4c7d355162003fe..49e49747d43a64eed4e6d898ac9fef077a7f8dd9 100644 (file)
@@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_ProjectionSource2D: public SMESH_Hypothesis
 {
 public:
   // Constructor
-  StdMeshers_ProjectionSource2D( int hypId, int studyId, SMESH_Gen * gen );
+  StdMeshers_ProjectionSource2D( int hypId, SMESH_Gen * gen );
   // Destructor
   virtual ~StdMeshers_ProjectionSource2D();
 
index 868553480bec4a8d907483909607c0c1a8e00b05..bffe39ae3c0398fa13615d0bd7b072ddb68491b6 100644 (file)
@@ -43,9 +43,9 @@ using namespace std;
  */
 //=============================================================================
 
-StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId, int studyId,
+StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId,
                                                              SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "ProjectionSource3D"; // used by Projection_3D
   _param_algo_dim = 3; // 3D
index 54c5395ced97cf3c0192117dda9abb9f18db1120..d4d867e3b06b650ea2cc98893a5a7572db74ae70 100644 (file)
@@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_ProjectionSource3D:  public SMESH_Hypothesis
 {
 public:
   // Constructor
-  StdMeshers_ProjectionSource3D( int hypId, int studyId, SMESH_Gen * gen );
+  StdMeshers_ProjectionSource3D( int hypId, SMESH_Gen * gen );
   // Destructor
   virtual ~StdMeshers_ProjectionSource3D();
 
index a0164ef01e073439895d4a43bc8d8c62b6ab092f..11f2b5e973f04b3282b2b5f897173f9d2aa5bbd3 100644 (file)
@@ -28,6 +28,7 @@
 #include "StdMeshers_ProjectionUtils.hxx"
 
 #include "SMDS_EdgePosition.hxx"
+#include "SMDS_FacePosition.hxx"
 #include "SMESHDS_Mesh.hxx"
 #include "SMESH_Algo.hxx"
 #include "SMESH_Block.hxx"
@@ -46,6 +47,7 @@
 #include "utilities.h"
 
 #include <BRepAdaptor_Surface.hxx>
+#include <BRepMesh_Delaun.hxx>
 #include <BRepTools.hxx>
 #include <BRepTools_WireExplorer.hxx>
 #include <BRep_Builder.hxx>
@@ -476,6 +478,26 @@ namespace {
     return !allBndEdges.empty();
   }
 
+  /*!
+   * \brief Convertor used in Delaunay constructor
+   */
+  struct SideVector2UVPtStructVec
+  {
+    std::vector< const UVPtStructVec* > _uvVecs;
+
+    SideVector2UVPtStructVec( const TSideVector& wires )
+    {
+      _uvVecs.resize( wires.size() );
+      for ( size_t i = 0; i < wires.size(); ++i )
+        _uvVecs[ i ] = & wires[i]->GetUVPtStruct();
+    }
+
+    operator const std::vector< const UVPtStructVec* > & () const
+    {
+      return _uvVecs;
+    }
+  };
+
 } // namespace
 
 //=======================================================================
@@ -1098,6 +1120,11 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
         // take care of proper association of propagated edges
         bool same1 = edge1.IsSame( edges1.front() );
         bool same2 = edge2.IsSame( edges2.front() );
+        if ( !same1 && !same2 )
+        {
+          same1 = ( edges1.back().Orientation() == edge1.Orientation() );
+          same2 = ( edges2.back().Orientation() == edge2.Orientation() );
+        }
         if ( same1 != same2 )
         {
           reverseEdges(edges2, nbE);
@@ -2787,4 +2814,146 @@ namespace StdMeshers_ProjectionUtils
     }
     return true;
   }
-}
+
+  //================================================================================
+  /*!
+   * \brief triangulate the srcFace in 2D
+   *  \param [in] srcWires - boundary of the src FACE
+   */
+  //================================================================================
+
+  Morph::Morph(const TSideVector& srcWires):
+    _delaunay( srcWires, /*checkUV=*/true )
+  {
+    _srcSubMesh = srcWires[0]->GetMesh()->GetSubMesh( srcWires[0]->Face() );
+  }
+
+  //================================================================================
+  /*!
+   * \brief Move non-marked target nodes
+   *  \param [in,out] tgtHelper - helper
+   *  \param [in] tgtWires - boundary nodes of the target FACE; must be in the
+   *         same order as the nodes in srcWires given in the constructor
+   *  \param [in] src2tgtNodes - map of src -> tgt nodes
+   *  \param [in] moveAll - to move all nodes; if \c false, move only non-marked nodes
+   *  \return bool - Ok or not
+   */
+  //================================================================================
+
+  bool Morph::Perform(SMESH_MesherHelper&           tgtHelper,
+                      const TSideVector&            tgtWires,
+                      Handle(ShapeAnalysis_Surface) tgtSurface,
+                      const TNodeNodeMap&           src2tgtNodes,
+                      const bool                    moveAll)
+  {
+    // get tgt boundary points corresponding to src boundary nodes
+    size_t nbP = 0;
+    for ( size_t iW = 0; iW < tgtWires.size(); ++iW )
+      nbP += tgtWires[iW]->NbPoints() - 1; // 1st and last points coincide
+    if ( nbP != _delaunay.GetBndNodes().size() )
+      return false;
+
+    std::vector< gp_XY > tgtUV( nbP );
+    for ( size_t iW = 0, iP = 0; iW < tgtWires.size(); ++iW )
+    {
+      const UVPtStructVec& tgtPnt = tgtWires[iW]->GetUVPtStruct();
+      for ( int i = 0, nb = tgtPnt.size() - 1;  i < nb;  ++i, ++iP )
+      {
+        tgtUV[ iP ] = tgtPnt[i].UV();
+      }
+    }
+
+    SMESHDS_Mesh* tgtMesh = tgtHelper.GetMeshDS();
+    const SMDS_MeshNode *srcNode, *tgtNode;
+
+    // un-mark internal src nodes in order iterate them using _delaunay
+    int nbSrcNodes = 0;
+    SMDS_NodeIteratorPtr nIt = _srcSubMesh->GetSubMeshDS()->GetNodes();
+    if ( !nIt || !nIt->more() ) return true;
+    if ( moveAll )
+    {
+      nbSrcNodes = _srcSubMesh->GetSubMeshDS()->NbNodes();
+      while ( nIt->more() )
+        nIt->next()->setIsMarked( false );
+    }
+    else
+    {
+      while ( nIt->more() )
+        nbSrcNodes += int( !nIt->next()->isMarked() );
+    }
+
+    // Move tgt nodes
+
+    double bc[3]; // barycentric coordinates
+    int    nodeIDs[3]; // nodes of a delaunay triangle
+    const SMDS_FacePosition* pos;
+
+    _delaunay.InitTraversal( nbSrcNodes );
+
+    while (( srcNode = _delaunay.NextNode( bc, nodeIDs )))
+    {
+      // compute new coordinates for a corresponding tgt node
+      gp_XY uvNew( 0., 0. ), nodeUV;
+      for ( int i = 0; i < 3; ++i )
+        uvNew += bc[i] * tgtUV[ nodeIDs[i]];
+      gp_Pnt xyz = tgtSurface->Value( uvNew );
+
+      // find and move tgt node
+      TNodeNodeMap::const_iterator n2n = src2tgtNodes.find( srcNode );
+      if ( n2n == src2tgtNodes.end() ) continue;
+      tgtNode = n2n->second;
+      tgtMesh->MoveNode( tgtNode, xyz.X(), xyz.Y(), xyz.Z() );
+
+      if (( pos = dynamic_cast< const SMDS_FacePosition* >( tgtNode->GetPosition() )))
+        const_cast<SMDS_FacePosition*>( pos )->SetParameters( uvNew.X(), uvNew.Y() );
+
+      --nbSrcNodes;
+    }
+
+    return nbSrcNodes == 0;
+
+  } // Morph::Perform
+
+  //=======================================================================
+  //function : Delaunay
+  //purpose  : construct from face sides
+  //=======================================================================
+
+  Delaunay::Delaunay( const TSideVector& wires, bool checkUV ):
+    SMESH_Delaunay( SideVector2UVPtStructVec( wires ),
+                    TopoDS::Face( wires[0]->FaceHelper()->GetSubShape() ),
+                    wires[0]->FaceHelper()->GetSubShapeID() )
+  {
+    _wire = wires[0]; // keep a wire to assure _helper to keep alive
+    _helper = _wire->FaceHelper();
+    _checkUVPtr = checkUV ? & _checkUV : 0;
+  }
+
+  //=======================================================================
+  //function : Delaunay
+  //purpose  : construct from UVPtStructVec's
+  //=======================================================================
+
+  Delaunay::Delaunay( const std::vector< const UVPtStructVec* > & boundaryNodes,
+                      SMESH_MesherHelper&                         faceHelper,
+                      bool                                        checkUV):
+    SMESH_Delaunay( boundaryNodes,
+                    TopoDS::Face( faceHelper.GetSubShape() ),
+                    faceHelper.GetSubShapeID() )
+  {
+    _helper = & faceHelper;
+    _checkUVPtr = checkUV ? & _checkUV : 0;
+  }
+
+  //=======================================================================
+  //function : getNodeUV
+  //purpose  : 
+  //=======================================================================
+
+  gp_XY Delaunay::getNodeUV( const TopoDS_Face& face, const SMDS_MeshNode* node ) const
+  {
+    return _helper->GetNodeUV( face, node, 0, _checkUVPtr );
+  }
+  
+
+} // namespace StdMeshers_ProjectionUtils
index ced8febbd93fa0d5909844e70b5a39c901296daa..aa38284431b6bb048aa943f5aeeef368792cd499 100644 (file)
 #include "SMESH_StdMeshers.hxx"
 
 #include "SMDS_MeshElement.hxx"
+#include "SMESH_Delaunay.hxx"
+#include "StdMeshers_FaceSide.hxx"
 
+#include <ShapeAnalysis_Surface.hxx>
 #include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Vertex.hxx>
@@ -51,6 +54,7 @@ class SMESH_Mesh;
 class SMESH_subMesh;
 class TopoDS_Shape;
 
+//-----------------------------------------------------------------------------------------
 /*!
  * \brief Struct used instead of a sole TopTools_DataMapOfShapeShape to avoid
  *        problems with bidirectional bindings
@@ -91,6 +95,7 @@ namespace StdMeshers_ProjectionUtils
                    TIDCompare>                                 TNodeNodeMap;
 
 
+  //-----------------------------------------------------------------------------------------
   /*!
    * \brief Finds transformation between two sets of 2D points using
    *        a least square approximation
@@ -111,6 +116,7 @@ namespace StdMeshers_ProjectionUtils
 
     bool IsIdentity() const { return ( _trsf.Form() == gp_Identity ); }
   };
+  //-----------------------------------------------------------------------------------------
   /*!
    * \brief Finds transformation between two sets of 3D points using
    *        a least square approximation
@@ -136,6 +142,56 @@ namespace StdMeshers_ProjectionUtils
     bool Invert();
   };
 
+  //-----------------------------------------------------------------------------------------
+  /*!
+   * \brief Create a Delaunay triangulation of nodes on a face boundary
+   *        and provide exploration of nodes shared by elements lying on
+   *        the face. For a returned node, also return a Delaunay triangle
+   *        the node lies in and its Barycentric Coordinates within the triangle.
+   *        Only non-marked nodes are visited.
+   *
+   * The main methods are defined in ../SMESHUtils/SMESH_Delaunay.hxx
+   */
+  class Delaunay : public SMESH_Delaunay
+  {
+  public:
+
+    Delaunay( const TSideVector& wires, bool checkUV = false );
+
+    Delaunay( const std::vector< const UVPtStructVec* > & boundaryNodes,
+              SMESH_MesherHelper&                         faceHelper,
+              bool                                        checkUV = false);
+
+  protected:
+    virtual gp_XY getNodeUV( const TopoDS_Face& face, const SMDS_MeshNode* node ) const;
+
+  private:
+    SMESH_MesherHelper*    _helper;
+    StdMeshers_FaceSidePtr _wire;
+    bool                  *_checkUVPtr, _checkUV;
+  };
+  typedef boost::shared_ptr< Delaunay > DelaunayPtr;
+
+  //-----------------------------------------------------------------------------------------
+  /*!
+   * \brief Morph mesh on the target FACE to lie within FACE boundary w/o distortion
+   */
+  class Morph
+  {
+    Delaunay       _delaunay;
+    SMESH_subMesh* _srcSubMesh;
+  public:
+
+    Morph(const TSideVector& srcWires);
+
+    bool Perform(SMESH_MesherHelper&           tgtHelper,
+                 const TSideVector&            tgtWires,
+                 Handle(ShapeAnalysis_Surface) tgtSurface,
+                 const TNodeNodeMap&           src2tgtNodes,
+                 const bool                    moveAll);
+  };
+
+  //-----------------------------------------------------------------------------------------
   /*!
    * \brief Looks for association of all sub-shapes of two shapes
    * \param theShape1 - shape 1
index 976b0311cafac9b3d9f7341765ace65b2b26c953..029719f1b5ace280039965843168f099319f3d0c 100644 (file)
@@ -65,8 +65,8 @@ namespace TAssocTool = StdMeshers_ProjectionUtils;
 //purpose  : 
 //=======================================================================
 
-StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_1D_Algo(hypId, studyId, gen)
+StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, SMESH_Gen* gen)
+  :SMESH_1D_Algo(hypId, gen)
 {
   _name = "Projection_1D";
   _shapeType = (1 << TopAbs_EDGE);      // 1 bit per shape type
index cf7bccb23082c516d1390b637a0a2b9232f2dae0..a0cef0d648dcb81e2fba6d5775a5d5c59aa565a0 100644 (file)
@@ -38,7 +38,7 @@ class StdMeshers_ProjectionSource1D;
 class STDMESHERS_EXPORT StdMeshers_Projection_1D: public SMESH_1D_Algo
 {
 public:
-  StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Projection_1D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Projection_1D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
index c0e53ceebc99d2c577aa1c7872bc7e8b4a7959be..607efdfa64ce7894535018ebb4e31feb132f7ff7 100644 (file)
@@ -93,8 +93,8 @@ namespace
 //purpose  : 
 //=======================================================================
 
-StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(int hypId, int studyId, SMESH_Gen* gen)
-  :StdMeshers_Projection_2D(hypId, studyId, gen)
+StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(int hypId, SMESH_Gen* gen)
+  :StdMeshers_Projection_2D(hypId, gen)
 {
   _name = "Projection_1D2D";
   _requireDiscreteBoundary = false;
index 58e2ce8cc49d71cc38106527d75aca9f9046c34b..7f72cc8603efb95a0785d312b0fe0953ef008c62 100644 (file)
@@ -31,7 +31,7 @@
 class STDMESHERS_EXPORT StdMeshers_Projection_1D2D: public StdMeshers_Projection_2D
 {
 public:
-  StdMeshers_Projection_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Projection_1D2D(int hypId, SMESH_Gen* gen);
 
   virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
 
index eeb20f00981b187845326a9f89555d493339c052..03819912493e05f2437f3b1ba925bf543d84dd78 100644 (file)
@@ -85,8 +85,8 @@ namespace TAssocTool = StdMeshers_ProjectionUtils;
 //purpose  : 
 //=======================================================================
 
-StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_2D_Algo(hypId, studyId, gen)
+StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, SMESH_Gen* gen)
+  :SMESH_2D_Algo(hypId, gen)
 {
   _name = "Projection_2D";
   _compatibleHypothesis.push_back("ProjectionSource2D");
@@ -1133,7 +1133,7 @@ namespace {
   {
     SMESH_subMesh* faceSM = helper.GetMesh()->GetSubMesh( helper.GetSubShape() );
 
-    if ( helper.IsDistorted2D( faceSM, /*checkUV=*/true ))
+    //if ( helper.IsDistorted2D( faceSM, /*checkUV=*/true ))
     {
       SMESH_MeshEditor editor( helper.GetMesh() );
       SMESHDS_SubMesh* smDS = faceSM->GetSubMeshDS();
@@ -1179,240 +1179,6 @@ namespace {
     return true;
   }
 
-  typedef list< pair< const SMDS_MeshNode*, const BRepMesh_Triangle* > > TNodeTriaList;
-
-  //================================================================================
-  /*!
-   * \brief Add in-FACE nodes surrounding a given node to a queue
-   */
-  //================================================================================
-
-  void addCloseNodes( const SMDS_MeshNode*     srcNode,
-                      const BRepMesh_Triangle* bmTria,
-                      const int                srcFaceID,
-                      TNodeTriaList &          noTriQueue )
-  {
-    // find in-FACE nodes
-    SMDS_ElemIteratorPtr elems = srcNode->GetInverseElementIterator(SMDSAbs_Face);
-    while ( elems->more() )
-    {
-      const SMDS_MeshElement* elem = elems->next();
-      if ( elem->getshapeId() == srcFaceID )
-      {
-        for ( int i = 0, nb = elem->NbNodes(); i < nb; ++i )
-        {
-          const SMDS_MeshNode* n = elem->GetNode( i );
-          if ( !n->isMarked() )
-            noTriQueue.push_back( make_pair( n, bmTria ));
-        }
-      }
-    }
-  }
-
-  //================================================================================
-  /*!
-   * \brief Find a delauney triangle containing a given 2D point and return
-   *        barycentric coordinates within the found triangle
-   */
-  //================================================================================
-
-  const BRepMesh_Triangle* findTriangle( const gp_XY&                            uv,
-                                         const BRepMesh_Triangle*                bmTria,
-                                         Handle(BRepMesh_DataStructureOfDelaun)& triaDS,
-                                         double                                  bc[3] )
-  {
-    int   nodeIDs[3];
-    gp_XY nodeUVs[3];
-    int   linkIDs[3];
-    Standard_Boolean ori[3];
-
-    while ( bmTria )
-    {
-      // check bmTria
-
-      triaDS->ElementNodes( *bmTria, nodeIDs );
-      nodeUVs[0] = triaDS->GetNode( nodeIDs[0] ).Coord();
-      nodeUVs[1] = triaDS->GetNode( nodeIDs[1] ).Coord();
-      nodeUVs[2] = triaDS->GetNode( nodeIDs[2] ).Coord();
-
-      SMESH_MeshAlgos::GetBarycentricCoords( uv,
-                                             nodeUVs[0], nodeUVs[1], nodeUVs[2],
-                                             bc[0], bc[1] );
-      if ( bc[0] >= 0 && bc[1] >= 0 && bc[0] + bc[1] <= 1 )
-      {
-        bc[2] = 1 - bc[0] - bc[1];
-        return bmTria;
-      }
-
-      // look for a neighbor triangle, which is adjacent to a link intersected
-      // by a segment( triangle center -> uv )
-
-      gp_XY gc = ( nodeUVs[0] + nodeUVs[1] + nodeUVs[2] ) / 3.;
-      gp_XY seg = uv - gc;
-
-      bmTria->Edges( linkIDs, ori );
-      int triaID = triaDS->IndexOf( *bmTria );
-      bmTria = 0;
-
-      for ( int i = 0; i < 3; ++i )
-      {
-        const BRepMesh_PairOfIndex & triIDs = triaDS->ElementsConnectedTo( linkIDs[i] );
-        if ( triIDs.Extent() < 2 )
-          continue; // no neighbor triangle
-
-        // check if a link intersects gc2uv
-        const BRepMesh_Edge & link = triaDS->GetLink( linkIDs[i] );
-        const BRepMesh_Vertex & n1 = triaDS->GetNode( link.FirstNode() );
-        const BRepMesh_Vertex & n2 = triaDS->GetNode( link.LastNode() );
-        gp_XY uv1 = n1.Coord();
-        gp_XY lin = n2.Coord() - uv1; // link direction
-
-        double crossSegLin = seg ^ lin;
-        if ( Abs( crossSegLin ) < std::numeric_limits<double>::min() )
-          continue; // parallel
-
-        double uSeg = ( uv1 - gc ) ^ lin / crossSegLin;
-        if ( 0. <= uSeg && uSeg <= 1. )
-        {
-          bmTria = & triaDS->GetElement( triIDs.Index( 1 + ( triIDs.Index(1) == triaID )));
-          break;
-        }
-      }
-    }
-    return bmTria;
-  }
-
-  //================================================================================
-  /*!
-   * \brief Morph mesh on the target face to lie within FACE boundary w/o distortion
-   *
-   * algo:
-   * - make a CDT on the src FACE
-   * - find a triangle containing a src node and get its barycentric coordinates
-   * - move the node to a point with the same barycentric coordinates in a corresponding
-   *   tgt triangle
-   */
-  //================================================================================
-
-  bool morph( SMESH_MesherHelper&             tgtHelper,
-              const TopoDS_Face&              tgtFace,
-              const TopoDS_Face&              srcFace,
-              const TSideVector&              tgtWires,
-              const TSideVector&              srcWires,
-              const TAssocTool::TNodeNodeMap& src2tgtNodes )
-  {
-    if ( srcWires.size() != tgtWires.size() ) return false;
-    if ( srcWires.size() == 1 ) return false; // tmp
-
-    // count boundary points
-    int iP = 1, nbP = 0;
-    for ( size_t iW = 0; iW < srcWires.size(); ++iW )
-      nbP += srcWires[iW]->NbPoints() - 1; // 1st and last points coincide
-
-    // fill boundary points
-    BRepMesh::Array1OfVertexOfDelaun srcVert( 1, 1 + nbP ), tgtVert( 1, 1 + nbP );
-    vector< const SMDS_MeshNode* > bndSrcNodes( nbP + 1 ); bndSrcNodes[0] = 0;
-    BRepMesh_Vertex v( 0, 0, BRepMesh_Frontier );
-    for ( size_t iW = 0; iW < srcWires.size(); ++iW )
-    {
-      const UVPtStructVec& srcPnt = srcWires[iW]->GetUVPtStruct();
-      const UVPtStructVec& tgtPnt = tgtWires[iW]->GetUVPtStruct();
-      if ( srcPnt.size() != tgtPnt.size() ) return false;
-
-      for ( int i = 0, nb = srcPnt.size() - 1;  i < nb;  ++i, ++iP )
-      {
-        bndSrcNodes[ iP ]  = srcPnt[i].node;
-        srcPnt[i].node->setIsMarked( true );
-
-        v.ChangeCoord() = srcPnt[i].UV();
-        srcVert( iP )   = v;
-        v.ChangeCoord() = tgtPnt[i].UV();
-        tgtVert( iP )   = v;
-      }
-    }
-    // triangulate the srcFace in 2D
-    BRepMesh_Delaun delauney( srcVert );
-    Handle(BRepMesh_DataStructureOfDelaun) triaDS = delauney.Result();
-
-    Handle(ShapeAnalysis_Surface) tgtSurface = tgtHelper.GetSurface( tgtFace );
-    SMESHDS_Mesh* srcMesh = srcWires[0]->GetMesh()->GetMeshDS();
-    SMESHDS_Mesh* tgtMesh = tgtHelper.GetMeshDS();
-    const SMDS_MeshNode *srcNode, *tgtNode;
-    const BRepMesh_Triangle *bmTria;
-
-    // un-mark internal src nodes; later we will mark moved nodes
-    SMDS_NodeIteratorPtr nIt = srcMesh->MeshElements( srcFace )->GetNodes();
-    if ( !nIt || !nIt->more() ) return true;
-    while ( nIt->more() )
-      ( srcNode = nIt->next() )->setIsMarked( false );
-
-    // initialize a queue of nodes with starting triangles
-    const int srcFaceID = srcNode->getshapeId();
-    TNodeTriaList noTriQueue;
-    size_t iBndSrcN = 1;
-    for ( ; iBndSrcN < bndSrcNodes.size() &&  noTriQueue.empty();  ++iBndSrcN )
-    {
-      // get a triangle
-      const BRepMesh::ListOfInteger & linkIds = triaDS->LinksConnectedTo( iBndSrcN );
-      const BRepMesh_PairOfIndex &    triaIds = triaDS->ElementsConnectedTo( linkIds.First() );
-      const BRepMesh_Triangle&           tria = triaDS->GetElement( triaIds.Index(1) );
-
-      addCloseNodes( bndSrcNodes[ iBndSrcN ], &tria, srcFaceID, noTriQueue );
-    }
-
-    // Move tgt nodes
-
-    double bc[3]; // barycentric coordinates
-    int    nodeIDs[3];
-    bool   checkUV = true;
-    const SMDS_FacePosition* pos;
-
-    while ( !noTriQueue.empty() )
-    {
-      srcNode = noTriQueue.front().first;
-      bmTria  = noTriQueue.front().second;
-      noTriQueue.pop_front();
-      if ( srcNode->isMarked() )
-        continue;
-      srcNode->setIsMarked( true );
-
-      // find a delauney triangle containing the src node
-      gp_XY uv = tgtHelper.GetNodeUV( srcFace, srcNode, NULL, &checkUV );
-      bmTria = findTriangle( uv, bmTria, triaDS, bc );
-      if ( !bmTria )
-        continue;
-
-      // compute new coordinates for a corresponding tgt node
-      gp_XY uvNew( 0., 0. ), nodeUV;
-      triaDS->ElementNodes( *bmTria, nodeIDs );
-      for ( int i = 0; i < 3; ++i )
-        uvNew += bc[i] * tgtVert( nodeIDs[i]).Coord();
-      gp_Pnt xyz = tgtSurface->Value( uvNew );
-
-      // find and move tgt node
-      TAssocTool::TNodeNodeMap::const_iterator n2n = src2tgtNodes.find( srcNode );
-      if ( n2n == src2tgtNodes.end() ) continue;
-      tgtNode = n2n->second;
-      tgtMesh->MoveNode( tgtNode, xyz.X(), xyz.Y(), xyz.Z() );
-
-      if (( pos = dynamic_cast< const SMDS_FacePosition* >( tgtNode->GetPosition() )))
-        const_cast<SMDS_FacePosition*>( pos )->SetParameters( uvNew.X(), uvNew.Y() );
-
-      addCloseNodes( srcNode, bmTria, srcFaceID, noTriQueue );
-
-      // assure that all src nodes are visited
-      for ( ; iBndSrcN < bndSrcNodes.size() &&  noTriQueue.empty();  ++iBndSrcN )
-      {
-        const BRepMesh::ListOfInteger & linkIds = triaDS->LinksConnectedTo( iBndSrcN );
-        const BRepMesh_PairOfIndex &    triaIds = triaDS->ElementsConnectedTo( linkIds.First() );
-        const BRepMesh_Triangle&           tria = triaDS->GetElement( triaIds.Index(1) );
-        addCloseNodes( bndSrcNodes[ iBndSrcN ], &tria, srcFaceID, noTriQueue );
-      }
-    }
-
-    return true;
-  }
-
   //=======================================================================
   /*
    * Set initial association of VERTEXes for the case of projection
@@ -1614,11 +1380,12 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
       TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front();
       TopoDS_Shape srcE1bis = shape2ShapeMap( tgtE1 );
       reverse = ( ! srcE1.IsSame( srcE1bis ));
-      if ( reverse &&
-           //_sourceHypo->HasVertexAssociation() &&
+      if ( ( reverse || srcE1.Orientation() != srcE1bis.Orientation() ) &&
            nbEdgesInWires.front() > 2 &&
            helper.IsRealSeam( tgtEdges.front() ))
       {
+        if ( srcE1.Orientation() != srcE1bis.Orientation() )
+          reverse = true;
         // projection to a face with seam EDGE; pb is that GetOrderedEdges()
         // always puts a seam EDGE first (if possible) and as a result
         // we can't use only theReverse flag to correctly associate source
@@ -1933,7 +1700,9 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
     // ----------------------------------------------------------------
     if ( helper.IsDistorted2D( tgtSubMesh, /*checkUV=*/false, &helper ))
     {
-      morph( helper, tgtFace, srcFace, tgtWires, srcWires, _src2tgtNodes );
+      TAssocTool::Morph morph( srcWires );
+      morph.Perform( helper, tgtWires, helper.GetSurface( tgtFace ),
+                     _src2tgtNodes, /*moveAll=*/true );
 
       if ( !fixDistortedFaces( helper, tgtWires ))
         return error("Invalid mesh generated");
index 2ccb2172984c0edee262f0ea99f1ad0a2e475c82..98864c3faec2f06e141188024cac60ec4f0fa781 100644 (file)
@@ -37,7 +37,7 @@ class StdMeshers_ProjectionSource2D;
 class STDMESHERS_EXPORT StdMeshers_Projection_2D: public SMESH_2D_Algo
 {
 public:
-  StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Projection_2D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Projection_2D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
index 040b2efc4bc8f13afb6f5e596022adbf8ac0f3ab..95bc469136c4636c7d6682bdaf90d31b1a170b8c 100644 (file)
@@ -65,8 +65,8 @@ using namespace std;
 //purpose  : 
 //=======================================================================
 
-StdMeshers_Projection_3D::StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Projection_3D::StdMeshers_Projection_3D(int hypId, SMESH_Gen* gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "Projection_3D";
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);  // 1 bit per shape type
index b1a05f9ac02da495bc3ce449d340fa6137695fff..e09f007accd44103f1bb234cbe5b77c0cc5aacf4 100644 (file)
@@ -36,7 +36,7 @@ class StdMeshers_ProjectionSource3D;
 class STDMESHERS_EXPORT StdMeshers_Projection_3D: public SMESH_3D_Algo
 {
 public:
-  StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Projection_3D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Projection_3D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
@@ -57,6 +57,10 @@ public:
    */
   virtual void SetEventListener(SMESH_subMesh* whenSetToSubMesh);
   
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
 
  protected:
index 56a5887bc3c7bac0b225fde756a7e77b0e12bdc1..3d82126adf50eeba19d875054d7669f3b9da6a72 100644 (file)
@@ -85,16 +85,15 @@ namespace {
  */
 //=============================================================================
 
-StdMeshers_Propagation::StdMeshers_Propagation (int hypId, int studyId, SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_Propagation::StdMeshers_Propagation (int hypId, SMESH_Gen * gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = GetName();
   _param_algo_dim = -1; // 1D auxiliary
 }
 StdMeshers_PropagOfDistribution::StdMeshers_PropagOfDistribution (int hypId,
-                                                                  int studyId,
                                                                   SMESH_Gen * gen)
-  : StdMeshers_Propagation(hypId, studyId, gen)                        { _name = GetName(); }
+  : StdMeshers_Propagation(hypId, gen)                                 { _name = GetName(); }
 StdMeshers_Propagation::~StdMeshers_Propagation()                      {}
 string StdMeshers_Propagation::GetName ()                              { return "Propagation"; }
 string StdMeshers_PropagOfDistribution::GetName ()                     { return "PropagOfDistribution"; }
index d94608a965769bb2e9bf017838e2c6fcbf99229a..7f76acf0fd6a1a473217fcb6aba312ce7bd41169 100644 (file)
@@ -46,7 +46,7 @@ class SMESH_HypoFilter;
 class STDMESHERS_EXPORT StdMeshers_Propagation : public SMESH_Hypothesis
 {
  public:
-  StdMeshers_Propagation(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_Propagation(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_Propagation();
 
   virtual std::ostream & SaveTo(std::ostream & save);
@@ -105,7 +105,7 @@ class STDMESHERS_EXPORT StdMeshers_Propagation : public SMESH_Hypothesis
 class STDMESHERS_EXPORT StdMeshers_PropagOfDistribution: public StdMeshers_Propagation
 {
  public:
-  StdMeshers_PropagOfDistribution(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_PropagOfDistribution(int hypId, SMESH_Gen * gen);
 
   static std::string GetName();
 };
index a4d3ffbdd04d533ae97ba9083fa8df465e3bbfc3..c531c5aaee5881e63bee3c138e68e0b251501c73 100644 (file)
@@ -71,8 +71,8 @@ using namespace std;
 class StdMeshers_QuadFromMedialAxis_1D2D::Algo1D : public StdMeshers_Regular_1D
 {
 public:
-  Algo1D(int studyId, SMESH_Gen* gen):
-    StdMeshers_Regular_1D( gen->GetANewId(), studyId, gen )
+  Algo1D(SMESH_Gen* gen):
+    StdMeshers_Regular_1D( gen->GetANewId(), gen )
   {
   }
   void SetSegmentLength( double len )
@@ -152,9 +152,8 @@ public:
 //================================================================================
 
 StdMeshers_QuadFromMedialAxis_1D2D::StdMeshers_QuadFromMedialAxis_1D2D(int        hypId,
-                                                                       int        studyId,
                                                                        SMESH_Gen* gen)
-  : StdMeshers_Quadrangle_2D(hypId, studyId, gen),
+  : StdMeshers_Quadrangle_2D(hypId, gen),
     _regular1D( 0 )
 {
   _name = "QuadFromMedialAxis_1D2D";
@@ -741,7 +740,7 @@ namespace
     }
 
     // cout << "from salome.geom import geomBuilder" << endl;
-    // cout << "geompy = geomBuilder.New(salome.myStudy)" << endl;
+    // cout << "geompy = geomBuilder.New()" << endl;
     Handle(TColgp_HArray1OfPnt) points = new TColgp_HArray1OfPnt(1, pnt.size());
     for ( size_t i = 0; i < pnt.size(); ++i )
     {
@@ -2166,7 +2165,7 @@ bool StdMeshers_QuadFromMedialAxis_1D2D::Compute(SMESH_Mesh&         theMesh,
     SMESH_MAT2d::MedialAxis ma( F, sinuFace._sinuEdges, minSegLen, /*ignoreCorners=*/true );
 
     if ( !_regular1D )
-      _regular1D = new Algo1D( _studyId, _gen );
+      _regular1D = new Algo1D( _gen );
     _regular1D->SetSegmentLength( minSegLen );
 
     vector<double> maParams;
index 58a3364c77f53b4e8e0d01c0a7dcba1001df65ec..0940f15f06dbb748b7c0c4edcb412f728176a450 100644 (file)
@@ -37,7 +37,7 @@
 class STDMESHERS_EXPORT StdMeshers_QuadFromMedialAxis_1D2D: public StdMeshers_Quadrangle_2D
 {
  public:
-  StdMeshers_QuadFromMedialAxis_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_QuadFromMedialAxis_1D2D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_QuadFromMedialAxis_1D2D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
@@ -53,6 +53,10 @@ class STDMESHERS_EXPORT StdMeshers_QuadFromMedialAxis_1D2D: public StdMeshers_Qu
 
   virtual void SetEventListener(SMESH_subMesh* subMesh);
 
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
 
   class Algo1D;
index e45b4cf687f494d50191386feca5db2e70dcc9cb..dc3e692e1ad7edc5c42cdc801a4a652e42f239f6 100644 (file)
@@ -42,9 +42,9 @@ using namespace std;
  *
  */
 //=============================================================================
-StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
+StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId,
                                                          SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen)
+  : SMESH_Hypothesis(hypId, gen)
 {
   _name = "QuadrangleParams";
   _param_algo_dim = 2;
index 051ec58a23dca00f17441c1da24fdc4015872699..64247e0b63e89918ccd2fcb15282a7a8f3cda87c 100644 (file)
@@ -44,7 +44,7 @@ enum StdMeshers_QuadType
 class STDMESHERS_EXPORT StdMeshers_QuadrangleParams: public SMESH_Hypothesis
 {
 public:
-  StdMeshers_QuadrangleParams(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_QuadrangleParams(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_QuadrangleParams();
 
   void SetTriaVertex (int id);
index b6c49182a35fe246936c364f923bb1bd82b0207b..453b1fd6c7f71b9ecde332e0e25ee33d2d15e0d3 100644 (file)
@@ -36,9 +36,8 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_QuadranglePreference::StdMeshers_QuadranglePreference(int         hypId,
-                                                                 int         studyId,
                                                                  SMESH_Gen * gen)
-     :SMESH_Hypothesis(hypId, studyId, gen)
+     :SMESH_Hypothesis(hypId, gen)
 {
   _name = "QuadranglePreference";
   _param_algo_dim = -2; // auxiliary used by NETGEN 2D
index 6ed0677c1795f410bac361c8cde918f5b3db7715..747ed7e5f45a4addc2eb65ef3e21233b92186bad 100644 (file)
@@ -41,7 +41,7 @@
 class STDMESHERS_EXPORT StdMeshers_QuadranglePreference:public SMESH_Hypothesis
 {
  public:
-  StdMeshers_QuadranglePreference(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_QuadranglePreference(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_QuadranglePreference();
   
   virtual std::ostream & SaveTo(std::ostream & save);
index ef472e49aedb00e20e3801668428cf71439ef8d4..9a51d8a6d1c06002532fcc520a3ff6eea840cb18 100644 (file)
@@ -82,9 +82,9 @@ typedef SMESH_Comment TComm;
  */
 //=============================================================================
 
-StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId,
+StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId,
                                                     SMESH_Gen* gen)
-  : SMESH_2D_Algo(hypId, studyId, gen),
+  : SMESH_2D_Algo(hypId, gen),
     myQuadranglePreference(false),
     myTrianglePreference(false),
     myTriaVertexID(-1),
index a1938bde983a2d5353f6ddc8f719caa1b2dfb2f9..7c121fb1fd9f7c363b583be9296a450fb7082c47 100644 (file)
@@ -135,7 +135,7 @@ struct FaceQuadStruct
 class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo
 {
  public:
-  StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Quadrangle_2D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Quadrangle_2D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
@@ -158,6 +158,10 @@ class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo
                                    const bool          considerMesh = false,
                                    SMESH_MesherHelper* aFaceHelper = 0);
 
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
 
  protected:
index e014c36c9ee8e0f6044d482da75d4bf242372985..0203e322b9fb2559a3ec334db6435f4b2d638259 100644 (file)
@@ -36,9 +36,8 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_QuadraticMesh::StdMeshers_QuadraticMesh(int         hypId,
-                                                   int         studyId,
                                                    SMESH_Gen * gen)
-     :SMESH_Hypothesis(hypId, studyId, gen)
+     :SMESH_Hypothesis(hypId, gen)
 {
   _name = "QuadraticMesh";
   _param_algo_dim = -1; // it means auxiliary, dim = 1
index aba0880899cfb6d776a8dd2c1703af8fa77b1db4..5073faa5e6bfeb8a82becd1d4616f42b4e98ef4d 100644 (file)
@@ -43,7 +43,7 @@
 class STDMESHERS_EXPORT StdMeshers_QuadraticMesh:public SMESH_Hypothesis
 {
  public:
-  StdMeshers_QuadraticMesh(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_QuadraticMesh(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_QuadraticMesh();
   
   virtual std::ostream & SaveTo(std::ostream & save);
index bbf339a8b124c022eda732e432df85d6ad46d563..dd533d9b770cdd55c1ea3a64ca6b0a20c669c3a8 100644 (file)
@@ -71,8 +71,8 @@ namespace ProjectionUtils = StdMeshers_ProjectionUtils;
 //purpose  : 
 //=======================================================================
 
-StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, SMESH_Gen* gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "RadialPrism_3D";
   _shapeType = (1 << TopAbs_SOLID);     // 1 bit per shape type
@@ -338,7 +338,7 @@ public:
     const int myID = -1000;
     TNodeDistributor* myHyp = dynamic_cast<TNodeDistributor*>( aMesh.GetHypothesis( myID ));
     if ( !myHyp )
-      myHyp = new TNodeDistributor( myID, 0, aMesh.GetGen() );
+      myHyp = new TNodeDistributor( myID, aMesh.GetGen() );
     return myHyp;
   }
   // -----------------------------------------------------------------------------
@@ -376,8 +376,8 @@ public:
   }
 protected:
   // -----------------------------------------------------------------------------
-  TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
-    : StdMeshers_Regular_1D( hypId, studyId, gen)
+  TNodeDistributor( int hypId, SMESH_Gen* gen)
+    : StdMeshers_Regular_1D( hypId, gen)
   {
   }
   // -----------------------------------------------------------------------------
index 1f20b17fc9329a1e6b5d02c9a3acd34186aca824..34561414f2064db67a7b20eb31cfb52611d8d7fe 100644 (file)
@@ -43,7 +43,7 @@ class gp_Pnt;
 class STDMESHERS_EXPORT StdMeshers_RadialPrism_3D: public SMESH_3D_Algo
 {
 public:
-  StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_RadialPrism_3D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_RadialPrism_3D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
@@ -55,6 +55,10 @@ public:
   virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
                         MapShapeNbElems& aResMap);
 
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
 
 protected:
index dc573828efbe53b0b3df87d1827214f6deae49d5..9828818f9a20cc5cf25b239ee20fd2828a76a088 100644 (file)
@@ -74,9 +74,8 @@ using namespace std;
 //=======================================================================
 
 StdMeshers_RadialQuadrangle_1D2D::StdMeshers_RadialQuadrangle_1D2D(int        hypId,
-                                                                   int        studyId,
                                                                    SMESH_Gen* gen)
-  :StdMeshers_Quadrangle_2D( hypId, studyId, gen )
+  :StdMeshers_Quadrangle_2D( hypId, gen )
 {
   _name = "RadialQuadrangle_1D2D";
   _shapeType = (1 << TopAbs_FACE);        // 1 bit per shape type
@@ -631,7 +630,7 @@ public:
     const int myID = -1001;
     TNodeDistributor* myHyp = dynamic_cast<TNodeDistributor*>( aMesh.GetHypothesis( myID ));
     if ( !myHyp )
-      myHyp = new TNodeDistributor( myID, 0, aMesh.GetGen() );
+      myHyp = new TNodeDistributor( myID, aMesh.GetGen() );
     return myHyp;
   }
   // -----------------------------------------------------------------------------
@@ -726,8 +725,8 @@ public:
   }
 protected:
   // -----------------------------------------------------------------------------
-  TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
-    : StdMeshers_Regular_1D( hypId, studyId, gen)
+  TNodeDistributor( int hypId, SMESH_Gen* gen)
+    : StdMeshers_Regular_1D( hypId, gen)
   {
   }
   // -----------------------------------------------------------------------------
index 7270cba40d28c67a3d7340c6c30c7a7709052eaa..a53b0285971bfbcc78ca3adbdb0bdc92a53f0cc7 100644 (file)
@@ -39,7 +39,7 @@ class StdMeshers_LayerDistribution;
 class STDMESHERS_EXPORT StdMeshers_RadialQuadrangle_1D2D: public StdMeshers_Quadrangle_2D
 {
 public:
-  StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_RadialQuadrangle_1D2D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_RadialQuadrangle_1D2D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
@@ -58,9 +58,13 @@ public:
    */
   virtual void SubmeshRestored(SMESH_subMesh* subMesh);
   
+  virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
+  {
+    return IsApplicable( shape, toCheckAll );
+  }
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
 
-protected:
+ protected:
 
   int computeLayerPositions(StdMeshers_FaceSidePtr linSide,
                             std::vector< double >& positions,
index 6746a502c1daef9cd0bd9655ceae17c87baafcde..d1aa0122d9c53fdaa32d895c8d8506c92ea23749 100644 (file)
@@ -78,9 +78,8 @@ using namespace StdMeshers;
 //=============================================================================
 
 StdMeshers_Regular_1D::StdMeshers_Regular_1D(int         hypId,
-                                             int         studyId,
                                              SMESH_Gen * gen)
-  :SMESH_1D_Algo( hypId, studyId, gen )
+  :SMESH_1D_Algo( hypId, gen )
 {
   _name = "Regular_1D";
   _shapeType = (1 << TopAbs_EDGE);
@@ -629,7 +628,7 @@ void StdMeshers_Regular_1D::redistributeNearVertices (SMESH_Mesh &          theM
         double L = GCPnts_AbscissaPoint::Length( theC3d, *itU, l);
         static StdMeshers_Regular_1D* auxAlgo = 0;
         if ( !auxAlgo ) {
-          auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _studyId, _gen );
+          auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _gen );
           auxAlgo->_hypType = BEG_END_LENGTH;
         }
         auxAlgo->_value[ BEG_LENGTH_IND ] = Lm;
index d2af675f7d182f892601886c0e53eb4d10975239..bc17cf4f87e8231b168168d7c906cdf8a9db9f90 100644 (file)
@@ -44,7 +44,7 @@ class TopoDS_Vertex;
 class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo
 {
 public:
-  StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Regular_1D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_Regular_1D();
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
index b5b20f7af8d79476d889dfb9bd5c71315d7498c6..72c435d904a800673c323524925cc5b6d22e1ba1 100644 (file)
@@ -33,8 +33,8 @@
  */
 //=============================================================================
 
-StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, SMESH_Gen * gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _param_algo_dim = 1; 
 }
index c146e1728d95f17be1e08c61319ca347b1698fa2..a8d62257c46479b6bf19231476fe8329483723af 100644 (file)
@@ -38,7 +38,7 @@
 class STDMESHERS_EXPORT StdMeshers_Reversible1D : public SMESH_Hypothesis
 {
 public:
-  StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_Reversible1D(int hypId, SMESH_Gen* gen);
 
   void SetReversedEdges( const std::vector<int>& ids);
 
index f938d28291b9ede29780c4d6e3cc8587dd8275f3..c5bb4fd0dca29db095bef6ccd271015a3aad4f42 100644 (file)
@@ -36,8 +36,8 @@
 //=======================================================================
 
 StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
-                                   (int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_0D_Algo(hypId, studyId, gen)
+                                   (int hypId, SMESH_Gen* gen)
+  :SMESH_0D_Algo(hypId, gen)
 {
   _name = "SegmentAroundVertex_0D";
   // it is assigned to vertices but influence a state of EDGE submeshes
index 3e863df4c998309c4fc48aad36ff1d5270b2e931..c8fbe88c1622bb004a4a3481b605ba3e19e3e2ec 100644 (file)
@@ -38,7 +38,7 @@
 class STDMESHERS_EXPORT StdMeshers_SegmentAroundVertex_0D: public SMESH_0D_Algo
 {
 public:
-  StdMeshers_SegmentAroundVertex_0D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_SegmentAroundVertex_0D(int hypId, SMESH_Gen* gen);
   virtual ~StdMeshers_SegmentAroundVertex_0D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
index 317d44cbd232d185be35d010e806094d88d8cfe8..1b0dd37cea53e1cb51e079da8022603b43c84d2d 100644 (file)
@@ -50,8 +50,8 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_SegmentLengthAroundVertex::StdMeshers_SegmentLengthAroundVertex
-                                       (int hypId, int studyId, SMESH_Gen * gen)
-  :SMESH_Hypothesis(hypId, studyId, gen)
+                                       (int hypId, SMESH_Gen * gen)
+  :SMESH_Hypothesis(hypId, gen)
 {
   _length = 1.;
   _name = "SegmentLengthAroundVertex";
index 66b095c13a8b0ef5b43380481dd09be77c74f5ee..198ba34c6c792d3cd980793ccf375b5d706fb96d 100644 (file)
@@ -40,7 +40,7 @@
 class STDMESHERS_EXPORT StdMeshers_SegmentLengthAroundVertex:public SMESH_Hypothesis
 {
  public:
-  StdMeshers_SegmentLengthAroundVertex(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_SegmentLengthAroundVertex(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_SegmentLengthAroundVertex();
 
   void SetLength(double length) throw(SALOME_Exception);
index 5e63f8cae30e7cc24e38607cf00a381468613b5a..a78244733fb87c430df2db85e380ce693b71718e 100644 (file)
@@ -48,9 +48,8 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_StartEndLength::StdMeshers_StartEndLength(int         hypId,
-                                                     int         studyId,
                                                      SMESH_Gen * gen)
-     :SMESH_Hypothesis(hypId, studyId, gen)
+     :SMESH_Hypothesis(hypId, gen)
 {
   _begLength = 1.;
   _endLength = 10.;
index 37a442c439b8b57e2edff79c9488683c488e71a6..fed02351aa363a9348c154278c0d5d7f127af0bc 100644 (file)
@@ -37,7 +37,7 @@
 class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis
 {
  public:
-  StdMeshers_StartEndLength(int hypId, int studyId, SMESH_Gen * gen);
+  StdMeshers_StartEndLength(int hypId, SMESH_Gen * gen);
   virtual ~ StdMeshers_StartEndLength();
 
   void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
index 6fcd338dca60bcc217db22a6c525cc05eb45870f..1f8a5b03b21ca5ec4c9f878b3397807b6b571635 100644 (file)
@@ -34,8 +34,8 @@
 //=======================================================================
 
 StdMeshers_UseExisting_1D::StdMeshers_UseExisting_1D
-                                   (int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_1D_Algo(hypId, studyId, gen)
+                                   (int hypId, SMESH_Gen* gen)
+  :SMESH_1D_Algo(hypId, gen)
 {
   _name = "UseExisting_1D";
   _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
@@ -89,8 +89,8 @@ bool StdMeshers_UseExisting_1D::Evaluate(SMESH_Mesh&,
 //=======================================================================
 
 StdMeshers_UseExisting_2D::StdMeshers_UseExisting_2D
-                                   (int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_2D_Algo(hypId, studyId, gen)
+                                   (int hypId, SMESH_Gen* gen)
+  :SMESH_2D_Algo(hypId, gen)
 {
   _name = "UseExisting_2D";
   _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
index 9bcb4a0fff2c49c33fd0ff86b47a290881bccde3..307693819f6a433c3d436865a7c34d8ce12749db 100644 (file)
@@ -35,7 +35,7 @@
 class STDMESHERS_EXPORT StdMeshers_UseExisting_2D: public SMESH_2D_Algo
 {
 public:
-  StdMeshers_UseExisting_2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_UseExisting_2D(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
                                const TopoDS_Shape&                  aShape,
@@ -50,7 +50,7 @@ public:
 class STDMESHERS_EXPORT StdMeshers_UseExisting_1D: public SMESH_1D_Algo
 {
 public:
-  StdMeshers_UseExisting_1D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_UseExisting_1D(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
                                const TopoDS_Shape&                  aShape,
index a6530b9244a5782abe3a820e82075e2aab951077..eafdf22ef132433b1160be9fc79ffb6e3c07ce12 100644 (file)
@@ -95,7 +95,7 @@
 #include <string>
 
 #ifdef _DEBUG_
-//#define __myDEBUG
+#define __myDEBUG
 //#define __NOT_INVALIDATE_BAD_SMOOTH
 //#define __NODES_AT_POS
 #endif
@@ -427,20 +427,21 @@ namespace VISCOUS_3D
 
     enum EFlags { TO_SMOOTH       = 0x0000001,
                   MOVED           = 0x0000002, // set by _neibors[i]->SetNewLength()
-                  SMOOTHED        = 0x0000004, // set by this->Smooth()
+                  SMOOTHED        = 0x0000004, // set by _LayerEdge::Smooth()
                   DIFFICULT       = 0x0000008, // near concave VERTEX
                   ON_CONCAVE_FACE = 0x0000010,
                   BLOCKED         = 0x0000020, // not to inflate any more
                   INTERSECTED     = 0x0000040, // close intersection with a face found
                   NORMAL_UPDATED  = 0x0000080,
-                  MARKED          = 0x0000100, // local usage
-                  MULTI_NORMAL    = 0x0000200, // a normal is invisible by some of surrounding faces
-                  NEAR_BOUNDARY   = 0x0000400, // is near FACE boundary forcing smooth
-                  SMOOTHED_C1     = 0x0000800, // is on _eosC1
-                  DISTORTED       = 0x0001000, // was bad before smoothing
-                  RISKY_SWOL      = 0x0002000, // SWOL is parallel to a source FACE
-                  SHRUNK          = 0x0004000, // target node reached a tgt position while shrink()
-                  UNUSED_FLAG     = 0x0100000  // to add use flags after
+                  UPD_NORMAL_CONV = 0x0000100, // to update normal on boundary of concave FACE
+                  MARKED          = 0x0000200, // local usage
+                  MULTI_NORMAL    = 0x0000400, // a normal is invisible by some of surrounding faces
+                  NEAR_BOUNDARY   = 0x0000800, // is near FACE boundary forcing smooth
+                  SMOOTHED_C1     = 0x0001000, // is on _eosC1
+                  DISTORTED       = 0x0002000, // was bad before smoothing
+                  RISKY_SWOL      = 0x0004000, // SWOL is parallel to a source FACE
+                  SHRUNK          = 0x0008000, // target node reached a tgt position while shrink()
+                  UNUSED_FLAG     = 0x0100000  // to add user flags after
     };
     bool Is   ( int flag ) const { return _flags & flag; }
     void Set  ( int flag ) { _flags |= flag; }
@@ -497,7 +498,7 @@ namespace VISCOUS_3D
     const gp_XYZ& PrevPos() const { return _pos[ _pos.size() - 2 ]; }
     gp_XYZ PrevCheckPos( _EdgesOnShape* eos=0 ) const;
     gp_Ax1 LastSegment(double& segLen, _EdgesOnShape& eos) const;
-    gp_XY  LastUV( const TopoDS_Face& F, _EdgesOnShape& eos ) const;
+    gp_XY  LastUV( const TopoDS_Face& F, _EdgesOnShape& eos, int which=-1 ) const;
     bool   IsOnEdge() const { return _2neibors; }
     gp_XYZ Copy( _LayerEdge& other, _EdgesOnShape& eos, SMESH_MesherHelper& helper );
     void   SetCosin( double cosin );
@@ -664,6 +665,8 @@ namespace VISCOUS_3D
 
     _SolidData*            _data; // parent SOLID
 
+    _LayerEdge*      operator[](size_t i) const { return (_LayerEdge*) _edges[i]; }
+    size_t           size() const { return _edges.size(); }
     TopAbs_ShapeEnum ShapeType() const
     { return _shape.IsNull() ? TopAbs_SHAPE : _shape.ShapeType(); }
     TopAbs_ShapeEnum SWOLType() const
@@ -678,7 +681,7 @@ namespace VISCOUS_3D
 
   //--------------------------------------------------------------------------------
   /*!
-   * \brief Convex FACE whose radius of curvature is less than the thickness of 
+   * \brief Convex FACE whose radius of curvature is less than the thickness of
    *        layers. It is used to detect distortion of prisms based on a convex
    *        FACE and to update normals to enable further increasing the thickness
    */
@@ -692,7 +695,14 @@ namespace VISCOUS_3D
     // map a sub-shape to _SolidData::_edgesOnShape
     map< TGeomID, _EdgesOnShape* >  _subIdToEOS;
 
+    bool                            _isTooCurved;
     bool                            _normalsFixed;
+    bool                            _normalsFixedOnBorders; // used in putOnOffsetSurface()
+
+    double GetMaxCurvature( _SolidData&         data,
+                            _EdgesOnShape&      eof,
+                            BRepLProp_SLProps&  surfProp,
+                            SMESH_MesherHelper& helper);
 
     bool GetCenterOfCurvature( _LayerEdge*         ledge,
                                BRepLProp_SLProps&  surfProp,
@@ -757,8 +767,6 @@ namespace VISCOUS_3D
 
     int                              _nbShapesToSmooth;
 
-    //map< TGeomID,Handle(Geom_Curve)> _edge2curve;
-
     vector< _CollisionEdges >        _collisionEdges;
     set< TGeomID >                   _concaveFaces;
 
@@ -870,6 +878,7 @@ namespace VISCOUS_3D
                             const gp_XY&   uvToFix,
                             const double   refSign );
   };
+  struct PyDump;
   //--------------------------------------------------------------------------------
   /*!
    * \brief Builder of viscous layers
@@ -942,8 +951,11 @@ namespace VISCOUS_3D
     void makeOffsetSurface( _EdgesOnShape& eos, SMESH_MesherHelper& );
     void putOnOffsetSurface( _EdgesOnShape& eos, int infStep,
                              vector< _EdgesOnShape* >& eosC1,
-                             int smooStep=0, bool moveAll=false );
+                             int smooStep=0, int moveAll=false );
     void findCollisionEdges( _SolidData& data, SMESH_MesherHelper& helper );
+    void findEdgesToUpdateNormalNearConvexFace( _ConvexFace &       convFace,
+                                                _SolidData&         data,
+                                                SMESH_MesherHelper& helper );
     void limitMaxLenByCurvature( _SolidData& data, SMESH_MesherHelper& helper );
     void limitMaxLenByCurvature( _LayerEdge* e1, _LayerEdge* e2,
                                  _EdgesOnShape& eos1, _EdgesOnShape& eos2,
@@ -987,6 +999,7 @@ namespace VISCOUS_3D
     TopTools_MapOfShape        _shrinkedFaces;
 
     int                        _tmpFaceID;
+    PyDump*                    _pyDump;
   };
   //--------------------------------------------------------------------------------
   /*!
@@ -1034,6 +1047,7 @@ namespace VISCOUS_3D
     size_t             _iSeg[2];  // index of segment where extreme tgt node is projected
     _EdgesOnShape&     _eos;
     double             _curveLen; // length of the EDGE
+    std::pair<int,int> _eToSmooth[2]; // <from,to> indices of _LayerEdge's in _eos
 
     static Handle(Geom_Curve) CurveForSmooth( const TopoDS_Edge&  E,
                                               _EdgesOnShape&      eos,
@@ -1047,31 +1061,24 @@ namespace VISCOUS_3D
     bool Perform(_SolidData&                    data,
                  Handle(ShapeAnalysis_Surface)& surface,
                  const TopoDS_Face&             F,
-                 SMESH_MesherHelper&            helper )
-    {
-      if ( _leParams.empty() || ( !isAnalytic() && _offPoints.empty() ))
-        prepare( data );
+                 SMESH_MesherHelper&            helper );
 
-      if ( isAnalytic() )
-        return smoothAnalyticEdge( data, surface, F, helper );
-      else
-        return smoothComplexEdge ( data, surface, F, helper );
-    }
     void prepare(_SolidData& data );
 
+    void findEdgesToSmooth();
+
+    bool isToSmooth( int iE );
+
     bool smoothAnalyticEdge( _SolidData&                    data,
                              Handle(ShapeAnalysis_Surface)& surface,
                              const TopoDS_Face&             F,
                              SMESH_MesherHelper&            helper);
-
     bool smoothComplexEdge( _SolidData&                    data,
                             Handle(ShapeAnalysis_Surface)& surface,
                             const TopoDS_Face&             F,
                             SMESH_MesherHelper&            helper);
-
     gp_XYZ getNormalNormal( const gp_XYZ & normal,
                             const gp_XYZ&  edgeDir);
-
     _LayerEdge* getLEdgeOnV( bool is2nd )
     {
       return _eos._edges[ is2nd ? _eos._edges.size()-1 : 0 ]->_2neibors->_edges[ is2nd ];
@@ -1198,8 +1205,8 @@ namespace VISCOUS_3D
 //================================================================================
 // StdMeshers_ViscousLayers hypothesis
 //
-StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_Hypothesis(hypId, studyId, gen),
+StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, SMESH_Gen* gen)
+  :SMESH_Hypothesis(hypId, gen),
    _isToIgnoreShapes(1), _nbLayers(1), _thickness(1), _stretchFactor(1),
    _method( SURF_OFFSET_SMOOTH )
 {
@@ -1663,18 +1670,19 @@ namespace VISCOUS_3D
   // HOWTO use: run python commands written in a console to see
   //  construction steps of viscous layers
 #ifdef __myDEBUG
-  ofstream* py;
-  int       theNbPyFunc;
-  struct PyDump {
+  ostream* py;
+  int      theNbPyFunc;
+  struct PyDump
+  {
     PyDump(SMESH_Mesh& m) {
       int tag = 3 + m.GetId();
       const char* fname = "/tmp/viscous.py";
       cout << "execfile('"<<fname<<"')"<<endl;
-      py = new ofstream(fname);
+      py = _pyStream = new ofstream(fname);
       *py << "import SMESH" << endl
           << "from salome.smesh import smeshBuilder" << endl
-          << "smesh  = smeshBuilder.New(salome.myStudy)" << endl
-          << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:" << tag <<"')" << endl
+          << "smesh  = smeshBuilder.New()" << endl
+          << "meshSO = salome.myStudy.FindObjectID('0:1:2:" << tag <<"')" << endl
           << "mesh   = smesh.Mesh( meshSO.GetObject() )"<<endl;
       theNbPyFunc = 0;
     }
@@ -1688,6 +1696,14 @@ namespace VISCOUS_3D
       delete py; py=0;
     }
     ~PyDump() { Finish(); cout << "NB FUNCTIONS: " << theNbPyFunc << endl; }
+    struct MyStream : public ostream
+    {
+      template <class T> ostream & operator<<( const T &anything ) { return *this ; }
+    };
+    void Pause() { py = &_mystream; }
+    void Resume() { py = _pyStream; }
+    MyStream _mystream;
+    ostream* _pyStream;
   };
 #define dumpFunction(f) { _dumpFunction(f, __LINE__);}
 #define dumpMove(n)     { _dumpMove(n, __LINE__);}
@@ -1710,7 +1726,7 @@ namespace VISCOUS_3D
 
 #else
 
-  struct PyDump { PyDump(SMESH_Mesh&) {} void Finish() {} };
+  struct PyDump { PyDump(SMESH_Mesh&) {} void Finish() {} void Pause() {} void Resume() {} };
 #define dumpFunction(f) f
 #define dumpMove(n)
 #define dumpMoveComm(n,txt)
@@ -1852,6 +1868,7 @@ SMESH_ComputeErrorPtr _ViscousBuilder::Compute(SMESH_Mesh&         theMesh,
     return SMESH_ComputeErrorPtr(); // everything already computed
 
   PyDump debugDump( theMesh );
+  _pyDump = &debugDump;
 
   // TODO: ignore already computed SOLIDs 
   if ( !findSolidsWithLayers())
@@ -2777,8 +2794,6 @@ void _ViscousBuilder::limitStepSizeByCurvature( _SolidData& data )
 {
   SMESH_MesherHelper helper( *_mesh );
 
-  const int nbTestPnt = 5; // on a FACE sub-shape
-
   BRepLProp_SLProps surfProp( 2, 1e-6 );
   data._convexFaces.clear();
 
@@ -2790,58 +2805,27 @@ void _ViscousBuilder::limitStepSizeByCurvature( _SolidData& data )
       continue;
 
     TopoDS_Face        F = TopoDS::Face( eof._shape );
-    SMESH_subMesh *   sm = eof._subMesh;
     const TGeomID faceID = eof._shapeID;
 
     BRepAdaptor_Surface surface( F, false );
     surfProp.SetSurface( surface );
 
-    bool isTooCurved = false;
-
     _ConvexFace cnvFace;
-    const double        oriFactor = ( F.Orientation() == TopAbs_REVERSED ? +1. : -1. );
-    SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true);
-    while ( smIt->more() )
-    {
-      sm = smIt->next();
-      const TGeomID subID = sm->GetId();
-      // find _LayerEdge's of a sub-shape
-      _EdgesOnShape* eos;
-      if (( eos = data.GetShapeEdges( subID )))
-        cnvFace._subIdToEOS.insert( make_pair( subID, eos ));
-      else
-        continue;
-      // check concavity and curvature and limit data._stepSize
-      const double minCurvature =
-        1. / ( eos->_hyp.GetTotalThickness() * ( 1 + theThickToIntersection ));
-      size_t iStep = Max( 1, eos->_edges.size() / nbTestPnt );
-      for ( size_t i = 0; i < eos->_edges.size(); i += iStep )
-      {
-        gp_XY uv = helper.GetNodeUV( F, eos->_edges[ i ]->_nodes[0] );
-        surfProp.SetParameters( uv.X(), uv.Y() );
-        if ( !surfProp.IsCurvatureDefined() )
-          continue;
-        if ( surfProp.MaxCurvature() * oriFactor > minCurvature )
-        {
-          limitStepSize( data, 0.9 / surfProp.MaxCurvature() * oriFactor );
-          isTooCurved = true;
-        }
-        if ( surfProp.MinCurvature() * oriFactor > minCurvature )
-        {
-          limitStepSize( data, 0.9 / surfProp.MinCurvature() * oriFactor );
-          isTooCurved = true;
-        }
-      }
-    } // loop on sub-shapes of the FACE
+    cnvFace._face = F;
+    cnvFace._normalsFixed = false;
+    cnvFace._isTooCurved = false;
 
-    if ( !isTooCurved ) continue;
+    double maxCurvature = cnvFace.GetMaxCurvature( data, eof, surfProp, helper );
+    if ( maxCurvature > 0 )
+    {
+      limitStepSize( data, 0.9 / maxCurvature );
+      findEdgesToUpdateNormalNearConvexFace( cnvFace, data, helper );
+    }
+    if ( !cnvFace._isTooCurved ) continue;
 
     _ConvexFace & convFace =
       data._convexFaces.insert( make_pair( faceID, cnvFace )).first->second;
 
-    convFace._face = F;
-    convFace._normalsFixed = false;
-
     // skip a closed surface (data._convexFaces is useful anyway)
     bool isClosedF = false;
     helper.SetSubShape( F );
@@ -2854,6 +2838,7 @@ void _ViscousBuilder::limitStepSizeByCurvature( _SolidData& data )
     if ( isClosedF )
     {
       // limit _LayerEdge::_maxLen on the FACE
+      const double oriFactor    = ( F.Orientation() == TopAbs_REVERSED ? +1. : -1. );
       const double minCurvature =
         1. / ( eof._hyp.GetTotalThickness() * ( 1 + theThickToIntersection ));
       map< TGeomID, _EdgesOnShape* >::iterator id2eos = cnvFace._subIdToEOS.find( faceID );
@@ -2865,14 +2850,13 @@ void _ViscousBuilder::limitStepSizeByCurvature( _SolidData& data )
           _LayerEdge* ledge = eos._edges[ i ];
           gp_XY uv = helper.GetNodeUV( F, ledge->_nodes[0] );
           surfProp.SetParameters( uv.X(), uv.Y() );
-          if ( !surfProp.IsCurvatureDefined() )
-            continue;
-
-          if ( surfProp.MaxCurvature() * oriFactor > minCurvature )
-            ledge->_maxLen = Min( ledge->_maxLen, 1. / surfProp.MaxCurvature() * oriFactor );
-
-          if ( surfProp.MinCurvature() * oriFactor > minCurvature )
-            ledge->_maxLen = Min( ledge->_maxLen, 1. / surfProp.MinCurvature() * oriFactor );
+          if ( surfProp.IsCurvatureDefined() )
+          {
+            double curvature = Max( surfProp.MaxCurvature() * oriFactor,
+                                    surfProp.MinCurvature() * oriFactor );
+            if ( curvature > minCurvature )
+              ledge->_maxLen = Min( ledge->_maxLen, 1. / curvature );
+          }
         }
       }
       continue;
@@ -3049,8 +3033,8 @@ bool _ViscousBuilder::findShapesToSmooth( _SolidData& data )
         {
           eos._edgeSmoother = new _Smoother1D( curve, eos );
 
-          for ( size_t i = 0; i < eos._edges.size(); ++i )
-            eos._edges[i]->Set( _LayerEdge::TO_SMOOTH );
+          // for ( size_t i = 0; i < eos._edges.size(); ++i )
+          //   eos._edges[i]->Set( _LayerEdge::TO_SMOOTH );
         }
       }
     }
@@ -3429,11 +3413,12 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge&         edge,
   }
 
   // find _normal
+  bool fromVonF = false;
   if ( useGeometry )
   {
-    bool fromVonF = ( eos.ShapeType() == TopAbs_VERTEX &&
-                      eos.SWOLType()  == TopAbs_FACE  &&
-                      totalNbFaces > 1 );
+    fromVonF = ( eos.ShapeType() == TopAbs_VERTEX &&
+                 eos.SWOLType()  == TopAbs_FACE  &&
+                 totalNbFaces > 1 );
 
     if ( onShrinkShape && !fromVonF ) // one of faces the node is on has no layers
     {
@@ -3535,14 +3520,19 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge&         edge,
       break;
     }
     case TopAbs_VERTEX: {
-      //if ( eos.SWOLType() != TopAbs_FACE ) // else _cosin is set by getFaceDir()
+      if ( fromVonF )
+      {
+        getFaceDir( TopoDS::Face( eos._sWOL ), TopoDS::Vertex( eos._shape ),
+                    node, helper, normOK, &edge._cosin );
+      }
+      else if ( eos.SWOLType() != TopAbs_FACE ) // else _cosin is set by getFaceDir()
       {
         TopoDS_Vertex V  = TopoDS::Vertex( eos._shape );
         gp_Vec inFaceDir = getFaceDir( F, V, node, helper, normOK );
         double angle     = inFaceDir.Angle( edge._normal ); // [0,PI]
         edge._cosin      = Cos( angle );
         if ( totalNbFaces > 2 || helper.IsSeamShape( node->getshapeId() ))
-          for ( int iF = totalNbFaces-2; iF >=0; --iF )
+          for ( int iF = 1; iF < totalNbFaces; ++iF )
           {
             F = face2Norm[ iF ].first;
             inFaceDir = getFaceDir( F, V, node, helper, normOK=true );
@@ -4428,11 +4418,14 @@ bool _ViscousBuilder::inflate(_SolidData& data)
     data._epsilon = data._stepSize * 1e-7;
 
   debugMsg( "-- geomSize = " << data._geomSize << ", stepSize = " << data._stepSize );
+  _pyDump->Pause();
 
   findCollisionEdges( data, helper );
 
   limitMaxLenByCurvature( data, helper );
 
+  _pyDump->Resume();
+
   // limit length of _LayerEdge's around MULTI_NORMAL _LayerEdge's
   for ( size_t i = 0; i < data._edgesOnShape.size(); ++i )
     if ( data._edgesOnShape[i].ShapeType() == TopAbs_VERTEX &&
@@ -4959,7 +4952,7 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data,
         // ignore intersection of a _LayerEdge based on a _ConvexFace with a face
         // lying on this _ConvexFace
         if ( _ConvexFace* convFace = data.GetConvexFace( intFace->getshapeId() ))
-          if ( convFace->_subIdToEOS.count ( eos._shapeID ))
+          if ( convFace->_isTooCurved && convFace->_subIdToEOS.count ( eos._shapeID ))
             continue;
 
         // ignore intersection of a _LayerEdge based on a FACE with an element on this FACE
@@ -4971,15 +4964,16 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data,
         if ( dist > 0 )
         {
           bool toIgnore = false;
-          if (  eos._edges[i]->Is( _LayerEdge::TO_SMOOTH ))
+          if (  eos._toSmooth )
           {
             const TopoDS_Shape& S = getMeshDS()->IndexToShape( intFace->getshapeId() );
             if ( !S.IsNull() && S.ShapeType() == TopAbs_FACE )
             {
-              TopExp_Explorer edge( eos._shape, TopAbs_EDGE );
-              for ( ; !toIgnore && edge.More(); edge.Next() )
-                // is adjacent - has a common EDGE
-                toIgnore = ( helper.IsSubShape( edge.Current(), S ));
+              TopExp_Explorer sub( eos._shape,
+                                   eos.ShapeType() == TopAbs_FACE ? TopAbs_EDGE : TopAbs_VERTEX );
+              for ( ; !toIgnore && sub.More(); sub.Next() )
+                // is adjacent - has a common EDGE or VERTEX
+                toIgnore = ( helper.IsSubShape( sub.Current(), S ));
 
               if ( toIgnore ) // check angle between normals
               {
@@ -5264,7 +5258,7 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape&            eos,
                                           int                       infStep,
                                           vector< _EdgesOnShape* >& eosC1,
                                           int                       smooStep,
-                                          bool                      moveAll )
+                                          int                       moveAll )
 {
   _EdgesOnShape * eof = & eos;
   if ( eos.ShapeType() != TopAbs_FACE ) // eos is a boundary of C1 FACE, look for the FACE eos
@@ -5295,8 +5289,13 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape&            eos,
     edge->Unset( _LayerEdge::MARKED );
     if ( edge->Is( _LayerEdge::BLOCKED ) || !edge->_curvature )
       continue;
-    if ( !moveAll && !edge->Is( _LayerEdge::MOVED ))
+    if ( moveAll == _LayerEdge::UPD_NORMAL_CONV )
+    {
+      if ( !edge->Is( _LayerEdge::UPD_NORMAL_CONV ))
         continue;
+    }
+    else if ( !moveAll && !edge->Is( _LayerEdge::MOVED ))
+      continue;
 
     int nbBlockedAround = 0;
     for ( size_t iN = 0; iN < edge->_neibors.size(); ++iN )
@@ -5306,7 +5305,7 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape&            eos,
 
     gp_Pnt tgtP = SMESH_TNodeXYZ( edge->_nodes.back() );
     gp_Pnt2d uv = eof->_offsetSurf->NextValueOfUV( edge->_curvature->_uv, tgtP, preci );
-    if ( eof->_offsetSurf->Gap() > edge->_len ) continue; // NextValueOfUV() bug 
+    if ( eof->_offsetSurf->Gap() > edge->_len ) continue; // NextValueOfUV() bug
     edge->_curvature->_uv = uv;
     if ( eof->_offsetSurf->Gap() < 10 * preci ) continue; // same pos
 
@@ -5325,9 +5324,15 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape&            eos,
       edge->_pos.back() = newP;
 
       edge->Set( _LayerEdge::MARKED );
+      if ( moveAll == _LayerEdge::UPD_NORMAL_CONV )
+      {
+        edge->_normal = ( newP - prevP ).Normalized();
+      }
     }
   }
 
+
+
 #ifdef _DEBUG_
   // dumpMove() for debug
   size_t i = 0;
@@ -5336,7 +5341,7 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape&            eos,
       break;
   if ( i < eos._edges.size() )
   {
-    dumpFunction(SMESH_Comment("putOnOffsetSurface_F") << eos._shapeID
+    dumpFunction(SMESH_Comment("putOnOffsetSurface_S") << eos._shapeID
                  << "_InfStep" << infStep << "_" << smooStep );
     for ( ; i < eos._edges.size(); ++i )
     {
@@ -5346,6 +5351,26 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape&            eos,
     dumpFunctionEnd();
   }
 #endif
+
+  _ConvexFace* cnvFace;
+  if ( moveAll != _LayerEdge::UPD_NORMAL_CONV &&
+       eos.ShapeType() == TopAbs_FACE &&
+       (cnvFace = eos.GetData().GetConvexFace( eos._shapeID )) &&
+       !cnvFace->_normalsFixedOnBorders )
+  {
+    // put on the surface nodes built on FACE boundaries
+    SMESH_subMeshIteratorPtr smIt = eos._subMesh->getDependsOnIterator(/*includeSelf=*/false);
+    while ( smIt->more() )
+    {
+      SMESH_subMesh* sm = smIt->next();
+      _EdgesOnShape* subEOS = eos.GetData().GetShapeEdges( sm->GetId() );
+      if ( !subEOS->_sWOL.IsNull() ) continue;
+      if ( std::find( eosC1.begin(), eosC1.end(), subEOS ) != eosC1.end() ) continue;
+
+      putOnOffsetSurface( *subEOS, infStep, eosC1, smooStep, _LayerEdge::UPD_NORMAL_CONV );
+    }
+    cnvFace->_normalsFixedOnBorders = true;
+  }
 }
 
 //================================================================================
@@ -5443,6 +5468,106 @@ Handle(Geom_Curve) _Smoother1D::CurveForSmooth( const TopoDS_Edge&  E,
   return Handle(Geom_Curve)();
 }
 
+//================================================================================
+/*!
+ * \brief Smooth edges on EDGE
+ */
+//================================================================================
+
+bool _Smoother1D::Perform(_SolidData&                    data,
+                          Handle(ShapeAnalysis_Surface)& surface,
+                          const TopoDS_Face&             F,
+                          SMESH_MesherHelper&            helper )
+{
+  if ( _leParams.empty() || ( !isAnalytic() && _offPoints.empty() ))
+    prepare( data );
+
+  findEdgesToSmooth();
+  if ( isAnalytic() )
+    return smoothAnalyticEdge( data, surface, F, helper );
+  else
+    return smoothComplexEdge ( data, surface, F, helper );
+}
+
+//================================================================================
+/*!
+ * \brief Find edges to smooth
+ */
+//================================================================================
+
+void _Smoother1D::findEdgesToSmooth()
+{
+  _LayerEdge* leOnV[2] = { getLEdgeOnV(0), getLEdgeOnV(1) };
+  for ( int iEnd = 0; iEnd < 2; ++iEnd )
+    if ( leOnV[iEnd]->Is( _LayerEdge::NORMAL_UPDATED ))
+      _leOnV[iEnd]._cosin = Abs( _edgeDir[iEnd].Normalized() * leOnV[iEnd]->_normal );
+
+  _eToSmooth[0].first = _eToSmooth[0].second = 0;
+
+  for ( size_t i = 0; i < _eos.size(); ++i )
+  {
+    if ( !_eos[i]->Is( _LayerEdge::TO_SMOOTH ))
+    {
+      if ( needSmoothing( _leOnV[0]._cosin, _eos[i]->_len, _curveLen * _leParams[i] ) ||
+           isToSmooth( i ))
+        _eos[i]->Set( _LayerEdge::TO_SMOOTH );
+      else
+        break;
+    }
+    _eToSmooth[0].second = i+1;
+  }
+
+  _eToSmooth[1].first = _eToSmooth[1].second = _eos.size();
+
+  for ( int i = _eos.size() - 1; i >= _eToSmooth[0].second; --i )
+  {
+    if ( !_eos[i]->Is( _LayerEdge::TO_SMOOTH ))
+    {
+      if ( needSmoothing( _leOnV[1]._cosin, _eos[i]->_len, _curveLen * ( 1.-_leParams[i] )) ||
+           isToSmooth( i ))
+        _eos[i]->Set( _LayerEdge::TO_SMOOTH );
+      else
+        break;
+    }
+    _eToSmooth[1].first = i;
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Check if iE-th _LayerEdge needs smoothing
+ */
+//================================================================================
+
+bool _Smoother1D::isToSmooth( int iE )
+{
+  SMESH_NodeXYZ pi( _eos[iE]->_nodes[0] );
+  SMESH_NodeXYZ p0( _eos[iE]->_2neibors->srcNode(0) );
+  SMESH_NodeXYZ p1( _eos[iE]->_2neibors->srcNode(1) );
+  gp_XYZ       seg0 = pi - p0;
+  gp_XYZ       seg1 = p1 - pi;
+  gp_XYZ    tangent =  seg0 + seg1;
+  double tangentLen = tangent.Modulus();
+  double  segMinLen = Min( seg0.Modulus(), seg1.Modulus() );
+  if ( tangentLen < std::numeric_limits<double>::min() )
+    return false;
+  tangent /= tangentLen;
+
+  for ( size_t i = 0; i < _eos[iE]->_neibors.size(); ++i )
+  {
+    _LayerEdge* ne = _eos[iE]->_neibors[i];
+    if ( !ne->Is( _LayerEdge::TO_SMOOTH ) ||
+         ne->_nodes.size() < 2 ||
+         ne->_nodes[0]->GetPosition()->GetDim() != 2 )
+      continue;
+    gp_XYZ edgeVec = SMESH_NodeXYZ( ne->_nodes.back() ) - SMESH_NodeXYZ( ne->_nodes[0] );
+    double    proj = edgeVec * tangent;
+    if ( needSmoothing( 1., proj, segMinLen ))
+      return true;
+  }
+  return false;
+}
+
 //================================================================================
 /*!
  * \brief smooth _LayerEdge's on a staight EDGE or circular EDGE
@@ -5456,80 +5581,100 @@ bool _Smoother1D::smoothAnalyticEdge( _SolidData&                    data,
 {
   if ( !isAnalytic() ) return false;
 
-  const size_t iFrom = 0, iTo = _eos._edges.size();
+  size_t iFrom = 0, iTo = _eos._edges.size();
 
   if ( _anaCurve->IsKind( STANDARD_TYPE( Geom_Line )))
   {
     if ( F.IsNull() ) // 3D
     {
-      SMESH_TNodeXYZ p0   ( _eos._edges[iFrom]->_2neibors->tgtNode(0) );
-      SMESH_TNodeXYZ p1   ( _eos._edges[iTo-1]->_2neibors->tgtNode(1) );
       SMESH_TNodeXYZ pSrc0( _eos._edges[iFrom]->_2neibors->srcNode(0) );
       SMESH_TNodeXYZ pSrc1( _eos._edges[iTo-1]->_2neibors->srcNode(1) );
-      gp_XYZ newPos, lineDir = pSrc1 - pSrc0;
-      _LayerEdge* vLE0 = _eos._edges[iFrom]->_2neibors->_edges[0];
-      _LayerEdge* vLE1 = _eos._edges[iTo-1]->_2neibors->_edges[1];
-      bool shiftOnly = ( vLE0->Is( _LayerEdge::NORMAL_UPDATED ) ||
-                         vLE0->Is( _LayerEdge::BLOCKED ) ||
-                         vLE1->Is( _LayerEdge::NORMAL_UPDATED ) ||
-                         vLE1->Is( _LayerEdge::BLOCKED ));
-      for ( size_t i = iFrom; i < iTo; ++i )
-      {
-        _LayerEdge*       edge = _eos._edges[i];
-        SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( edge->_nodes.back() );
-        newPos = p0 * ( 1. - _leParams[i] ) + p1 * _leParams[i];
-
-        if ( shiftOnly || edge->Is( _LayerEdge::NORMAL_UPDATED ))
-        {
-          gp_XYZ curPos = SMESH_TNodeXYZ ( tgtNode );
-          double  shift = ( lineDir * ( newPos - pSrc0 ) -
-                            lineDir * ( curPos - pSrc0 ));
-          newPos = curPos + lineDir * shift / lineDir.SquareModulus();
-        }
-        if ( edge->Is( _LayerEdge::BLOCKED ))
+      //const   gp_XYZ lineDir = pSrc1 - pSrc0;
+      //_LayerEdge* vLE0 = getLEdgeOnV( 0 );
+      //_LayerEdge* vLE1 = getLEdgeOnV( 1 );
+      // bool shiftOnly = ( vLE0->Is( _LayerEdge::NORMAL_UPDATED ) ||
+      //                    vLE0->Is( _LayerEdge::BLOCKED ) ||
+      //                    vLE1->Is( _LayerEdge::NORMAL_UPDATED ) ||
+      //                    vLE1->Is( _LayerEdge::BLOCKED ));
+      for ( int iEnd = 0; iEnd < 2; ++iEnd )
+      {
+        iFrom = _eToSmooth[ iEnd ].first, iTo = _eToSmooth[ iEnd ].second;
+        if ( iFrom >= iTo ) continue;
+        SMESH_TNodeXYZ p0( _eos[iFrom]->_2neibors->tgtNode(0) );
+        SMESH_TNodeXYZ p1( _eos[iTo-1]->_2neibors->tgtNode(1) );
+        double param0 = ( iFrom == 0 ) ? 0. : _leParams[ iFrom-1 ];
+        double param1 = _leParams[ iTo ];
+        for ( size_t i = iFrom; i < iTo; ++i )
         {
-          SMESH_TNodeXYZ pSrc( edge->_nodes[0] );
-          double curThick = pSrc.SquareDistance( tgtNode );
-          double newThink = ( pSrc - newPos ).SquareModulus();
-          if ( newThink > curThick )
-            continue;
+          _LayerEdge*       edge = _eos[i];
+          SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( edge->_nodes.back() );
+          double           param = ( _leParams[i] - param0 ) / ( param1 - param0 );
+          gp_XYZ          newPos = p0 * ( 1. - param ) + p1 * param;
+
+          // if ( shiftOnly || edge->Is( _LayerEdge::NORMAL_UPDATED ))
+          // {
+          //   gp_XYZ curPos = SMESH_TNodeXYZ ( tgtNode );
+          //   double  shift = ( lineDir * ( newPos - pSrc0 ) -
+          //                     lineDir * ( curPos - pSrc0 ));
+          //   newPos = curPos + lineDir * shift / lineDir.SquareModulus();
+          // }
+          if ( edge->Is( _LayerEdge::BLOCKED ))
+          {
+            SMESH_TNodeXYZ pSrc( edge->_nodes[0] );
+            double curThick = pSrc.SquareDistance( tgtNode );
+            double newThink = ( pSrc - newPos ).SquareModulus();
+            if ( newThink > curThick )
+              continue;
+          }
+          edge->_pos.back() = newPos;
+          tgtNode->setXYZ( newPos.X(), newPos.Y(), newPos.Z() );
+          dumpMove( tgtNode );
         }
-        edge->_pos.back() = newPos;
-        tgtNode->setXYZ( newPos.X(), newPos.Y(), newPos.Z() );
-        dumpMove( tgtNode );
       }
     }
     else // 2D
     {
-      _LayerEdge* e0 = getLEdgeOnV( 0 );
-      _LayerEdge* e1 = getLEdgeOnV( 1 );
-      gp_XY uv0 = e0->LastUV( F, *data.GetShapeEdges( e0 ));
-      gp_XY uv1 = e1->LastUV( F, *data.GetShapeEdges( e1 ));
-      if ( e0->_nodes.back() == e1->_nodes.back() ) // closed edge
+      _LayerEdge* eV0 = getLEdgeOnV( 0 );
+      _LayerEdge* eV1 = getLEdgeOnV( 1 );
+      gp_XY      uvV0 = eV0->LastUV( F, *data.GetShapeEdges( eV0 ));
+      gp_XY      uvV1 = eV1->LastUV( F, *data.GetShapeEdges( eV1 ));
+      if ( eV0->_nodes.back() == eV1->_nodes.back() ) // closed edge
       {
         int iPeriodic = helper.GetPeriodicIndex();
         if ( iPeriodic == 1 || iPeriodic == 2 )
         {
-          uv1.SetCoord( iPeriodic, helper.GetOtherParam( uv1.Coord( iPeriodic )));
-          if ( uv0.Coord( iPeriodic ) > uv1.Coord( iPeriodic ))
-            std::swap( uv0, uv1 );
+          uvV1.SetCoord( iPeriodic, helper.GetOtherParam( uvV1.Coord( iPeriodic )));
+          if ( uvV0.Coord( iPeriodic ) > uvV1.Coord( iPeriodic ))
+            std::swap( uvV0, uvV1 );
         }
       }
-      const gp_XY rangeUV = uv1 - uv0;
-      for ( size_t i = iFrom; i < iTo; ++i )
-      {
-        if ( _eos._edges[i]->Is( _LayerEdge::BLOCKED )) continue;
-        gp_XY newUV = uv0 + _leParams[i] * rangeUV;
-        _eos._edges[i]->_pos.back().SetCoord( newUV.X(), newUV.Y(), 0 );
-
-        gp_Pnt newPos = surface->Value( newUV.X(), newUV.Y() );
-        SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( _eos._edges[i]->_nodes.back() );
-        tgtNode->setXYZ( newPos.X(), newPos.Y(), newPos.Z() );
-        dumpMove( tgtNode );
+      for ( int iEnd = 0; iEnd < 2; ++iEnd )
+      {
+        iFrom = _eToSmooth[ iEnd ].first, iTo = _eToSmooth[ iEnd ].second;
+        if ( iFrom >= iTo ) continue;
+        _LayerEdge* e0 = _eos[iFrom]->_2neibors->_edges[0];
+        _LayerEdge* e1 = _eos[iTo-1]->_2neibors->_edges[1];
+        gp_XY uv0 = ( e0 == eV0 ) ? uvV0 : e0->LastUV( F, _eos );
+        gp_XY uv1 = ( e1 == eV1 ) ? uvV1 : e1->LastUV( F, _eos );
+        double param0 = ( iFrom == 0 ) ? 0. : _leParams[ iFrom-1 ];
+        double param1 = _leParams[ iTo ];
+        const gp_XY rangeUV = uv1 - uv0;
+        for ( size_t i = iFrom; i < iTo; ++i )
+        {
+          if ( _eos[i]->Is( _LayerEdge::BLOCKED )) continue;
+          double param = ( _leParams[i] - param0 ) / ( param1 - param0 );
+          gp_XY newUV = uv0 + param * rangeUV;
+          _eos[i]->_pos.back().SetCoord( newUV.X(), newUV.Y(), 0 );
+
+          gp_Pnt newPos = surface->Value( newUV.X(), newUV.Y() );
+          SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( _eos[i]->_nodes.back() );
+          tgtNode->setXYZ( newPos.X(), newPos.Y(), newPos.Z() );
+          dumpMove( tgtNode );
 
-        SMDS_FacePosition* pos = static_cast<SMDS_FacePosition*>( tgtNode->GetPosition() );
-        pos->SetUParameter( newUV.X() );
-        pos->SetVParameter( newUV.Y() );
+          SMDS_FacePosition* pos = static_cast<SMDS_FacePosition*>( tgtNode->GetPosition() );
+          pos->SetUParameter( newUV.X() );
+          pos->SetVParameter( newUV.Y() );
+        }
       }
     }
     return true;
@@ -5568,9 +5713,10 @@ bool _Smoother1D::smoothAnalyticEdge( _SolidData&                    data,
       if ( uLast < 0 )
         uLast += 2 * M_PI;
       
-      for ( size_t i = iFrom; i < iTo; ++i )
+      for ( size_t i = 0; i < _eos.size(); ++i )
       {
-        if ( _eos._edges[i]->Is( _LayerEdge::BLOCKED )) continue;
+        if ( _eos[i]->Is( _LayerEdge::BLOCKED )) continue;
+        //if ( !_eos[i]->Is( _LayerEdge::TO_SMOOTH )) continue;
         double u = uLast * _leParams[i];
         gp_Pnt p = ElCLib::Value( u, newCirc );
         _eos._edges[i]->_pos.back() = p.XYZ();
@@ -5602,9 +5748,10 @@ bool _Smoother1D::smoothAnalyticEdge( _SolidData&                    data,
 
       gp_Ax2d   axis( center, vec0 );
       gp_Circ2d circ( axis, radius );
-      for ( size_t i = iFrom; i < iTo; ++i )
+      for ( size_t i = 0; i < _eos.size(); ++i )
       {
-        if ( _eos._edges[i]->Is( _LayerEdge::BLOCKED )) continue;
+        if ( _eos[i]->Is( _LayerEdge::BLOCKED )) continue;
+        //if ( !_eos[i]->Is( _LayerEdge::TO_SMOOTH )) continue;
         double    newU = uLast * _leParams[i];
         gp_Pnt2d newUV = ElCLib::Value( newU, circ );
         _eos._edges[i]->_pos.back().SetCoord( newUV.X(), newUV.Y(), 0 );
@@ -5639,7 +5786,9 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
   if ( _offPoints.empty() )
     return false;
 
+  // ----------------------------------------------
   // move _offPoints along normals of _LayerEdge's
+  // ----------------------------------------------
 
   _LayerEdge* e[2] = { getLEdgeOnV(0), getLEdgeOnV(1) };
   if ( e[0]->Is( _LayerEdge::NORMAL_UPDATED ))
@@ -5683,7 +5832,9 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
     }
   }
 
+  // -----------------------------------------------------------------
   // project tgt nodes of extreme _LayerEdge's to the offset segments
+  // -----------------------------------------------------------------
 
   if ( e[0]->Is( _LayerEdge::NORMAL_UPDATED )) _iSeg[0] = 0;
   if ( e[1]->Is( _LayerEdge::NORMAL_UPDATED )) _iSeg[1] = _offPoints.size()-2;
@@ -5747,7 +5898,9 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
   if ( e[1]->_normal * vDiv1.XYZ() < 0 ) e[1]->_len += d1;
   else                                   e[1]->_len -= d1;
 
+  // ---------------------------------------------------------------------------------
   // compute normalized length of the offset segments located between the projections
+  // ---------------------------------------------------------------------------------
 
   size_t iSeg = 0, nbSeg = _iSeg[1] - _iSeg[0] + 1;
   vector< double > len( nbSeg + 1 );
@@ -5771,12 +5924,15 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
   _offPoints[ _iSeg[0]   ]._xyz = pExtreme[0].XYZ();
   _offPoints[ _iSeg[1]+ 1]._xyz = pExtreme[1].XYZ();
 
+  // -------------------------------------------------------------
   // distribute tgt nodes of _LayerEdge's between the projections
+  // -------------------------------------------------------------
 
   iSeg = 0;
-  for ( size_t i = 0; i < _eos._edges.size(); ++i )
+  for ( size_t i = 0; i < _eos.size(); ++i )
   {
-    if ( _eos._edges[i]->Is( _LayerEdge::BLOCKED )) continue;
+    if ( _eos[i]->Is( _LayerEdge::BLOCKED )) continue;
+    //if ( !_eos[i]->Is( _LayerEdge::TO_SMOOTH )) continue;
     while ( iSeg+2 < len.size() && _leParams[i] > len[ iSeg+1 ] )
       iSeg++;
     double r = ( _leParams[i] - len[ iSeg ]) / ( len[ iSeg+1 ] - len[ iSeg ]);
@@ -5785,17 +5941,17 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
 
     if ( surface.IsNull() )
     {
-      _eos._edges[i]->_pos.back() = p;
+      _eos[i]->_pos.back() = p;
     }
     else // project a new node position to a FACE
     {
-      gp_Pnt2d uv ( _eos._edges[i]->_pos.back().X(), _eos._edges[i]->_pos.back().Y() );
+      gp_Pnt2d uv ( _eos[i]->_pos.back().X(), _eos[i]->_pos.back().Y() );
       gp_Pnt2d uv2( surface->NextValueOfUV( uv, p, fTol ));
 
       p = surface->Value( uv2 ).XYZ();
-      _eos._edges[i]->_pos.back().SetCoord( uv2.X(), uv2.Y(), 0 );
+      _eos[i]->_pos.back().SetCoord( uv2.X(), uv2.Y(), 0 );
     }
-    SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( _eos._edges[i]->_nodes.back() );
+    SMDS_MeshNode* tgtNode = const_cast<SMDS_MeshNode*>( _eos[i]->_nodes.back() );
     tgtNode->setXYZ( p.X(), p.Y(), p.Z() );
     dumpMove( tgtNode );
   }
@@ -5836,8 +5992,20 @@ void _Smoother1D::prepare(_SolidData& data)
     double fullLen = _leParams.back() + pPrev.Distance( SMESH_TNodeXYZ( getLEdgeOnV(1)->_nodes[0]));
     for ( size_t i = 0; i < _leParams.size()-1; ++i )
       _leParams[i] = _leParams[i+1] / fullLen;
+    _leParams.back() = 1.;
   }
 
+  _LayerEdge* leOnV[2] = { getLEdgeOnV(0), getLEdgeOnV(1) };
+
+  // get cosin to use in findEdgesToSmooth()
+  _edgeDir[0] = getEdgeDir( E, leOnV[0]->_nodes[0], data.GetHelper() );
+  _edgeDir[1] = getEdgeDir( E, leOnV[1]->_nodes[0], data.GetHelper() );
+  _leOnV[0]._cosin = Abs( leOnV[0]->_cosin );
+  _leOnV[1]._cosin = Abs( leOnV[1]->_cosin );
+  if ( _eos._sWOL.IsNull() ) // 3D
+    for ( int iEnd = 0; iEnd < 2; ++iEnd )
+      _leOnV[iEnd]._cosin = Abs( _edgeDir[iEnd].Normalized() * leOnV[iEnd]->_normal );
+
   if ( isAnalytic() )
     return;
 
@@ -5864,8 +6032,6 @@ void _Smoother1D::prepare(_SolidData& data)
     _offPoints[i]._param = GCPnts_AbscissaPoint::Length( c3dAdaptor, u0, u ) / _curveLen;
   }
 
-  _LayerEdge* leOnV[2] = { getLEdgeOnV(0), getLEdgeOnV(1) };
-
   // set _2edges
   _offPoints    [0]._2edges.set( &_leOnV[0], &_leOnV[0], 0.5, 0.5 );
   _offPoints.back()._2edges.set( &_leOnV[1], &_leOnV[1], 0.5, 0.5 );
@@ -5903,9 +6069,6 @@ void _Smoother1D::prepare(_SolidData& data)
 
   int iLBO = _offPoints.size() - 2; // last but one
 
-  _edgeDir[0] = getEdgeDir( E, leOnV[0]->_nodes[0], data.GetHelper() );
-  _edgeDir[1] = getEdgeDir( E, leOnV[1]->_nodes[0], data.GetHelper() );
-
   _leOnV[ 0 ]._normal = getNormalNormal( leOnV[0]->_normal, _edgeDir[0] );
   _leOnV[ 1 ]._normal = getNormalNormal( leOnV[1]->_normal, _edgeDir[1] );
   _leOnV[ 0 ]._len = 0;
@@ -6490,6 +6653,80 @@ void _ViscousBuilder::findCollisionEdges( _SolidData& data, SMESH_MesherHelper&
   }
 }
 
+//================================================================================
+/*!
+ * \brief Find _LayerEdge's located on boundary of a convex FACE whose normal
+ *        will be updated at each inflation step
+ */
+//================================================================================
+
+void _ViscousBuilder::findEdgesToUpdateNormalNearConvexFace( _ConvexFace &       convFace,
+                                                             _SolidData&         data,
+                                                             SMESH_MesherHelper& helper )
+{
+  const TGeomID convFaceID = getMeshDS()->ShapeToIndex( convFace._face );
+  const double       preci = BRep_Tool::Tolerance( convFace._face );
+  Handle(ShapeAnalysis_Surface) surface = helper.GetSurface( convFace._face );
+
+  bool edgesToUpdateFound = false;
+
+  map< TGeomID, _EdgesOnShape* >::iterator id2eos = convFace._subIdToEOS.begin();
+  for ( ; id2eos != convFace._subIdToEOS.end(); ++id2eos )
+  {
+    _EdgesOnShape& eos = * id2eos->second;
+    if ( !eos._sWOL.IsNull() ) continue;
+    if ( !eos._hyp.ToSmooth() ) continue;
+    for ( size_t i = 0; i < eos._edges.size(); ++i )
+    {
+      _LayerEdge* ledge = eos._edges[ i ];
+      if ( ledge->Is( _LayerEdge::UPD_NORMAL_CONV )) continue; // already checked
+      if ( ledge->Is( _LayerEdge::MULTI_NORMAL )) continue; // not inflatable
+
+      gp_XYZ tgtPos = ( SMESH_NodeXYZ( ledge->_nodes[0] ) +
+                        ledge->_normal * ledge->_lenFactor * ledge->_maxLen );
+
+      // the normal must be updated if distance from tgtPos to surface is less than
+      // target thickness
+
+      // find an initial UV for search of a projection of tgtPos to surface
+      const SMDS_MeshNode* nodeInFace = 0;
+      SMDS_ElemIteratorPtr fIt = ledge->_nodes[0]->GetInverseElementIterator(SMDSAbs_Face);
+      while ( fIt->more() && !nodeInFace )
+      {
+        const SMDS_MeshElement* f = fIt->next();
+        if ( convFaceID != f->getshapeId() ) continue;
+
+        SMDS_ElemIteratorPtr nIt = f->nodesIterator();
+        while ( nIt->more() && !nodeInFace )
+        {
+          const SMDS_MeshElement* n = nIt->next();
+          if ( n->getshapeId() == convFaceID )
+            nodeInFace = static_cast< const SMDS_MeshNode* >( n );
+        }
+      }
+      if ( !nodeInFace )
+        continue;
+      gp_XY uv = helper.GetNodeUV( convFace._face, nodeInFace );
+
+      // projection
+      surface->NextValueOfUV( uv, tgtPos, preci );
+      double  dist = surface->Gap();
+      if ( dist < 0.95 * ledge->_maxLen )
+      {
+        ledge->Set( _LayerEdge::UPD_NORMAL_CONV );
+        if ( !ledge->_curvature ) ledge->_curvature = new _Curvature;
+        ledge->_curvature->_uv.SetCoord( uv.X(), uv.Y() );
+        edgesToUpdateFound = true;
+      }
+    }
+  }
+
+  if ( !convFace._isTooCurved && edgesToUpdateFound )
+  {
+    data._convexFaces.insert( make_pair( convFaceID, convFace )).first->second;
+  }
+}
+
 //================================================================================
 /*!
  * \brief Modify normals of _LayerEdge's on EDGE's to avoid intersection with
@@ -6942,6 +7179,8 @@ bool _ViscousBuilder::updateNormalsOfConvexFaces( _SolidData&         data,
   for ( ; id2face != data._convexFaces.end(); ++id2face )
   {
     _ConvexFace & convFace = (*id2face).second;
+    convFace._normalsFixedOnBorders = false; // to update at each inflation step
+
     if ( convFace._normalsFixed )
       continue; // already fixed
     if ( convFace.CheckPrisms() )
@@ -7304,6 +7543,59 @@ bool _ViscousBuilder::updateNormalsOfConvexFaces( _SolidData&         data,
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief Return max curvature of a FACE
+ */
+//================================================================================
+
+double _ConvexFace::GetMaxCurvature( _SolidData&         data,
+                                     _EdgesOnShape&      eof,
+                                     BRepLProp_SLProps&  surfProp,
+                                     SMESH_MesherHelper& helper)
+{
+  double maxCurvature = 0;
+
+  TopoDS_Face F = TopoDS::Face( eof._shape );
+
+  const int           nbTestPnt = 5;
+  const double        oriFactor = ( F.Orientation() == TopAbs_REVERSED ? +1. : -1. );
+  SMESH_subMeshIteratorPtr smIt = eof._subMesh->getDependsOnIterator(/*includeSelf=*/true);
+  while ( smIt->more() )
+  {
+    SMESH_subMesh* sm = smIt->next();
+    const TGeomID subID = sm->GetId();
+
+    // find _LayerEdge's of a sub-shape
+    _EdgesOnShape* eos;
+    if (( eos = data.GetShapeEdges( subID )))
+      this->_subIdToEOS.insert( make_pair( subID, eos ));
+    else
+      continue;
+
+    // check concavity and curvature and limit data._stepSize
+    const double minCurvature =
+      1. / ( eos->_hyp.GetTotalThickness() * ( 1 + theThickToIntersection ));
+    size_t iStep = Max( 1, eos->_edges.size() / nbTestPnt );
+    for ( size_t i = 0; i < eos->_edges.size(); i += iStep )
+    {
+      gp_XY uv = helper.GetNodeUV( F, eos->_edges[ i ]->_nodes[0] );
+      surfProp.SetParameters( uv.X(), uv.Y() );
+      if ( surfProp.IsCurvatureDefined() )
+      {
+        double curvature = Max( surfProp.MaxCurvature() * oriFactor,
+                                surfProp.MinCurvature() * oriFactor );
+        maxCurvature = Max( maxCurvature, curvature );
+
+        if ( curvature > minCurvature )
+          this->_isTooCurved = true;
+      }
+    }
+  } // loop on sub-shapes of the FACE
+
+  return maxCurvature;
+}
+
 //================================================================================
 /*!
  * \brief Finds a center of curvature of a surface at a _LayerEdge
@@ -7586,13 +7878,14 @@ gp_Ax1 _LayerEdge::LastSegment(double& segLen, _EdgesOnShape& eos) const
 
 //================================================================================
 /*!
- * \brief Return the last position of the target node on a FACE. 
+ * \brief Return the last (or \a which) position of the target node on a FACE. 
  *  \param [in] F - the FACE this _LayerEdge is inflated along
+ *  \param [in] which - index of position
  *  \return gp_XY - result UV
  */
 //================================================================================
 
-gp_XY _LayerEdge::LastUV( const TopoDS_Face& F, _EdgesOnShape& eos ) const
+gp_XY _LayerEdge::LastUV( const TopoDS_Face& F, _EdgesOnShape& eos, int which ) const
 {
   if ( F.IsSame( eos._sWOL )) // F is my FACE
     return gp_XY( _pos.back().X(), _pos.back().Y() );
@@ -7601,7 +7894,7 @@ gp_XY _LayerEdge::LastUV( const TopoDS_Face& F, _EdgesOnShape& eos ) const
     return gp_XY( 1e100, 1e100 );
 
   // _sWOL is EDGE of F; _pos.back().X() is the last U on the EDGE
-  double f, l, u = _pos.back().X();
+  double f, l, u = _pos[ which < 0 ? _pos.size()-1 : which ].X();
   Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface( TopoDS::Edge(eos._sWOL), F, f,l);
   if ( !C2d.IsNull() && f <= u && u <= l )
     return C2d->Value( u ).XY();
@@ -7679,7 +7972,7 @@ bool _LayerEdge::SegTriaInter( const gp_Ax1& lastSegment,
  *  \param [in] eov - EOS of the VERTEX
  *  \param [in] eos - EOS of the FACE
  *  \param [in] step - inflation step
- *  \param [in,out] badSmooEdges - not untangled _LayerEdge's
+ *  \param [in,out] badSmooEdges - tangled _LayerEdge's
  */
 //================================================================================
 
@@ -9031,6 +9324,11 @@ void _LayerEdge::Block( _SolidData& data )
   //if ( Is( BLOCKED )) return;
   Set( BLOCKED );
 
+  SMESH_Comment msg( "#BLOCK shape=");
+  msg << data.GetShapeEdges( this )->_shapeID
+      << ", nodes " << _nodes[0]->GetID() << ", " << _nodes.back()->GetID();
+  dumpCmd( msg + " -- BEGIN")
+
   _maxLen = _len;
   std::queue<_LayerEdge*> queue;
   queue.push( this );
@@ -9056,6 +9354,8 @@ void _LayerEdge::Block( _SolidData& data )
       //if ( edge->_nodes[0]->getshapeId() == neibor->_nodes[0]->getshapeId() ) viscous_layers_00/A3
       {
         newMaxLen *= edge->_lenFactor / neibor->_lenFactor;
+        // newMaxLen *= Min( edge->_lenFactor / neibor->_lenFactor,
+        //                   neibor->_lenFactor / edge->_lenFactor );
       }
       if ( neibor->_maxLen > newMaxLen )
       {
@@ -9073,6 +9373,7 @@ void _LayerEdge::Block( _SolidData& data )
       }
     }
   }
+  dumpCmd( msg + " -- END")
 }
 
 //================================================================================
@@ -9227,6 +9528,7 @@ std::string _LayerEdge::DumpFlags() const
       case BLOCKED:         dump << "BLOCKED";         break;
       case INTERSECTED:     dump << "INTERSECTED";     break;
       case NORMAL_UPDATED:  dump << "NORMAL_UPDATED";  break;
+      case UPD_NORMAL_CONV: dump << "UPD_NORMAL_CONV"; break;
       case MARKED:          dump << "MARKED";          break;
       case MULTI_NORMAL:    dump << "MULTI_NORMAL";    break;
       case NEAR_BOUNDARY:   dump << "NEAR_BOUNDARY";   break;
@@ -9262,7 +9564,7 @@ bool _ViscousBuilder::refine(_SolidData& data)
   double f,l, u = 0;
   gp_XY uv;
   vector< gp_XYZ > pos3D;
-  bool isOnEdge;
+  bool isOnEdge, isTooConvexFace = false;
   TGeomID prevBaseId = -1;
   TNode2Edge* n2eMap = 0;
   TNode2Edge::iterator n2e;
@@ -9306,6 +9608,9 @@ bool _ViscousBuilder::refine(_SolidData& data)
         for ( size_t j = 0; j < eos._eosC1[i]->_edges.size(); ++j )
           eos._eosC1[i]->_edges[j]->Set( _LayerEdge::SMOOTHED_C1 );
       }
+      isTooConvexFace = false;
+      if ( _ConvexFace* cf = data.GetConvexFace( eos._shapeID ))
+        isTooConvexFace = cf->_isTooCurved;
     }
 
     vector< double > segLen;
@@ -9321,8 +9626,8 @@ bool _ViscousBuilder::refine(_SolidData& data)
       if ( eos._sWOL.IsNull() )
       {
         bool useNormal = true;
-        bool   usePos  = false;
-        bool smoothed  = false;
+        bool    usePos = false;
+        bool  smoothed = false;
         double   preci = 0.1 * edge._len;
         if ( eos._toSmooth && edge._pos.size() > 2 )
         {
@@ -9330,8 +9635,7 @@ bool _ViscousBuilder::refine(_SolidData& data)
         }
         if ( smoothed )
         {
-          if ( !surface.IsNull() &&
-               !data._convexFaces.count( eos._shapeID )) // edge smoothed on FACE
+          if ( !surface.IsNull() && !isTooConvexFace ) // edge smoothed on FACE
           {
             useNormal = usePos = false;
             gp_Pnt2d uv = helper.GetNodeUV( geomFace, edge._nodes[0] );
index ce01ea208cfc06def8a81eba4e0405aeeda693fa..0eeb07e0b8397295f421e1514bb26ce8ec75ed2f 100644 (file)
@@ -38,7 +38,7 @@
 class STDMESHERS_EXPORT StdMeshers_ViscousLayers : public SMESH_Hypothesis
 {
 public:
-  StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_ViscousLayers(int hypId, SMESH_Gen* gen);
 
   // Set boundary shapes (faces in 3D, edges in 2D) either to exclude from
   // treatment or to make the Viscous Layers on
index ecd62abc20462cf179b9dd8fb116eb631d0b7dad..6586e120fb3ddb09e208c94e5febbdfeec9c349a 100644 (file)
@@ -501,8 +501,8 @@ namespace VISCOUS_2D
 //================================================================================
 // StdMeshers_ViscousLayers hypothesis
 //
-StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D(int hypId, int studyId, SMESH_Gen* gen)
-  :StdMeshers_ViscousLayers(hypId, studyId, gen)
+StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D(int hypId, SMESH_Gen* gen)
+  :StdMeshers_ViscousLayers(hypId, gen)
 {
   _name = StdMeshers_ViscousLayers2D::GetHypType();
   _param_algo_dim = -2; // auxiliary hyp used by 2D algos
@@ -600,7 +600,7 @@ StdMeshers_ViscousLayers2D::CheckHypothesis(SMESH_Mesh&
 // --------------------------------------------------------------------------------
 void StdMeshers_ViscousLayers2D::RestoreListeners() const
 {
-  StudyContextStruct* sc = _gen->GetStudyContext( _studyId );
+  StudyContextStruct* sc = _gen->GetStudyContext();
   std::map < int, SMESH_Mesh * >::iterator i_smesh = sc->mapMesh.begin();
   for ( ; i_smesh != sc->mapMesh.end(); ++i_smesh )
   {
index cff610b17aaa11d6b2f054ea2cbe2b345fa61766..554cee395e67a99efca3fd547c3dce76361c7019 100644 (file)
@@ -35,7 +35,7 @@ class StdMeshers_FaceSide;
 class STDMESHERS_EXPORT StdMeshers_ViscousLayers2D : public StdMeshers_ViscousLayers
 {
 public:
-  StdMeshers_ViscousLayers2D(int hypId, int studyId, SMESH_Gen* gen);
+  StdMeshers_ViscousLayers2D(int hypId, SMESH_Gen* gen);
   /*!
    * \brief Computes temporary 2D mesh to be used by 2D algorithm.
    *        Return SMESH_ProxyMesh for the given FACE, or NULL in case of error
index 1b390d361f1d5083aaa92e7b755d231b327f5e5b..74f46994099a8ac3218d37f78b573dc25040009e 100644 (file)
@@ -63,6 +63,7 @@ SET(_link_LIBRARIES
   ${QWT_LIBRARY}
   SalomeIDLSMESH
   SMESHFiltersSelection
+  SMESHEngine
   SMESH
   SMESHObject
 )
index 6f243e037dfe83d59999940a95b13acc50ec8df2..9f1de0c28e375fdb4a5b8b21152e210d73ad75a9 100644 (file)
@@ -152,7 +152,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a )
   SMESH::SMESH_Gen_var gen = mySMESHGUI->GetSMESHGen();
 
   // avoid publishing a new 1D hyp
-  gen->SetCurrentStudy( SALOMEDS::Study::_nil() );
+  gen->SetEnablePublish( false );
 
   // create a hyp
   HypothesisData* aHypData = 0;
@@ -174,7 +174,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a )
   }
 
   // restore current study
-  mySMESHGUI->GetSMESHGen();
+  gen->SetEnablePublish( true );
 
   onEdit();
 }
index 823331951bb1cdcec54112137d1ebdd1c48d4fbd..5b6b5451246f76bd2a9b1d8f857db7cf4caf157d 100644 (file)
@@ -227,9 +227,9 @@ void StdMeshersGUI_ObjectReferenceParamWdg::SetObjects(SMESH::string_array_var&
   
   for ( unsigned i = 0; i < objects->length(); ++i )
   {
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
     _PTR(SObject) aSObj = aStudy->FindObjectID(objects[i].in());
-    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
+    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
     if ( !CORBA::is_nil( anObj )) {
       std::string name = aSObj->GetName();
       QString text = myObjNameLineEdit->text();
index a7841c1e5c7203e01d5378874a795cec72d69640..8c49daa2a72e0c917b05f6a4a3af2ed8866a92b1 100644 (file)
@@ -423,10 +423,10 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
       GEOM::GEOM_Object_var face = w->GetObject< GEOM::GEOM_Object >();
 
       GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-      _PTR(Study)         aStudy = SMESH::GetActiveStudyDocument();
+      _PTR(Study)         aStudy = SMESH::getStudy();
       GEOM::GEOM_IShapesOperations_wrap shapeOp;
       if ( !geomGen->_is_nil() && aStudy )
-        shapeOp = geomGen->GetIShapesOperations( aStudy->StudyId() );
+        shapeOp = geomGen->GetIShapesOperations();
       if ( !shapeOp->_is_nil() )
       {
         GEOM::ListOfLong_var vertices =
index 0518ee07ced03b644f3a84aa120d19bba24d92bc..a3a54de51ca3f9f3547652475d91fc2725c69520 100644 (file)
@@ -578,16 +578,12 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState()
 GEOM::GEOM_Object_var StdMeshersGUI_SubShapeSelectorWdg::GetGeomObjectByEntry( const QString& theEntry )
 {
   GEOM::GEOM_Object_var aGeomObj;
-  SALOMEDS::Study_var aStudy = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
-  if ( !aStudy->_is_nil() )
+  SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.toLatin1().data() );
+  if (!aSObj->_is_nil() )
   {
-    SALOMEDS::SObject_var aSObj = aStudy->FindObjectID( theEntry.toLatin1().data() );
-    if (!aSObj->_is_nil() )
-    {
-      CORBA::Object_var obj = aSObj->GetObject();
-      aGeomObj = GEOM::GEOM_Object::_narrow(obj);
-      aSObj->UnRegister();
-    }
+    CORBA::Object_var obj = aSObj->GetObject();
+    aGeomObj = GEOM::GEOM_Object::_narrow(obj);
+    aSObj->UnRegister();
   }
   return aGeomObj._retn();
 }
index d0439c955f07ca29aaa536f396150e689ed82c28..de799712d3d478c42c018ff1e7301675b9bbbf22 100644 (file)
 //=======================================================================
 
 StdMeshers_Adaptive1D_i::StdMeshers_Adaptive1D_i( PortableServer::POA_ptr thePOA,
-                                                  int                     theStudyId,
                                                   ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Adaptive1D( theGenImpl->GetANewId(),
-                                            theStudyId,
                                             theGenImpl );
 }
 
index 7aa2c1879f5d19dde43a28423ba6944330341a85..060b8b42af428096df35cce90ebc5c258153566f 100644 (file)
@@ -46,7 +46,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Adaptive1D_i:
  public:
   // Constructor
   StdMeshers_Adaptive1D_i( PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
                            ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_Adaptive1D_i();
index 824530ec2b2db20ede5d099baee0371fe5bae779..f5a60814429c615766a6e854e47105919834d5de 100644 (file)
@@ -46,14 +46,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
-                                                    ::SMESH_Gen*            theGenImpl )
+                                                      ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
-                                             theStudyId,
-                                             theGenImpl );
+                                              theGenImpl );
 }
 
 //=============================================================================
index 6dece73a47107afb933eed017ccdd8bdc5a71abd..622354e99ca1c846ad5d88f874d13c87d3a85938 100644 (file)
@@ -46,7 +46,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Arithmetic1D_i:
 public:
   // Constructor
   StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
                              ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_Arithmetic1D_i();
index d532e39351b70d0d476c027e3facebdcc83c221d..9121614d6de672ff832a36d89a4c061860e65382 100644 (file)
@@ -47,13 +47,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_AutomaticLength_i::StdMeshers_AutomaticLength_i( PortableServer::POA_ptr thePOA,
-                                                            int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_AutomaticLength( theGenImpl->GetANewId(),
-                                                 theStudyId,
                                                  theGenImpl );
 }
 
index d883d1b0b269e39764c7008b4d992dcd28abe54b..63847bd6d787a39128f10f84a20f6f508b2ea5fe 100644 (file)
@@ -50,7 +50,6 @@ class STDMESHERS_I_EXPORT StdMeshers_AutomaticLength_i:
 public:
   // Constructor
   StdMeshers_AutomaticLength_i( PortableServer::POA_ptr thePOA,
-                                int                     theStudyId,
                                 ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_AutomaticLength_i();
index 90d4ea4928062f0d2af688fa1410da4b8ff0d739..18c7426e8a3ac44c5b1fc7e8d8c6b59c51626fae 100644 (file)
@@ -59,13 +59,11 @@ namespace
 
 StdMeshers_CartesianParameters3D_i::
 StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
-                                    int                     theStudyId,
                                     ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_CartesianParameters3D( theGenImpl->GetANewId(),
-                                                       theStudyId,
                                                        theGenImpl );
 }
 
index fb1fc91b3839f5b4a947196bb67be0f59e75c158..d9f4d603ab046f60107623980b64f47dd031ac42 100644 (file)
@@ -46,7 +46,6 @@ class STDMESHERS_I_EXPORT StdMeshers_CartesianParameters3D_i:
  public:
   // Constructor
   StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
-                                      int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_CartesianParameters3D_i();
index 2eeaff8d14adb02798aa8b4f725b886b0e47f97a..b45cb6c0e76424b444c843bdbf34e4024cbe297d 100644 (file)
@@ -38,7 +38,6 @@
 //=============================================================================
 
 StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr thePOA,
-                                                      int                     theStudyId,
                                                       ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA ), 
@@ -46,7 +45,6 @@ StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr th
     SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Cartesian_3D( theGenImpl->GetANewId(),
-                                              theStudyId,
                                               theGenImpl );
 }
 
index 1eca0a00ee06c5ef91c305f9457d782340991d8b..6376d36d5986e6cba12abe668d7dcd834512aa69 100644 (file)
@@ -45,7 +45,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Cartesian_3D_i:
 public:
   // Constructor
   StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr thePOA,
-                             int                     theStudyId,
                              ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index 01a579b56c5dd5108eb6f82e7c20fbd269e51d61..482a9f16a866dc14b728c225ea53f672c593c92d 100644 (file)
@@ -43,7 +43,6 @@ using namespace std;
 
 StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i
                                                 ( PortableServer::POA_ptr thePOA,
-                                                  int                     theStudyId,
                                                   ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -51,7 +50,6 @@ StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i
        SMESH_1D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_CompositeSegment_1D( theGenImpl->GetANewId(),
-                                                     theStudyId,
                                                      theGenImpl );
 }
 
index b7811f6291e795f0651324e8bb59a693562d42fa..b8f9948639d0b78bd86d56d3329254653925eccf 100644 (file)
@@ -44,7 +44,6 @@ class StdMeshers_CompositeSegment_1D_i:
 public:
   // Constructor
   StdMeshers_CompositeSegment_1D_i( PortableServer::POA_ptr thePOA,
-                                    int                     theStudyId,
                                     ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_CompositeSegment_1D_i();
index add0ede6dd369d9e5f1d8fee54ab2a52368f36ba..a89708793b752c177b9ce25832c4ff16c3b89d50 100644 (file)
@@ -47,14 +47,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
-                                          int                     theStudyId,
-                                          ::SMESH_Gen*            theGenImpl )
+                                                      ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Deflection1D( theGenImpl->GetANewId(),
-                                        theStudyId,
-                                        theGenImpl );
+                                              theGenImpl );
 }
 
 //=============================================================================
index 722da9b4231e6e9799cd26cdf1c6d48c8ebca64d..dfac16e1de009974801bfa35a8a0bde52a94cc89 100644 (file)
@@ -49,8 +49,7 @@ class STDMESHERS_I_EXPORT StdMeshers_Deflection1D_i:
 public:
   // Constructor
   StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
-                       int                     theStudyId,
-                       ::SMESH_Gen*            theGenImpl );
+                             ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_Deflection1D_i();
 
index fbaa715c6aabe4e899d7c840f3bef6478480ed14..e6323cd314bc9ef29e736a2fe590085d6e438922 100644 (file)
@@ -44,13 +44,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_FixedPoints1D(theGenImpl->GetANewId(),
-                                              theStudyId,
                                               theGenImpl);
 }
 
index 37522382183b177195efaf8e40ac8e52c7d27df1..7261ff7a76d1bd3b8df68e219c83927658aaf180 100644 (file)
@@ -43,7 +43,6 @@ class STDMESHERS_I_EXPORT StdMeshers_FixedPoints1D_i:
 public:
   // Constructor
   StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_FixedPoints1D_i();
index cd4d6ec0d37a242f204cd97424972bfbe0274bd3..1530dc26c304afd03f7c10e75f806df2c61c5adb 100644 (file)
 //=============================================================================
 
 StdMeshers_Geometric1D_i::StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA ),
     StdMeshers_Reversible1D_i( this )
 {
   myBaseImpl = new ::StdMeshers_Geometric1D( theGenImpl->GetANewId(),
-                                             theStudyId,
                                              theGenImpl );
 }
 
index 38f0b6d8d26db1331db4827657aaf3f93ee03f55..f3a8964be4c912b28d8582b8da1913f11bbc65fe 100644 (file)
@@ -47,7 +47,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Geometric1D_i:
  public:
   // Constructor
   StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
                             ::SMESH_Gen*            theGenImpl );
 
   void SetStartLength(CORBA::Double length) throw(SALOME::SALOME_Exception);
index 88e418edf738164c99184c134d9c2fff833192b6..6a47515cb8a8818e099c8646f8243c6eeee62d7c 100644 (file)
@@ -43,7 +43,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
-                                            int                     theStudyId,
                                             ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -51,7 +50,6 @@ StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
     SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
-                                         theStudyId,
                                          theGenImpl );
 }
 
index 98ef012dcd6236b6b40a2322763c31e06a60a4cb..37d38c035c5e310b5bb682e5f36fa899d89c92ac 100644 (file)
@@ -49,8 +49,7 @@ class STDMESHERS_I_EXPORT StdMeshers_Hexa_3D_i:
 public:
   // Constructor
   StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
-                   int                     theStudyId,
-                   ::SMESH_Gen*            theGenImpl );
+                        ::SMESH_Gen*            theGenImpl );
 
   // Destructor
   virtual ~StdMeshers_Hexa_3D_i();
index 61ec24bd4affaa6d55f584d40b11ce8905359884..9d6f613ea88bb40f81ffee4d07cb7194b624c0de 100644 (file)
@@ -51,13 +51,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_ImportSource1D_i::StdMeshers_ImportSource1D_i( PortableServer::POA_ptr thePOA,
-                                                          int                     theStudyId,
                                                           ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ImportSource1D( theGenImpl->GetANewId(),
-                                                theStudyId,
                                                 theGenImpl );
   _groupEntries = new SMESH::string_array();
 }
@@ -87,7 +85,6 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou
   {
     std::vector<SMESH_Group*> smesh_groups;
     std::vector<string> entries;
-    SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
     for ( CORBA::ULong i = 0; i < groups.length(); ++i )
       if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i] ))
       {
@@ -95,7 +92,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou
           THROW_SALOME_CORBA_EXCEPTION("Wrong group type", SALOME::BAD_PARAM);
         smesh_groups.push_back( gp_i->GetSmeshGroup() );
 
-        SALOMEDS::SObject_wrap so = SMESH_Gen_i::ObjectToSObject(study, groups[i]);
+        SALOMEDS::SObject_wrap so = SMESH_Gen_i::ObjectToSObject(groups[i]);
         if ( !so->_is_nil())
         {
           CORBA::String_var entry = so->GetID();
@@ -168,14 +165,13 @@ char* StdMeshers_ImportSource1D_i::SaveTo()
   std::ostringstream os;
   os << " " << _groupEntries->length();
 
-  SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
   for ( size_t i = 0; i < _groupEntries->length(); ++i )
   {
     // entry
     os << " " << _groupEntries[i];
 
     // id
-    SALOMEDS::SObject_wrap groupSO = study->FindObjectID( _groupEntries[i] );
+    SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( _groupEntries[i] );
     CORBA::Object_var     groupObj;
     if ( !groupSO->_is_nil() )
       groupObj = groupSO->GetObject();
index 517549d6a17758fe2fc8d4bec64268519182c60e..2f9dca660ff62de495c31bff514ab9e1f1c29090 100644 (file)
@@ -44,7 +44,6 @@ class STDMESHERS_I_EXPORT StdMeshers_ImportSource1D_i:
  public:
   // Constructor
   StdMeshers_ImportSource1D_i( PortableServer::POA_ptr thePOA,
-                               int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ImportSource1D_i();
index dc61b9cdd9ea22b3bd8e94e3abc2e418ef1d6665..1027d802a603c503e68c1c6aa74776d85fedccae 100644 (file)
@@ -50,13 +50,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_ImportSource2D_i::StdMeshers_ImportSource2D_i( PortableServer::POA_ptr thePOA,
-                                                          int                     theStudyId,
                                                           ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ImportSource2D( theGenImpl->GetANewId(),
-                                                theStudyId,
                                                 theGenImpl );
   _groupEntries = new SMESH::string_array();
 }
@@ -86,7 +84,6 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou
   {
     std::vector<SMESH_Group*> smesh_groups;
     std::vector<string> entries;
-    SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
     for ( CORBA::ULong i = 0; i < groups.length(); ++i )
       if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i] ))
       {
@@ -94,7 +91,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou
           THROW_SALOME_CORBA_EXCEPTION("Wrong group type", SALOME::BAD_PARAM);
         smesh_groups.push_back( gp_i->GetSmeshGroup() );
 
-        SALOMEDS::SObject_var so = SMESH_Gen_i::ObjectToSObject(study, groups[i]);
+        SALOMEDS::SObject_var so = SMESH_Gen_i::ObjectToSObject(groups[i]);
         if ( !so->_is_nil())
         {
           CORBA::String_var entry = so->GetID();
@@ -168,14 +165,13 @@ char* StdMeshers_ImportSource2D_i::SaveTo()
   std::ostringstream os;
   os << " " << _groupEntries->length();
 
-  SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
   for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i )
   {
     // entry
     os << " " << _groupEntries[i];
 
     // id
-    SALOMEDS::SObject_var groupSO = study->FindObjectID( _groupEntries[i] );
+    SALOMEDS::SObject_var groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( _groupEntries[i] );
     CORBA::Object_var    groupObj;
     if ( !groupSO->_is_nil() ) {
       groupObj = groupSO->GetObject();
index bfa0e81b36f7d57b55cc7031cf4a118a35845c0e..685dd4febc8070d042ea232289d5bbfbbcbd1292 100644 (file)
@@ -44,7 +44,6 @@ class STDMESHERS_I_EXPORT StdMeshers_ImportSource2D_i:
  public:
   // Constructor
   StdMeshers_ImportSource2D_i( PortableServer::POA_ptr thePOA,
-                               int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ImportSource2D_i();
index 061257e9f7955238115829df870558551056b5f6..8a84e648b877a6399e25b14bf70c9e3779b12c8b 100644 (file)
@@ -37,7 +37,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i (PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA ), 
@@ -45,7 +44,6 @@ StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i (PortableServer::POA_ptr theP
     SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Import_1D2D(theGenImpl->GetANewId(),
-                                            theStudyId,
                                             theGenImpl );
 }
 
index 5e94f1a9a884b51942d546177ecdd9864241bc42..fa4f3fa0122c79d388b006f7c09b92066d843e0b 100644 (file)
@@ -39,7 +39,6 @@ class StdMeshers_Import_1D2D_i:
 public:
   // Constructor
   StdMeshers_Import_1D2D_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
                             ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index dfbda1eb99785bee3687587cafd068d9f3245db6..2b3d23412e1db3e275533310d785fd34be6efe55 100644 (file)
@@ -43,7 +43,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Import_1D_i::StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
-                                                int                     theStudyId,
                                                 ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA ), 
@@ -51,7 +50,6 @@ StdMeshers_Import_1D_i::StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
     SMESH_1D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Import_1D( theGenImpl->GetANewId(),
-                                           theStudyId,
                                            theGenImpl );
 }
 
index fb7641256f5654d951deff8ca4f44d9997dfbb72..9b9fce8830f43e8b922f4187fc211eee2df6346d 100644 (file)
@@ -42,7 +42,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Import_1D_i:
  public:
   // Constructor
   StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
-                          int                     theStudyId,
                           ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_Import_1D_i();
index 013db3995da4ea1dc654502303af07c2218d20dc..9b81cd28656cfacfa45f9ac3df2a881d9ee1eaac 100644 (file)
 
 StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
                                           (PortableServer::POA_ptr thePOA,
-                                           int                     theStudyId,
                                            ::SMESH_Gen*            theGenImpl )
 :SMESH_Hypothesis_i( thePOA ),
- StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl)
+ StdMeshers_LayerDistribution_i(thePOA, theGenImpl)
 {
   myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
-                                                    theStudyId,
                                                     theGenImpl);
 }
 
index e95c43317f41d469ba996d7ee985bfd4a4e7ddc6..a5290de0a38b568c747de7e0061afaeff14fe021 100644 (file)
@@ -44,7 +44,6 @@ class StdMeshers_LayerDistribution2D_i:
 public:
   // Constructor
   StdMeshers_LayerDistribution2D_i(PortableServer::POA_ptr thePOA,
-                                   int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_LayerDistribution2D_i();
index d8bb021801de5bdee13585d8c2b7e53b3632aec9..abe9066df65adf24ddf918f3281f4a241906babe 100644 (file)
@@ -45,13 +45,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
-                                                                int                     theStudyId,
                                                                 ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(),
-                                                   theStudyId,
                                                    theGenImpl );
 }
 
@@ -90,11 +88,10 @@ void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesi
     // Remove SO of 1D hypothesis if it was published
     if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
     {
-      SALOMEDS::Study_var study = gen->GetCurrentStudy();
-      SALOMEDS::SObject_var  SO = gen->ObjectToSObject( study, hyp1D );
+      SALOMEDS::SObject_var  SO = gen->ObjectToSObject( hyp1D );
       if ( ! SO->_is_nil() )
       {
-        SALOMEDS::StudyBuilder_var builder = study->NewBuilder();
+        SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
         builder->RemoveObjectWithChildren( SO );
         SO->UnRegister();
       }
@@ -198,8 +195,7 @@ void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
        is >> libName )
   {
     SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
-    SALOMEDS::Study_var curStudy = gen->GetCurrentStudy();
-    gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); // prevent hypo publishing
+    gen->SetEnablePublish( false ); // prevent hypo publishing
 
     try {
       SMESH::SMESH_Hypothesis_var hyp1D =
@@ -221,7 +217,7 @@ void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
     }
     catch (...) {
     }
-    gen->SetCurrentStudy( curStudy );  // enable hypo publishing
+    gen->SetEnablePublish( true );  // enable hypo publishing
   }
 }
 
index 98947b7cffbfb521f15a2f20ca340dbd6fe493cd..69050ee700967ac7d3e527c6f2a1d8e5654e5ce1 100644 (file)
@@ -50,7 +50,6 @@ class StdMeshers_LayerDistribution_i:
 public:
   // Constructor
   StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
-                                  int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_LayerDistribution_i();
index 7404b9e133fa6d528ef0e02b202969ae4353e820..94b3417012a19811e3a02e95c7b53621c09765eb 100644 (file)
@@ -44,14 +44,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
-                                                  int                     theStudyId,
-                                                  ::SMESH_Gen*            theGenImpl )
+                                                            ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_LengthFromEdges( theGenImpl->GetANewId(),
-                                            theStudyId,
-                                            theGenImpl );
+                                                 theGenImpl );
 }
 
 //=============================================================================
index 5c88c7dfff3a92fca03046f6d0efeb6586024f84..98495ea098e7d7412c19da35fc46a99ecc5a5b8a 100644 (file)
@@ -48,8 +48,7 @@ class STDMESHERS_I_EXPORT StdMeshers_LengthFromEdges_i:
 public:
   // Constructor
   StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
-                           ::SMESH_Gen*            theGenImpl );
+                                ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_LengthFromEdges_i();
 
index af0e63a4895e3368db1063fd2c4a505e7c354430..06270a79336167b694d8803edd3e2dd3a6844a37 100644 (file)
@@ -47,13 +47,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_LocalLength_i::StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ),
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_LocalLength( theGenImpl->GetANewId(),
-                                             theStudyId,
                                              theGenImpl );
 }
 
index e3b30927e309e1bbe658ebdbc13a48f0347f3454..25504ef9fb437af2614da6a4839e0057b10edb31 100644 (file)
@@ -49,8 +49,7 @@ class STDMESHERS_I_EXPORT StdMeshers_LocalLength_i:
 public:
   // Constructor
   StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA,
-                       int                     theStudyId,
-                       ::SMESH_Gen*            theGenImpl );
+                            ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_LocalLength_i();
 
index d463a4ebec9f4782cc3e5de8030a6594afc9d51d..dd98b1449503570630a9e3e70d15a2591ce67b86 100644 (file)
@@ -44,16 +44,14 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
-                                        int                     theStudyId,
-                                        ::SMESH_Gen*            theGenImpl )
+                                                  ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
        SMESH_Algo_i( thePOA ),
        SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_MEFISTO_2D( theGenImpl->GetANewId(),
-                                       theStudyId,
-                                       theGenImpl );
+                                            theGenImpl );
 }
 
 //=============================================================================
index 09937306403101b0adf1b811383ded6b78c59ae1..1313e4c8d2bddea2f3915bd876c1decccafe1316 100644 (file)
@@ -50,8 +50,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MEFISTO_2D_i:
 public:
   // Constructor
   StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
-                      int                     theStudyId,
-                      ::SMESH_Gen*            theGenImpl );
+                           ::SMESH_Gen*            theGenImpl );
 
   // Destructor
   virtual ~StdMeshers_MEFISTO_2D_i();
index 017c33bb071eadbdfdccd70501866a92c4e8c12d..c61928156d7b4c91fb17408c57a4e3a8a18337c9 100644 (file)
@@ -47,14 +47,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
-                                                int                     theStudyId,
-                                                ::SMESH_Gen*            theGenImpl )
+                                                          ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ) 
 {
   myBaseImpl = new ::StdMeshers_MaxElementArea( theGenImpl->GetANewId(),
-                                           theStudyId,
-                                           theGenImpl );
+                                                theGenImpl );
 }
 
 //=============================================================================
index 2e46ff056057328f4faf24cf60d7df5d795c9cc6..b20fb3e57840b6732cd2cc484ba1a8e010a1b279 100644 (file)
@@ -47,8 +47,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MaxElementArea_i:
 public:
   // Constructor
   StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
-                          int                     theStudyId,
-                          ::SMESH_Gen*            theGenImpl );
+                               ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_MaxElementArea_i();
 
index c9861c1f6d1482fe3aa75cefa989b379d48e0ce8..17c19a25918675d51c0f804489dc8618f45dc0bb 100644 (file)
@@ -47,14 +47,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
-                                                    ::SMESH_Gen*            theGenImpl )
+                                                              ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_MaxElementVolume( theGenImpl->GetANewId(),
-                                             theStudyId,
-                                             theGenImpl );
+                                                  theGenImpl );
 }
 
 //=============================================================================
index 876d8e2c44d208ede4c155e73334b9461b005e2a..1f917e191b68f232f3c58c1ba4e56dc7365413e8 100644 (file)
@@ -47,8 +47,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MaxElementVolume_i:
 public:
   // Constructor
   StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
-                            ::SMESH_Gen*            theGenImpl );
+                                 ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_MaxElementVolume_i();
 
index f26732a570ed558efdc4858b997e697f9d82f558..2dbd9019a1d0f9eed4070a7ad7de7481e4fd06d2 100644 (file)
@@ -42,13 +42,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_MaxLength_i::StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
-                                                int                     theStudyId,
                                                 ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_MaxLength( theGenImpl->GetANewId(),
-                                           theStudyId,
                                            theGenImpl );
 }
 
index 4f888e1be3b2347001cf2f759bea1b7b20a0d093..21de81ae343a7f2857b8cf958cbb637267c3308e 100644 (file)
@@ -44,8 +44,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MaxLength_i:
 public:
   // Constructor
   StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
-                       int                     theStudyId,
-                       ::SMESH_Gen*            theGenImpl );
+                          ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_MaxLength_i();
 
index ba1f768c270dd8d81db18bb8288eed39601a4736..d8507a9dfd7485d667fdeefef6bab28c13c3b0f4 100644 (file)
@@ -42,13 +42,11 @@ using namespace std;
 
 StdMeshers_NotConformAllowed_i::StdMeshers_NotConformAllowed_i
                                 (PortableServer::POA_ptr thePOA,
-                                 int                     studyId,
                                  ::SMESH_Gen*            genImpl)
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_NotConformAllowed(genImpl->GetANewId(),
-                                                  studyId,
                                                   genImpl);
 }
 
index 2ee4a512dc61c65435b6e02cf7af9b7f8c17aeab..ee4107f10dac60d84816e76e039a7375dc9a31ce 100644 (file)
@@ -44,7 +44,6 @@ class STDMESHERS_I_EXPORT StdMeshers_NotConformAllowed_i:
 {
 public:
   StdMeshers_NotConformAllowed_i(PortableServer::POA_ptr thePOA,
-                                 int studyId,
                                  ::SMESH_Gen* genImpl);
   virtual ~StdMeshers_NotConformAllowed_i();
   
index 263e4d5c38dc7aea33f7d64f51161cb6c1fa8e52..4b7ff8800f4b1d31a0bde5b185859ba83331ac23 100644 (file)
 
 StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
                                            (PortableServer::POA_ptr thePOA,
-                                            int                     theStudyId,
                                             ::SMESH_Gen*            theGenImpl)
  :SMESH_Hypothesis_i( thePOA ),
-  StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl)
+  StdMeshers_NumberOfLayers_i(thePOA, theGenImpl)
 {
   myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
-                                                 theStudyId,
                                                  theGenImpl);
 }
 
index e9c9b22f8101240fef623ccb160fb26dc794875f..128cfca3438585b32c842fa2ac506a5f68dcf08a 100644 (file)
@@ -43,7 +43,6 @@ class StdMeshers_NumberOfLayers2D_i:
 public:
   // Constructor
   StdMeshers_NumberOfLayers2D_i( PortableServer::POA_ptr thePOA,
-                                 int                     theStudyId,
                                  ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_NumberOfLayers2D_i();
index 40905a6725928ec2be1bc2d4c3f24db8854f82fa..bcc1175432290e06f2e6d690cf48046dc492d1bf 100644 (file)
@@ -46,14 +46,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA,
-                                                          int                     theStudyId,
                                                           ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_NumberOfLayers( theGenImpl->GetANewId(),
-                                                 theStudyId,
-                                                 theGenImpl );
+                                                theGenImpl );
 }
 
 //=============================================================================
index b47b10e795ac9c6050d3894ca962b1b3272b577f..6af3b6c14a4be3c28f151541af0c0170221d7c82 100644 (file)
@@ -51,7 +51,6 @@ class StdMeshers_NumberOfLayers_i:
 public:
   // Constructor
   StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA,
-                               int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_NumberOfLayers_i();
index 5a75bf78e45a6b2e7bc3d38b2193532f83a50593..20397181e293bfebbb8a2aaf62587e7971902b22 100644 (file)
@@ -46,14 +46,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
-                                                    ::SMESH_Gen*            theGenImpl )
+                                                              ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(),
-                                             theStudyId,
-                                             theGenImpl );
+                                                  theGenImpl );
 }
 
 //=============================================================================
index 05be9d24d88e0bca5888bb4c8db903ea7c72ec73..1b8f1ea18d4e99c818e30e7bed4e29325045087a 100644 (file)
@@ -48,8 +48,7 @@ class STDMESHERS_I_EXPORT StdMeshers_NumberOfSegments_i:
 public:
   // Constructor
   StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
-                            ::SMESH_Gen*            theGenImpl );
+                                 ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_NumberOfSegments_i();
 
index 89cca0caad9342c425e057005b8cbc4c90e81383..60b0772ab5987c485ebd0c2cecad52da75a0400d 100644 (file)
@@ -59,9 +59,8 @@ StdMeshers_ObjRefUlils::EntryOrShapeToGeomObject (const std::string&  theEntry,
 
   // try by entry
   if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
-    SALOMEDS::Study_var study = gen->GetCurrentStudy();
-    if ( ! theEntry.empty() && ! study->_is_nil() ) {
-      SALOMEDS::SObject_wrap sobj = study->FindObjectID( theEntry.c_str() );
+    if ( ! theEntry.empty() ) {
+      SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.c_str() );
       CORBA::Object_var       obj = gen->SObjectToObject( sobj );
       geom = GEOM::GEOM_Object::_narrow( obj );
     }
@@ -88,7 +87,7 @@ void StdMeshers_ObjRefUlils::SaveToStream( const TopoDS_Shape& theShape, ostream
     if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
       GEOM::GEOM_Object_var geom = gen->ShapeToGeomObject( theShape );
       if ( ! geom->_is_nil() ) {
-        SALOMEDS::SObject_wrap sobj = gen->ObjectToSObject( gen->GetCurrentStudy(), geom );
+        SALOMEDS::SObject_wrap sobj = gen->ObjectToSObject( geom );
         if ( !sobj->_is_nil() ) {
           CORBA::String_var entry = sobj->GetID();
           stream << " " << entry.in();
@@ -117,13 +116,10 @@ TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream &    stream,
     if ( entry )
       * entry = str;
     if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
-      SALOMEDS::Study_var study = gen->GetCurrentStudy();
-      if ( ! study->_is_nil() ) {
-        SALOMEDS::SObject_wrap sobj = study->FindObjectID( str.c_str() );
-        CORBA::Object_var       obj = gen->SObjectToObject( sobj );
-        GEOM::GEOM_Object_var  geom = GEOM::GEOM_Object::_narrow( obj );
-        return gen->GeomObjectToShape( geom.in() );
-      }
+      SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( str.c_str() );
+      CORBA::Object_var       obj = gen->SObjectToObject( sobj );
+      GEOM::GEOM_Object_var  geom = GEOM::GEOM_Object::_narrow( obj );
+      return gen->GeomObjectToShape( geom.in() );
     }
   }
   if ( entry )
index 63d6714aae56ed76c731593b785e432956b4aed8..c095f95b3c5c8bc95be5e0af5ece0152f8c3c58f 100644 (file)
@@ -110,7 +110,7 @@ public:
     if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
       std::string str;
       if (stream >> str) {
-        if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) {
+        if ( StudyContext* myStudyContext = gen->GetStudyContext() ) {
           std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
           if ( !ior.empty() )
              return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
index 4659ab42bc2dc829404052cfb428ccf47aefe43d..54b61812e48a63ec74471ceac5be1fef7f307696 100644 (file)
@@ -36,7 +36,6 @@
 //=============================================================================
 
 StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i( PortableServer::POA_ptr thePOA,
-                                                                int                     theStudyId,
                                                                 ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -44,7 +43,6 @@ StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i( PortableServer::
     SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_PolygonPerFace_2D( theGenImpl->GetANewId(),
-                                                   theStudyId,
                                                    theGenImpl );
 }
 
index a9f0f314b2fce9517a72448ef0bc2cdb145ecd41..c32bcb737c66097065665f9e7994b6552cd7dd22 100644 (file)
@@ -45,7 +45,6 @@ class STDMESHERS_I_EXPORT StdMeshers_PolygonPerFace_2D_i:
  public:
   // Constructor
   StdMeshers_PolygonPerFace_2D_i( PortableServer::POA_ptr thePOA,
-                                  int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_PolygonPerFace_2D_i();
index 8f5999d65a3ad6deaa0f2953445ff2c7ed671b39..7d5bd2712d93564364c6dc2e86db0b678d32ff5b 100644 (file)
@@ -41,7 +41,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
-                                              int                     theStudyId,
                                               ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -49,7 +48,6 @@ StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
     SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Prism_3D( theGenImpl->GetANewId(),
-                                          theStudyId,
                                           theGenImpl );
 }
 //-----------------------------------------------------------------------------
@@ -79,7 +77,6 @@ CORBA::Boolean StdMeshers_Prism_3D_i::IsApplicable( const TopoDS_Shape &S,
 //=============================================================================
 
 StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
-                                                          int                     theStudyId,
                                                           ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -87,7 +84,6 @@ StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_pt
     SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
-                                                theStudyId,
                                                 theGenImpl );
 }
 //-----------------------------------------------------------------------------
index 5cecfcd3be788b4b145f9ed5bb07a204e4f6668d..985b34615ec64ed13b62601d1f3135c832cd672b 100644 (file)
@@ -48,7 +48,6 @@ class StdMeshers_Prism_3D_i:
 public:
   // Constructor
   StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
-                         int                     theStudyId,
                          ::SMESH_Gen*            theGenImpl );
 
   // Destructor
@@ -71,7 +70,6 @@ class StdMeshers_RadialPrism_3D_i:
 public:
   // Constructor
   StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
-                               int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index 6067de55bd7116ce39f241a40dbdfb2cb1742a9d..7b4048662ec682fe71197117b45b25ab1952af9c 100644 (file)
@@ -48,12 +48,10 @@ using namespace std;
 
 StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i
 ( PortableServer::POA_ptr thePOA,
-  int                     theStudyId,
   ::SMESH_Gen*            theGenImpl ) : SALOME::GenericObj_i( thePOA ), 
                                          SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(),
-                                                    theStudyId,
                                                     theGenImpl );
 }
 
index 2a818f201baebf77112db24eafc93f114215ad4d..024ccb63425dbd1ff7b1adf78ca86397d2997b52 100644 (file)
@@ -52,7 +52,6 @@ class StdMeshers_ProjectionSource1D_i:
 public:
   // Constructor
   StdMeshers_ProjectionSource1D_i( PortableServer::POA_ptr thePOA,
-                                   int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ProjectionSource1D_i();
index 369cc29dfee7cdd46bb10df40e91c1501715443c..ff036460353ccfe8ef201c736a13fe56b159ae29 100644 (file)
@@ -48,12 +48,10 @@ using namespace std;
 
 StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i
 ( PortableServer::POA_ptr thePOA,
-  int                     theStudyId,
   ::SMESH_Gen*            theGenImpl ) : SALOME::GenericObj_i( thePOA ), 
                                          SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ProjectionSource2D( theGenImpl->GetANewId(),
-                                                    theStudyId,
                                                     theGenImpl );
 }
 
index eb929dc49a4b64d09ef18d3443dc755ee7ae2a13..add3b78ff8e3a8a9878116e022d0fe50961f4514 100644 (file)
@@ -52,7 +52,6 @@ class StdMeshers_ProjectionSource2D_i:
 public:
   // Constructor
   StdMeshers_ProjectionSource2D_i( PortableServer::POA_ptr thePOA,
-                                   int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ProjectionSource2D_i();
index 195fafc656e29e7d1f4f836369980cce6f16e28d..062602d89f4f2dce0f7a8db94a482b313f0cb0b8 100644 (file)
@@ -48,12 +48,10 @@ using namespace std;
 
 StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i
 ( PortableServer::POA_ptr thePOA,
-  int                     theStudyId,
   ::SMESH_Gen*            theGenImpl ) : SALOME::GenericObj_i( thePOA ), 
                                          SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ProjectionSource3D( theGenImpl->GetANewId(),
-                                                    theStudyId,
                                                     theGenImpl );
 }
 
index 69d658827ce9faba54a0dc8f64fc89db0f8373e3..47458062ea1321fe83beffb55b90762c0bc83bc4 100644 (file)
@@ -53,7 +53,6 @@ class StdMeshers_ProjectionSource3D_i:
 public:
   // Constructor
   StdMeshers_ProjectionSource3D_i( PortableServer::POA_ptr thePOA,
-                                   int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ProjectionSource3D_i();
index 515b7e85b92bbd065b95c57801e353f35ca53b31..d9b135b0bc71d23dc25f3ca001f341de73b8a369 100644 (file)
@@ -40,7 +40,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -48,8 +47,7 @@ StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i( PortableServer::POA_ptr
        SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(),
-                                    theStudyId,
-                                    theGenImpl );
+                                               theGenImpl );
 }
 //-----------------------------------------------------------------------------
 
@@ -82,7 +80,6 @@ CORBA::Boolean StdMeshers_Projection_3D_i::IsApplicable(const TopoDS_Shape &S,
 //=============================================================================
 
 StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -90,8 +87,7 @@ StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i( PortableServer::POA_ptr
        SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(),
-                                    theStudyId,
-                                    theGenImpl );
+                                               theGenImpl );
 }
 //-----------------------------------------------------------------------------
 
@@ -113,7 +109,6 @@ StdMeshers_Projection_2D_i::~StdMeshers_Projection_2D_i()
 //=============================================================================
 
 StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i( PortableServer::POA_ptr thePOA,
-                                                            int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ),
        SMESH_Hypothesis_i( thePOA ),
@@ -121,7 +116,6 @@ StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i( PortableServer::POA_
        SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Projection_1D2D( theGenImpl->GetANewId(),
-                                                 theStudyId,
                                                  theGenImpl );
 }
 //-----------------------------------------------------------------------------
@@ -144,7 +138,6 @@ StdMeshers_Projection_1D2D_i::~StdMeshers_Projection_1D2D_i()
 //=============================================================================
 
 StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -152,8 +145,7 @@ StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i( PortableServer::POA_ptr
        SMESH_1D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(),
-                                    theStudyId,
-                                    theGenImpl );
+                                               theGenImpl );
 }
 //-----------------------------------------------------------------------------
 
index d56f02c512e9d30ca8b9e8da7e91a1ba48f68cad..1aa53b802413e76e899ad71426e1fa316f109514 100644 (file)
@@ -50,7 +50,6 @@ class StdMeshers_Projection_3D_i:
 public:
   // Constructor
   StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
 
   // Destructor
@@ -74,7 +73,6 @@ class StdMeshers_Projection_2D_i:
 public:
   // Constructor
   StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
 
   // Destructor
@@ -95,7 +93,6 @@ class StdMeshers_Projection_1D2D_i:
 public:
   // Constructor
   StdMeshers_Projection_1D2D_i( PortableServer::POA_ptr thePOA,
-                                int                     theStudyId,
                                 ::SMESH_Gen*            theGenImpl );
 
   // Destructor
@@ -116,7 +113,6 @@ class StdMeshers_Projection_1D_i:
 public:
   // Constructor
   StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index 6d086c514902089c61e7206cc5d74b922025c03b..bbdef0825b779b7560c5a8d981e61641b8bf7c81 100644 (file)
@@ -40,13 +40,11 @@ using namespace std;
  */
 //=============================================================================
 StdMeshers_Propagation_i::StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Propagation(theGenImpl->GetANewId(),
-                                            theStudyId,
                                             theGenImpl);
 }
 
@@ -73,13 +71,11 @@ CORBA::Boolean StdMeshers_Propagation_i::IsDimSupported( SMESH::Dimension type )
 //=============================================================================
 StdMeshers_PropagOfDistribution_i::
 StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
-                                   int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_PropagOfDistribution(theGenImpl->GetANewId(),
-                                                     theStudyId,
                                                      theGenImpl);
 }
 
index 00e07de4ca24d47c24c99a37979110d0c547c2ff..e2696dd3a112b0e01a463220790ec3346d46a885 100644 (file)
@@ -48,7 +48,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Propagation_i:
 public:
   // Constructor
   StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
                             ::SMESH_Gen*            theGenImpl);
   
   // Verify whether hypothesis supports given entity type 
@@ -66,7 +65,6 @@ class STDMESHERS_I_EXPORT StdMeshers_PropagOfDistribution_i:
 public:
   // Constructor
   StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
-                                     int                     theStudyId,
                                      ::SMESH_Gen*            theGenImpl);
   
   // Verify whether hypothesis supports given entity type 
index 1681544faff61bd86766d6c4b0e51985b121377c..78b2841e1575a4d7a3f56809f3faaa3fe1a0ad2a 100644 (file)
@@ -45,13 +45,11 @@ using namespace std;
 
 StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
                                           (PortableServer::POA_ptr thePOA,
-                                           int                     theStudyId,
                                            ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
-                                                 theStudyId,
                                                  theGenImpl);
 }
 
index 12c209f409537388be870e10de151b7ecdcd63d5..227dd86af497611380e676cfdaad148e32878931 100644 (file)
@@ -41,7 +41,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadrangleParams_i:
 public:
   // Constructor
   StdMeshers_QuadrangleParams_i (PortableServer::POA_ptr thePOA,
-                                 int                     theStudyId,
                                  ::SMESH_Gen*            theGenImpl);
   // Destructor
   virtual ~StdMeshers_QuadrangleParams_i();
index 9fe0b11cbe69737c7c5b6726b4e0c7cfd44da67b..4752a3524835b11967f2b5b3771aa6d55e8a4def 100644 (file)
@@ -47,12 +47,10 @@ using namespace std;
 
 StdMeshers_QuadranglePreference_i::StdMeshers_QuadranglePreference_i
 ( PortableServer::POA_ptr thePOA,
-  int                     theStudyId,
   ::SMESH_Gen*            theGenImpl ): SALOME::GenericObj_i( thePOA ), 
                                         SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_QuadranglePreference( theGenImpl->GetANewId(),
-                                                      theStudyId,
                                                       theGenImpl );
 }
 
index a60e976bd3675c8acf42a713165286f36c1debd0..bce152a6949104b887dd2b5e15ed14af25b7854c 100644 (file)
@@ -49,7 +49,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadranglePreference_i:
 public:
   // Constructor
   StdMeshers_QuadranglePreference_i( PortableServer::POA_ptr thePOA,
-                                     int                     theStudyId,
                                      ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_QuadranglePreference_i();
index 0aa84775a6be632e7971a0f51b77d2ba92b84536..c800dabffa1e4bedc7b41fe2cc4b1ace83329cb3 100644 (file)
@@ -45,7 +45,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -53,7 +52,6 @@ StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr
     SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Quadrangle_2D( theGenImpl->GetANewId(),
-                                               theStudyId,
                                                theGenImpl );
 }
 
@@ -107,7 +105,6 @@ CORBA::Boolean StdMeshers_Quadrangle_2D_i::IsApplicable( const TopoDS_Shape &S,
 
 StdMeshers_QuadFromMedialAxis_1D2D_i::
 StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
-                                      int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -115,7 +112,6 @@ StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
     SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_QuadFromMedialAxis_1D2D( theGenImpl->GetANewId(),
-                                                         theStudyId,
                                                          theGenImpl );
 }
 
index 4cdc9017e426711b8bc3437e411dd07a6ba347f4..83ff12d30f51f4d25678bb24797e99f1c3740bf7 100644 (file)
@@ -49,7 +49,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Quadrangle_2D_i:
  public:
   // Constructor
   StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
 
   // Destructor
@@ -72,7 +71,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadFromMedialAxis_1D2D_i:
  public:
   // Constructor
   StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
-                                        int                     theStudyId,
                                         ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index 24dd38aa377f75f6c9cc80a570ee319c0ac1991a..5012554125f4fd79ce69087ef9d4fea50de37ece 100644 (file)
@@ -48,12 +48,10 @@ using namespace std;
 
 StdMeshers_QuadraticMesh_i::StdMeshers_QuadraticMesh_i
 ( PortableServer::POA_ptr thePOA,
-  int                     theStudyId,
   ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_QuadraticMesh( theGenImpl->GetANewId(),
-                                               theStudyId,
                                                theGenImpl );
 }
 
index 785934aef3237ece7cc0ea972d2b99dc20f9e036..8788167434933d77a315005751ca54f339db3a9a 100644 (file)
@@ -50,7 +50,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadraticMesh_i:
 public:
   // Constructor
   StdMeshers_QuadraticMesh_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_QuadraticMesh_i();
index 1bb991a8bbb17523543f70c570d5ca68bd8ed0a6..889d86505d526156daac598c71244aff3e35f901 100644 (file)
@@ -38,7 +38,6 @@ using namespace std;
 
 StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
                                            (PortableServer::POA_ptr thePOA,
-                                            int                     theStudyId,
                                             ::SMESH_Gen*            theGenImpl)
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -46,7 +45,6 @@ StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
        SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_RadialQuadrangle_1D2D(theGenImpl->GetANewId(),
-                                                      theStudyId,
                                                       theGenImpl );
 }
 
index 63242f0f6326b55e334a79e047f79186b4476bc3..24944087f8840259de13820e09dc184bc7828ecf 100644 (file)
@@ -39,7 +39,6 @@ class StdMeshers_RadialQuadrangle_1D2D_i:
 public:
   // Constructor
   StdMeshers_RadialQuadrangle_1D2D_i( PortableServer::POA_ptr thePOA,
-                                      int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index 02f83b3c2f881644c4000a07b1803450016b2af6..05dd3c2ed5f63f2e4fd1fa88430ed30058614793 100644 (file)
@@ -43,7 +43,6 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
-                                                  int                     theStudyId,
                                                   ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -51,7 +50,6 @@ StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA
        SMESH_1D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_Regular_1D( theGenImpl->GetANewId(),
-                                            theStudyId,
                                             theGenImpl );
 }
 
index 7b83fa961c58f111cb2d7f7196c2e5a5a2e38b2f..8fd4a83e470de29e1fd31d86379dfb635d390700 100644 (file)
@@ -47,8 +47,7 @@ class STDMESHERS_I_EXPORT StdMeshers_Regular_1D_i:
 public:
   // Constructor
   StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
-                      int                     theStudyId,
-                      ::SMESH_Gen*            theGenImpl );
+                           ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_Regular_1D_i();
  
index 57cbb7071924dfb4aa6149627820d1d837b0f099..9ddfea9c1cc0a36b4cf3ac2d62d294d5f26e720f 100644 (file)
@@ -44,7 +44,6 @@ using namespace std;
 
 StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i
                                                ( PortableServer::POA_ptr thePOA,
-                                                 int                     theStudyId,
                                                  ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -52,7 +51,6 @@ StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i
        SMESH_0D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_SegmentAroundVertex_0D( theGenImpl->GetANewId(),
-                                                        theStudyId,
                                                         theGenImpl );
 }
 //-----------------------------------------------------------------------------
index dea48624a844317f5e32416d6f0f9634178064f5..daba7fde374de23ca2bc2c0f6f8f2de2be20f345 100644 (file)
@@ -43,8 +43,7 @@ class StdMeshers_SegmentAroundVertex_0D_i:
 public:
   // Constructor
   StdMeshers_SegmentAroundVertex_0D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
-                              ::SMESH_Gen*            theGenImpl );
+                                       ::SMESH_Gen*            theGenImpl );
 
   // Destructor
   virtual ~StdMeshers_SegmentAroundVertex_0D_i();
index 5801115bb8c81ddf1e3853d80b2ebce576255658..b8f52e7fe84e925db42bd916fae5a5847e97a1ec 100644 (file)
@@ -45,13 +45,11 @@ using namespace std;
 
 StdMeshers_SegmentLengthAroundVertex_i::StdMeshers_SegmentLengthAroundVertex_i
                                                     ( PortableServer::POA_ptr thePOA,
-                                                      int                     theStudyId,
                                                       ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_SegmentLengthAroundVertex( theGenImpl->GetANewId(),
-                                                           theStudyId,
                                                            theGenImpl );
 }
 
index c61971f020bf4221fa95168077b40f0da27c7347..572ed5c81b4d9e4e72e2546d5456e13ebcca5720 100644 (file)
@@ -46,7 +46,6 @@ class StdMeshers_SegmentLengthAroundVertex_i:
 public:
   // Constructor
   StdMeshers_SegmentLengthAroundVertex_i( PortableServer::POA_ptr thePOA,
-                                          int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_SegmentLengthAroundVertex_i();
index 8d1edd67f317314a1eb74554bc5b9307f7f7ba75..fdceff6a438d0a67705552cdf05e13e40dc2341f 100644 (file)
@@ -47,14 +47,12 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i( PortableServer::POA_ptr thePOA,
-                                                         int                     theStudyId,
-                                                         ::SMESH_Gen*            theGenImpl )
+                                                          ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_StartEndLength( theGenImpl->GetANewId(),
-                                               theStudyId,
-                                               theGenImpl );
+                                                theGenImpl );
 }
 
 //=============================================================================
index 9a9f3a17ba431901ca259cae409d8d86508ee946..50cd8917bd33887c9f1ecf72282ecb67d5770e94 100644 (file)
@@ -49,7 +49,6 @@ class STDMESHERS_I_EXPORT StdMeshers_StartEndLength_i:
 public:
   // Constructor
   StdMeshers_StartEndLength_i(PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_StartEndLength_i();
index ce339913d6a16898b4dc6fdac2f65f6d77cbdb81..57c4cde50cdd9c16a4c38aaa73c620ece9802045 100644 (file)
@@ -38,7 +38,6 @@
 
 StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i
                                                ( PortableServer::POA_ptr thePOA,
-                                                 int                     theStudyId,
                                                  ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -46,7 +45,6 @@ StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i
        SMESH_1D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_UseExisting_1D( theGenImpl->GetANewId(),
-                                                theStudyId,
                                                 theGenImpl );
 }
 //-----------------------------------------------------------------------------
@@ -70,7 +68,6 @@ StdMeshers_UseExisting_1D_i::~StdMeshers_UseExisting_1D_i()
 
 StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i
                                                ( PortableServer::POA_ptr thePOA,
-                                                 int                     theStudyId,
                                                  ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -78,7 +75,6 @@ StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i
        SMESH_2D_Algo_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_UseExisting_2D( theGenImpl->GetANewId(),
-                                                theStudyId,
                                                 theGenImpl );
 }
 //-----------------------------------------------------------------------------
index 69f1d337dbc4763800778c9472d2f84ec43b1779..fe91a33c5747baadb4e5195ccf56663bff1bc876 100644 (file)
@@ -46,7 +46,6 @@ class StdMeshers_UseExisting_1D_i:
 public:
   // Constructor
   StdMeshers_UseExisting_1D_i( PortableServer::POA_ptr thePOA,
-                               int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
 
   // Destructor
@@ -63,7 +62,6 @@ class StdMeshers_UseExisting_2D_i:
 public:
   // Constructor
   StdMeshers_UseExisting_2D_i( PortableServer::POA_ptr thePOA,
-                               int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
 
   // Destructor
index fb0bbbcfd0e1c470af5c4da19ebac8387cb6fd7d..638d03d9522d378dd9a86f077b3b45b7ec09aac5 100644 (file)
@@ -47,13 +47,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_ViscousLayers2D_i::StdMeshers_ViscousLayers2D_i( PortableServer::POA_ptr thePOA,
-                                                            int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ViscousLayers2D( theGenImpl->GetANewId(),
-                                                 theStudyId,
                                                  theGenImpl );
 }
 
index e13d2a905feab851c116317e714ff4c56e23d470..0b28e8597a42b6f57a7fbbe3673a2a08e5467057 100644 (file)
@@ -43,8 +43,7 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers2D_i:
  public:
   // Constructor
   StdMeshers_ViscousLayers2D_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
-                              ::SMESH_Gen*            theGenImpl );
+                                ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ViscousLayers2D_i();
 
index ee39c26da774a0b39ea405dacbd9725e1a9f0a43..fc06bfdb39727df353f0f0b5ff953a629080b5c1 100644 (file)
@@ -48,13 +48,11 @@ using namespace std;
 //=============================================================================
 
 StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::StdMeshers_ViscousLayers( theGenImpl->GetANewId(),
-                                               theStudyId,
                                                theGenImpl );
 }
 
index fe6bef741f341fdda77c6cc919a61ef6f12df9c0..19f5835b0232abdc8d10e1b3000dcef6f6d2db0f 100644 (file)
@@ -43,7 +43,6 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers_i:
  public:
   // Constructor
   StdMeshers_ViscousLayers_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~StdMeshers_ViscousLayers_i();
index b94ca0a0f31a8a05c606ed59ba34d57c50ca70bd..b2f2382201e09a290addb13416f7dd6473750656 100644 (file)
@@ -113,11 +113,10 @@ class QuadrangleParamsCreator : public StdHypothesisCreator_i<StdMeshers_Quadran
 {
 public:
   virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA,
-                                      int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl)
   {
     StdMeshers_QuadrangleParams_i* h =
-      new StdMeshers_QuadrangleParams_i( thePOA, theStudyId, theGenImpl);
+      new StdMeshers_QuadrangleParams_i( thePOA, theGenImpl);
     h->SetQuadType( TYPE );
     return h;
   }
index 2f2e5c1ee4962f4f442aa952e1f00bce26e62a6b..5bcb15973aa114edd49d4ba192061fedf7e54e85 100644 (file)
@@ -157,13 +157,12 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     import SMESH
     from salome.kernel import studyedit
     from salome.smesh import smeshBuilder
-    smesh = smeshBuilder.New(salome.myStudy)
+    smesh = smeshBuilder.New()
     
     if not os.path.isfile(self.fichierOut):
       QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
 
-    maStudy=studyedit.getActiveStudy()
-    smesh.SetCurrentStudy(maStudy)
+    maStudy=salome.myStudy
     (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
     name=str(self.LE_MeshSmesh.text())
     initialMeshFile=None
@@ -205,7 +204,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     newLink=monStudyBuilder.NewObject(SOMesh)
     monStudyBuilder.Addreference(newLink, newStudyIter)
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
     self.num+=1
     return True
 
@@ -263,7 +262,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
     ACmt.SetValue(datai)
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
     self.num += 1
     if verbose: print(("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai)))
     return True
@@ -281,10 +280,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
     
     if verbose: print("save hypothesis in Object Browser")
-    smesh = smeshBuilder.New(salome.myStudy)
+    smesh = smeshBuilder.New()
 
-    maStudy=studyedit.getActiveStudy()
-    smesh.SetCurrentStudy(maStudy)
+    maStudy=salome.myStudy
 
     self.editor = studyedit.getStudyEditor()
     moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
@@ -307,7 +305,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     notebook.set("MGCleaner_%i" % self.num, data)
     """
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
     self.num += 1
     if verbose: print(("save %s in Object Browser done:\n%s" % (name, data)))
     return True
@@ -497,7 +495,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     from salome.smesh.smeshstudytools import SMeshStudyTools
     from salome.gui import helper as guihelper
     from salome.smesh import smeshBuilder
-    smesh = smeshBuilder.New(salome.myStudy)
+    smesh = smeshBuilder.New()
 
     mySObject, myEntry = guihelper.getSObjectSelected()
     if CORBA.is_nil(mySObject) or mySObject==None:
@@ -642,7 +640,7 @@ def TEST_standalone():
   import SMESH
   from salome.kernel import studyedit
   salome.salome_init()
-  maStudy=studyedit.getActiveStudy()
+  maStudy=salome.myStudy
   #etc...a mano...
 
 #
index 89c194f591ab6edab32c5e1afc260aba6965658c..b48777839125a7cb31b0263ec287812a99ff8aed 100644 (file)
@@ -22,9 +22,8 @@
 # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
 
 def MGCleanerLct(context):
-  # get context study, studyId, salomeGui
+  # get context study, salomeGui
   study = context.study
-  studyId = context.studyId
   sg = context.sg
   
   import os
index 146cc8dd4324694ac3a001e4c874bd344559b79a..18885c836bb239d13d8e8547551837ffb6d47f96 100644 (file)
@@ -24,7 +24,7 @@
 import math, Config
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
 
 def Go(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
 
index 9f9136e6f9dd02e6dc4def21040f2f3588e7d480..56d1e083c765a516161625075252992ec41e6b6c 100644 (file)
@@ -27,10 +27,10 @@ import CutnGroup
 import CompositeBox
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New( Config.theStudy )
+smesh = smeshBuilder.New()
 
 ##########################################################################################################
 
index 52dcf728abfff3bb433f6f7294e746ea8144b4dd..172d632d097a79ba7967a92d0c534276863247e1 100644 (file)
@@ -23,10 +23,10 @@ import math
 import Config
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New( Config.theStudy )
+smesh = smeshBuilder.New()
 
 ##########################################################################################################
 
index a233673b8b6ce5e3b500adc6c7eb2c0ef55f01c9..9af5a33778090bf1a235a2b3cf82610fdb0a8b26 100644 (file)
@@ -21,9 +21,8 @@
 # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
 
 def MeshCut(context):
-  # get context study, studyId, salomeGui
+  # get context study, salomeGui
   study = context.study
-  studyId = context.studyId
   sg = context.sg
   
   import os
index 29376b600829a2253dec2968f6feb23c6af073af..cd8d02a16cf915a5bf1d98270cf14b97454f8725 100644 (file)
@@ -137,7 +137,7 @@ Modifier les scripts pour les intégrer dans le mécanisme de test
             fichierMedResult = 'fichierMed.med'
             getStatsMaillage(monMaillage,fichierMedResult)
             getStatsGroupes(monMaillage,fichierMedResult)
-            getStatsCritere(dimMaillage,monMaillage,fichierMedResult,theStudy)
+            getStatsCritere(dimMaillage,monMaillage,fichierMedResult)
 
 Lancement du script de comparaison
 -----------------------------------
index ab7edff59e92c2312ecf9c80b739144b97c76295..7f718755b692bfaecb6520152c0f4d924342774d 100644 (file)
@@ -5,10 +5,10 @@ import salome
 from .getStats import getGroupesRef
 from .Type_Maille import dicoDimENtite
 
-def getCritere(dim,NomMesh,acritere,theStudy):
+def getCritere(dim,NomMesh,acritere):
   import SMESH
   from salome.smesh import smeshBuilder
-  smesh = smeshBuilder.New(theStudy)
+  smesh = smeshBuilder.New()
   import numpy
 #  print dim,NomMesh,acritere
   if dim == 2 :
@@ -35,10 +35,10 @@ def getCritere(dim,NomMesh,acritere,theStudy):
   
   return [max,min,Q1,M,Q3,moyenne]
 
-def getCritereGroupe(NomMesh,NomGr,acritere,theStudy):
+def getCritereGroupe(NomMesh,NomGr,acritere):
   import SMESH
   from salome.smesh import smeshBuilder
-  smesh = smeshBuilder.New(theStudy)
+  smesh = smeshBuilder.New()
   import numpy
     
   # on ne traite que les mailles 2D et 3D
@@ -71,7 +71,7 @@ def getCritereGroupe(NomMesh,NomGr,acritere,theStudy):
   
   return [max,min,Q1,M,Q3,moyenne]
 
-def getObjectsGroupe(Mesh,liste,theStudy):
+def getObjectsGroupe(Mesh,liste):
   import SMESH
   from salome.smesh import smeshBuilder
   dico={}
@@ -82,29 +82,29 @@ def getObjectsGroupe(Mesh,liste,theStudy):
           if name == n :  dico[name]=g
   return dico
 
-def getStatsCritere(dim,Mesh,fichierMedResult,theStudy):
+def getStatsCritere(dim,Mesh,fichierMedResult):
   fichierStatRatio=fichierMedResult.replace('.med','.ratio')
-  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Ratio",theStudy)
+  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Ratio")
   f = open(fichierStatRatio, 'w')
   f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
   f.close()
 
   fichierStatRatio=fichierMedResult.replace('.med','.taille')
-  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Length",theStudy)
+  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Length")
   f = open(fichierStatRatio, 'w')
   f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
   f.close()
 
   liste=getGroupesRef(fichierMedResult)
-  dicoGroupe=getObjectsGroupe(Mesh,liste,theStudy)
+  dicoGroupe=getObjectsGroupe(Mesh,liste)
   for groupe in liste :
-      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Ratio",theStudy)
+      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Ratio")
       extension="_"+groupe+'_Ratio.res'
       fichier=fichierMedResult.replace('.med',extension)
       f = open(fichier, 'w')
       f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
       f.close()
-      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Length",theStudy)
+      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Length")
       extension="_"+groupe+'_Taille.res'
       fichier=fichierMedResult.replace('.med',extension)
       f = open(fichier, 'w')
index 90e4917971f0affb707c86f068f83f7d7abce4ec..4aac5cf7c28cfd89d9532fe5d37049272ec55901 100644 (file)
@@ -130,13 +130,13 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     import SMESH
     from salome.kernel import studyedit
     from salome.smesh import smeshBuilder
-    smesh = smeshBuilder.New(salome.myStudy)
+    smesh = smeshBuilder.New()
     
     if not os.path.isfile(self.fichierOut):
       QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
 
-    maStudy=studyedit.getActiveStudy()
-    smesh.SetCurrentStudy(maStudy)
+    maStudy=salome.myStudy
+    smesh.UpdateStudy()
     (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
     name=str(self.LE_MeshSmesh.text())
     initialMeshFile=None
@@ -178,7 +178,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     newLink=monStudyBuilder.NewObject(SOMesh)
     monStudyBuilder.Addreference(newLink, newStudyIter)
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
     self.num+=1
     return True
 
@@ -236,7 +236,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
     ACmt.SetValue(datai)
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
     self.num += 1
     if verbose: print(("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai)))
     return True
@@ -254,10 +254,10 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
     
     if verbose: print("save hypothesis in Object Browser")
-    smesh = smeshBuilder.New(salome.myStudy)
+    smesh = smeshBuilder.New()
 
-    maStudy=studyedit.getActiveStudy()
-    smesh.SetCurrentStudy(maStudy)
+    maStudy=salome.myStudy
+    smesh.UpdateStudy()
 
     self.editor = studyedit.getStudyEditor()
     moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
@@ -273,7 +273,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     data = self.getResumeData(separator=" ; ")
     self.editor.setAttributeValue(newStudyIter, "AttributeComment", data)
     
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
     self.num += 1
     if verbose: print(("save %s in Object Browser done:\n%s" % (name, data)))
     return True
@@ -452,7 +452,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     from salome.smesh.smeshstudytools import SMeshStudyTools
     from salome.gui import helper as guihelper
     from salome.smesh import smeshBuilder
-    smesh = smeshBuilder.New(salome.myStudy)
+    smesh = smeshBuilder.New()
 
     mySObject, myEntry = guihelper.getSObjectSelected()
     if CORBA.is_nil(mySObject) or mySObject==None:
index 20eea53c69511b767ef3f6a63d4e6275f25983fb..afaa40f3a7fbd1ef483d14d0678f0427e572125d 100755 (executable)
@@ -22,9 +22,8 @@
 # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
 
 def YamsLct(context):
-  # get context study, studyId, salomeGui
+  # get context study, salomeGui
   study = context.study
-  studyId = context.studyId
   sg = context.sg
   
   import os
index 40e34cea8f918ad5a3b27d8476f7543777d3068e..2c91f460a9758d9543cc7829d41237097133046c 100644 (file)
@@ -33,4 +33,4 @@ dicoParams = dict(nomCas            = 'fissTuyau',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
index dc834acd95e465938c4149c81144eaa1f4a408e2..a8fa04b3d06220e3bdbf533d33bdebed06b102d4 100644 (file)
@@ -33,4 +33,4 @@ dicoParams = dict(nomCas            = 'fissTuyau',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
index 1b0141f65834f1994ba24b942947e89d4b59d4ac..be2ba7cbd962eefe7c7b0e4766d7e69dc6b33789 100644 (file)
@@ -4,10 +4,8 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
 
 ###
 ### GEOM component
@@ -18,8 +16,7 @@ from salome.geom import geomBuilder
 import math
 import SALOMEDS
 
-
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -49,7 +46,7 @@ geompy.addToStudy( Cut_1, 'Cut_1' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 boite = smesh.Mesh(Box_1)
 Regular_1D = boite.Segment()
@@ -91,4 +88,4 @@ dicoParams = dict(nomCas            = 'angleCube2',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index f8b761fabfe5698d1f721434ae388cd8ccc52ad6..4638d9aeb700192475849707a8a59e167c18ff40 100644 (file)
@@ -33,4 +33,4 @@ dicoParams = dict(nomCas            = 'fissTuyau',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
\ No newline at end of file
+    salome.sg.updateObjBrowser()
\ No newline at end of file
index 77cff0f72fb365bb25a88bbb6876c82cbb8ac08e..bf331e0921006c5bdefb3e6f02dae08f7ea9e5fc 100644 (file)
@@ -333,7 +333,7 @@ def construitFissureGenerale(maillagesSains,
   logging.info("fichier maillage fissure %s", fichierMaillageFissure)
 
   if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
 
   logging.info("maillage fissure fini")
   
index 1684dd47cfe353b87b2bc3009501761f55f9ac1a..086291e46736b99942cb0ea1bdf7a554059f1ab3 100644 (file)
@@ -21,8 +21,6 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
   #TODO: a compléter
   """
   logging.info('start')
-  
-  #smesh.SetCurrentStudy(salome.myStudy)
 
   geometrieSaine      = geometriesSaines[0]
   maillageSain        = maillagesSains[0]
index 631a3e283024f5088926161419806786ce5ff3ba..f4287c12a820656472ae8c59b086f8d3f08ef27f 100644 (file)
@@ -8,10 +8,10 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
 
 # logging.debug("initialisation de geompy et smesh OK")
 
index 07ba999102089da16137b6536f2c89b09dabb36a..fe408b7b605a535f093f7f84b19396f30bb1fd92 100644 (file)
@@ -194,6 +194,6 @@ def insereFissureElliptique(geometriesSaines, maillagesSains,
   logging.info("fichier maillage fissure : %s", fichierMaillageFissure)
 
   if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
 
   return maillageComplet
index 68195f8a4f4c99273f623950b444d19f3699880e..1cfb3ad2f6a0d8346ba81a20dad91e338965fe4b 100644 (file)
@@ -1378,7 +1378,7 @@ def insereFissureGenerale(maillagesSains,
   logging.info("fichier maillage fissure %s", fichierMaillageFissure)
 
   if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
 
   logging.info("maillage fissure fini")
   
index a0671a18819d727d53dcd7ad766aac0723ee6f6e..acd2fa2c37ec1cc396acdc7f02460e1c19a81d78 100644 (file)
@@ -654,6 +654,6 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
   logging.info("fichier maillage fissure %s", fichierMaillageFissure)
 
   if salome.sg.hasDesktop():
-    salome.sg.updateObjBrowser(True)
+    salome.sg.updateObjBrowser()
 
   return  maillageComplet
\ No newline at end of file
index 44c9dec47880aa7d490a3f20f874dc0183fdd4c4..d028f3d8add725ecaebaac7d62e98a5add69801c 100644 (file)
@@ -30,9 +30,8 @@ from blocFissure import gmu
 
 
 def fissureCoudeDlg(context):
-  # get context study, studyId, salomeGui
+  # get context study, salomeGui
   study = context.study
-  studyId = context.studyId
   sg = context.sg
   
   import os
index df93a34eb33755947ad8e275e46cc350d5728937..2924f176fb4206201f27553b8e4b348dbcc5232d 100644 (file)
@@ -27,9 +27,8 @@ import math
 from blocFissure import gmu
 
 def fissureGeneraleDlg(context):
-  # get context study, studyId, salomeGui
+  # get context study, salomeGui
   study = context.study
-  studyId = context.studyId
   sg = context.sg
 
   import os
index 3b0097aa4f90cda8c60a15368821826f3d37d410..b24d86cf728ea17f7626a82270990e980562525d 100644 (file)
@@ -29,4 +29,4 @@ dicoParams = dict(nomCas            = 'casTestCoinTriple',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 89ceb14e7091a1815e5610c3b38bd9a400f4659b..4ffd10a8a03e9c5c0938cca451501de4fa665ae6 100644 (file)
@@ -29,4 +29,4 @@ dicoParams = dict(nomCas            = 'casTestCoinTriple',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 49eeed3ae6a190d82987540a41c57715275e514f..d7789575e21d88730f943aea44406a603b105a4e 100644 (file)
@@ -29,4 +29,4 @@ dicoParams = dict(nomCas            = 'testAubry',
 execInstance = casStandard(dicoParams)
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index a9c4769aaf1edcbf50f35862b8980362f213a816..9b4f4481cb205547e3b906891b4cfc5909021134 100644 (file)
@@ -4,10 +4,8 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
 
 import os
 from blocFissure import gmu
@@ -22,7 +20,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -55,7 +53,7 @@ geompy.addToStudy( Common_1, 'Common_1' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 Mesh_1 = smesh.Mesh(Box_1)
 Regular_1D = Mesh_1.Segment()
@@ -75,4 +73,4 @@ smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
 smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 3eeb130df8e47a9a9da06fbba1beca36f5794664..01feafa56a5be76ea3085c383ae1525c822f6638 100644 (file)
@@ -4,10 +4,8 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
 
 import os
 from blocFissure import gmu
@@ -22,7 +20,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -104,7 +102,7 @@ geompy.ExportBREP(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests/c
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 cubeFin_1 = smesh.Mesh(cubeFin)
 Regular_1D = cubeFin_1.Segment()
 Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
@@ -127,4 +125,4 @@ smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
 cubeFin_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/cubeFin.med"), 0, SMESH.MED_V2_2, 1 )
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index c43889c94f2d48ddd522e8e6b8464e1b50af0451..6fc4193884c3b3639cf3d6c8d80ce4613128c922 100644 (file)
@@ -22,7 +22,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -125,7 +125,7 @@ geompy.addToStudy( FissInCylindre2, 'FissInCylindre2' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
 smeshObj_1.SetNumberOfSegments( 5 )
@@ -164,4 +164,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
 smesh.SetName(SubMesh_2, 'SubMesh_2')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 7fc7173dc5a91282b806a48314b5ab48b61b5a49..43640c422ccd5e89d0ea42241595bd8ae11f952b 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -23,7 +22,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -56,7 +55,7 @@ geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 Disque_1 = smesh.Mesh(Disque)
 Regular_1D = Disque_1.Segment()
@@ -86,4 +85,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
 smesh.SetName(SubMesh_2, 'SubMesh_2')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index e55e913cf5097ba2f3d07387e9693eb04e0ee094..8a57b3aa1d6ac18e351ed7a9408d839b5bebc841 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -22,7 +21,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -58,4 +57,4 @@ geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse
 
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index b0b1d37f3d1558d4676b80605f9b09e201710262..56f2861a437652e705227eca9608d43f7606b60a 100644 (file)
@@ -4,10 +4,8 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
 
 import os
 from blocFissure import gmu
@@ -22,7 +20,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -50,4 +48,4 @@ geompy.addToStudy( Ellipse_disque, 'Ellipse_disque' )
 
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 5b01a500d1f4700cee579956239d6ec25459ecb1..b607f7c78b4c7ab3a20898853a16858303b8c7a6 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -22,7 +21,7 @@ from salome.geom import geomBuilder
 import math
 import SALOMEDS
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 Disk_1 = geompy.MakeDiskR(100, 1)
 O = geompy.MakeVertex(0, 0, 0)
@@ -56,4 +55,4 @@ geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse
 
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 3430703529a7497a3ba9ace8bdd03893ed100640..40cb7c8d5f841536401311c31856037e5a29211d 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -22,7 +21,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -72,7 +71,7 @@ geompy.addToStudyInFather( EprouvetteCourbe, Compound_x, 'Compound_x' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
 Regular_1D = EprouvetteCourbe_1.Segment()
@@ -104,4 +103,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
 smesh.SetName(SubMesh_2, 'SubMesh_2')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 1b2ef1c477434e45780c2e3f03d23e23fe5300be..2f6bcff204c1eb71036b66dccff419ed34ecca6e 100644 (file)
@@ -4,10 +4,8 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
 
 import os
 from blocFissure import gmu
@@ -22,7 +20,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -107,7 +105,7 @@ geompy.addToStudy( Face_2, 'Face_2' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
 Regular_1D = eprouvetteDroite_1.Segment()
@@ -139,4 +137,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
 smesh.SetName(SubMesh_2, 'SubMesh_2')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index a6d4e3999e3548d2d3c789721bc88a09c090ff21..18796848d2d8e4e159350424c5a1f6b54e4eb2f9 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -22,7 +21,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -101,7 +100,7 @@ geompy.addToStudyInFather( objetSain, Compound_6, 'Compound_6' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 objetSain_1 = smesh.Mesh(objetSain)
 Regular_1D = objetSain_1.Segment()
@@ -133,4 +132,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
 smesh.SetName(SubMesh_2, 'SubMesh_2')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 0f08fd71511cb041694fbd65967741455cf11875..c2fcbb0c45bfb5a42899f01e3bd9d74985d9e503 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -22,7 +21,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
@@ -75,7 +74,7 @@ geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 Mesh_1 = smesh.Mesh(objetSain)
 Regular_1D = Mesh_1.Segment()
@@ -95,4 +94,4 @@ smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
 smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index ce9aa6805295a5858864a99da8f4d88088d7362c..67983ac1be282720f241ad8a14846dc61d457162 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.notebook
@@ -22,7 +21,7 @@ import math
 import SALOMEDS
 
 
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
 O = geompy.MakeVertex(0, 0, 0)
 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
@@ -167,7 +166,7 @@ geompy.addToStudyInFather( Fissure, fondFiss, 'fondFiss' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 coupe_vis_1 = smesh.Mesh(coupe_vis)
 Regular_1D = coupe_vis_1.Segment()
 Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
@@ -245,4 +244,4 @@ smesh.SetName(tige_haute_2, 'tige_haute')
 
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index a0b78faaa5a85ef402f98d4bf6af9e0c6dc100ee..f84c83b4bf1b03eaad9ee71f9ae3de344ede3856 100644 (file)
@@ -40,7 +40,7 @@ module SPADDERPluginTest {
   {
     void demo(in double a,in double b,out double c) raises (SALOME::SALOME_Exception);
     boolean testkernel() raises (SALOME::SALOME_Exception);
-    boolean testsmesh(in long studyId) raises (SALOME::SALOME_Exception);
+    boolean testsmesh() raises (SALOME::SALOME_Exception);
   };
 };
 
index 10b5b94c86575930175ac602b2969033f1aaae46..220f73727c76939e4fb797cbb532f9c656b9c46e 100644 (file)
@@ -118,16 +118,15 @@ bool SPADDERPluginTester_i::testkernel()
  * This test checks the constructor of the basic classes of the SMESH
  * plugin for PADDER.
  */
-bool SPADDERPluginTester_i::testsmesh(CORBA::Long studyId)
+bool SPADDERPluginTester_i::testsmesh()
 {
   beginService("SPADDERPluginTester_i::testsmesh");
 
   // Resolve the SMESH engine and the SALOME study
   // _WARN_ The SMESH engine should have been loaded first
   SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
-  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
-  SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(studyId);
+  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study");
+  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(anObject);
 
   //
   // _MEM_ CAUTION: SMESH_Gen define a data structure for local usage
index 9a2193d556c2669274b0a55df51daa6a1a9aed73..c6eea5ec45870646c4231f2a6e457fe7965c2016 100644 (file)
@@ -50,7 +50,7 @@ public:
   
   void demo(CORBA::Double a,CORBA::Double b,CORBA::Double& c);
   bool testkernel();
-  bool testsmesh(CORBA::Long studyId);
+  bool testsmesh();
 
 };
 
index c2dea7a867629da331d70e8c2829adcd2efdbc3c..dc9ee81907244b6fffb7ecc5efa90bcbcc8e249e 100755 (executable)
@@ -23,7 +23,7 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
 
index 6620020b71b899e1a5ee9c0999d28159aae9859c..f0d81eaeccad2b109124a4a7d670013546db44bc 100644 (file)
@@ -178,7 +178,7 @@ class InputDialog(GenericDialog):
             self.__selectedMesh = None
             return
 
-        self.smeshStudyTool.updateStudy(studyedit.getActiveStudyId())
+        self.smeshStudyTool.updateStudy()
         self.__selectedMesh = self.smeshStudyTool.getMeshObjectFromSObject(mySObject)
         if CORBA.is_nil(self.__selectedMesh):
             self.__ui.txtSmeshObject.setText("The selected object is not a mesh")
index ba00df765c989578370e14397d8f0ae2f0b73fca..6830954aecf6ec244291851deb15d1b21d595490 100644 (file)
@@ -38,7 +38,7 @@ from salome.kernel.uiexception import AdminException
 from omniORB import CORBA
 import SMESH
 from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
 import MESHJOB
 
 gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
@@ -368,7 +368,7 @@ class PluginDialog(QDialog):
         medfilename = os.path.join(meshJobResults.results_dirname,
                                    meshJobResults.outputmesh_filename)
 
-        smesh.SetCurrentStudy(studyedit.getActiveStudy())
+        smesh.UpdateStudy()
         ([outputMesh], status) = smesh.CreateMeshesFromMED(medfilename)
 
         # By convention, the name of the output mesh in the study is
@@ -376,7 +376,7 @@ class PluginDialog(QDialog):
         meshname = 'padder_'+str(self.__jobid)
         smesh.SetName(outputMesh.GetMesh(), meshname)
         if salome.sg.hasDesktop():
-            salome.sg.updateObjBrowser(False)
+            salome.sg.updateObjBrowser()
 
         self.__ui.lblStatusBar.setText("Publication OK")
         self.__setGuiState(["CAN_SELECT"])
index 39167defcc344d63d7c3e4d5dce0c875cb7e3202..efb8053b2acb3ebb6ea5cd75f3a13c49d652f2c3 100644 (file)
@@ -47,6 +47,6 @@ c.testkernel()
 print("Test of usage of SMESH engine from the test component")
 import SMESH
 salome.lcc.FindOrLoadComponent("FactoryServer","SMESH")
-c.testsmesh(salome.myStudyId)
+c.testsmesh()
 
 print("Test completed : OK")