Salome HOME
Merge branch 'hydro/imps_2015' into V7_dev
authorPaul RASCLE <paul.rascle@edf.fr>
Tue, 16 Feb 2016 17:52:15 +0000 (18:52 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Tue, 16 Feb 2016 17:52:15 +0000 (18:52 +0100)
351 files changed:
CMakeLists.txt
SalomeSMESHConfig.cmake.in
doc/salome/examples/filters_ex01.py
doc/salome/examples/filters_ex36.py
doc/salome/examples/testme.py
doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
doc/salome/gui/SMESH/input/about_meshes.doc
doc/salome/gui/SMESH/input/extrusion.doc
doc/salome/gui/SMESH/input/extrusion_along_path.doc
doc/salome/gui/SMESH/input/mesh_infos.doc
doc/salome/gui/SMESH/input/quad_from_ma_algo.doc
doc/salome/gui/SMESH/input/revolution.doc
doc/salome/gui/SMESH/input/selection_filter_library.doc
doc/salome/gui/SMESH/input/sewing_meshes.doc
doc/salome/gui/SMESH/input/tui_filters.doc
idl/SMESH_Hypothesis.idl
idl/SMESH_MeshEditor.idl
src/Controls/SMESH_Controls.cxx
src/Controls/SMESH_ControlsDef.hxx
src/DriverCGNS/DriverCGNS_Read.cxx
src/DriverGMF/DriverGMF_Read.cxx
src/DriverGMF/DriverGMF_Write.cxx
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_Field.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx
src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx
src/DriverUNV/UNV_Utilities.hxx
src/MEDWrapper/Factory/MED_Factory.cxx
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_ActorUtils.h
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_ExtractGeometry.cxx
src/OBJECT/SMESH_ScalarBarActor.cxx
src/OBJECT/SMESH_ScalarBarActor.h
src/PluginUtils/GeomSelectionTools.cxx
src/SMDS/SMDS_Downward.cxx
src/SMDS/SMDS_FaceOfNodes.cxx
src/SMDS/SMDS_IteratorOfElements.cxx
src/SMDS/SMDS_IteratorOfElements.hxx
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_Mesh.hxx
src/SMDS/SMDS_MeshCell.cxx
src/SMDS/SMDS_MeshElementIDFactory.cxx
src/SMDS/SMDS_MeshInfo.hxx
src/SMDS/SMDS_MeshNode.cxx
src/SMDS/SMDS_PolygonalFaceOfNodes.cxx
src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx
src/SMDS/SMDS_QuadraticFaceOfNodes.cxx
src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx
src/SMDS/SMDS_UnstructuredGrid.cxx
src/SMDS/SMDS_VolumeOfNodes.cxx
src/SMDS/SMDS_VolumeTool.cxx
src/SMDS/SMDS_VtkVolume.cxx
src/SMDS/chrono.cxx
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Algo.hxx
src/SMESH/SMESH_Gen.hxx
src/SMESH/SMESH_HypoFilter.cxx
src/SMESH/SMESH_Hypothesis.cxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MeshEditor.hxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_Pattern.cxx
src/SMESH/SMESH_ProxyMesh.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx
src/SMESHClient/SMESH_Client.cxx
src/SMESHDS/SMESHDS_GroupBase.cxx
src/SMESHDS/SMESHDS_GroupBase.hxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_SubMesh.cxx
src/SMESHDS/SMESHDS_SubMesh.hxx
src/SMESHDS/SMESHDS_TSubMeshHolder.hxx
src/SMESHFiltersSelection/SMESH_Type.h
src/SMESHFiltersSelection/SMESH_TypeFilter.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.h
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx
src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOpDlg.h
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_Measurements.cxx
src/SMESHGUI/SMESHGUI_MergeDlg.cxx
src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx
src/SMESHGUI/SMESHGUI_MeshInfo.cxx
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/SMESHGUI/SMESHGUI_MeshOp.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_PreviewDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.h
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.h
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_Selection.h
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.h
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.h
src/SMESHGUI/SMESHGUI_Utils.cxx
src/SMESHGUI/SMESHGUI_Utils.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHUtils/SMESH_Block.cxx
src/SMESHUtils/SMESH_Comment.hxx
src/SMESHUtils/SMESH_File.cxx
src/SMESHUtils/SMESH_FreeBorders.cxx
src/SMESHUtils/SMESH_MAT2d.cxx
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/SMESHUtils/SMESH_MeshAlgos.hxx
src/SMESHUtils/SMESH_OctreeNode.cxx
src/SMESHUtils/SMESH_Tree.hxx
src/SMESHUtils/SMESH_TypeDefs.hxx
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_Measurements_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.hxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_NoteBook.cxx
src/SMESH_I/SMESH_Pattern_i.cxx
src/SMESH_I/SMESH_PreMeshInfo.cxx
src/SMESH_I/SMESH_subMesh_i.cxx
src/SMESH_SWIG/StdMeshersBuilder.py
src/SMESH_SWIG/smeshBuilder.py
src/StdMeshers/CMakeLists.txt
src/StdMeshers/StdMeshers_Adaptive1D.cxx
src/StdMeshers/StdMeshers_Arithmetic1D.cxx
src/StdMeshers/StdMeshers_CartesianParameters3D.cxx
src/StdMeshers/StdMeshers_Cartesian_3D.cxx
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx
src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx
src/StdMeshers/StdMeshers_Deflection1D.cxx
src/StdMeshers/StdMeshers_Distribution.cxx
src/StdMeshers/StdMeshers_FaceSide.cxx
src/StdMeshers/StdMeshers_FixedPoints1D.cxx
src/StdMeshers/StdMeshers_Geometric1D.cxx
src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx
src/StdMeshers/StdMeshers_Hexa_3D.cxx
src/StdMeshers/StdMeshers_ImportSource.cxx
src/StdMeshers/StdMeshers_Import_1D.cxx
src/StdMeshers/StdMeshers_Import_1D2D.cxx
src/StdMeshers/StdMeshers_LengthFromEdges.cxx
src/StdMeshers/StdMeshers_LocalLength.cxx
src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
src/StdMeshers/StdMeshers_MaxElementArea.cxx
src/StdMeshers/StdMeshers_MaxElementVolume.cxx
src/StdMeshers/StdMeshers_MaxLength.cxx
src/StdMeshers/StdMeshers_NumberOfLayers.cxx
src/StdMeshers/StdMeshers_NumberOfSegments.cxx
src/StdMeshers/StdMeshers_Penta_3D.cxx
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_Prism_3D.hxx
src/StdMeshers/StdMeshers_ProjectionUtils.cxx
src/StdMeshers/StdMeshers_Projection_2D.cxx
src/StdMeshers/StdMeshers_Projection_3D.cxx
src/StdMeshers/StdMeshers_Propagation.cxx
src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx
src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx
src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx
src/StdMeshers/StdMeshers_QuadrangleParams.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
src/StdMeshers/StdMeshers_RadialPrism_3D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshers/StdMeshers_Reversible1D.cxx
src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx
src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx
src/StdMeshers/StdMeshers_StartEndLength.cxx
src/StdMeshers/StdMeshers_ViscousLayers2D.cxx
src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx
src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx
src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx
src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
src/Tools/MGCleanerPlug/MGCleanerMonViewText.py
src/Tools/YamsPlug/monViewText.py
src/Tools/blocFissure/AREextradosLauncher.py [new file with mode: 0644]
src/Tools/blocFissure/AREintradosLauncher.py [new file with mode: 0644]
src/Tools/blocFissure/CMakeLists.txt
src/Tools/blocFissure/CasTests/CMakeLists.txt
src/Tools/blocFissure/CasTests/cubeAngle.py
src/Tools/blocFissure/CasTests/cubeAngle2.py
src/Tools/blocFissure/CasTests/cubeCoin.py [new file with mode: 0644]
src/Tools/blocFissure/CasTests/cubeMilieu.py [new file with mode: 0644]
src/Tools/blocFissure/CasTests/cubeTransverse.py [new file with mode: 0644]
src/Tools/blocFissure/CasTests/cylindre.py
src/Tools/blocFissure/CasTests/cylindre_2.py
src/Tools/blocFissure/CasTests/ellipse_1.py
src/Tools/blocFissure/CasTests/ellipse_2.py
src/Tools/blocFissure/CasTests/eprouvetteCourbe.py
src/Tools/blocFissure/CasTests/eprouvetteDroite.py
src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py
src/Tools/blocFissure/CasTests/execution_Cas.py
src/Tools/blocFissure/CasTests/faceGauche.py
src/Tools/blocFissure/CasTests/faceGauche_2.py
src/Tools/blocFissure/CasTests/fissureCoude_1.py
src/Tools/blocFissure/CasTests/fissureCoude_10.py
src/Tools/blocFissure/CasTests/fissureCoude_2.py
src/Tools/blocFissure/CasTests/fissureCoude_3.py
src/Tools/blocFissure/CasTests/fissureCoude_4.py
src/Tools/blocFissure/CasTests/fissureCoude_5.py
src/Tools/blocFissure/CasTests/fissureCoude_6.py
src/Tools/blocFissure/CasTests/fissureCoude_7.py
src/Tools/blocFissure/CasTests/fissureCoude_8.py
src/Tools/blocFissure/CasTests/fissureCoude_9.py
src/Tools/blocFissure/CasTests/vis_1.py
src/Tools/blocFissure/README
src/Tools/blocFissure/casStandard.py [deleted file]
src/Tools/blocFissure/exemple.py
src/Tools/blocFissure/exemple2.py
src/Tools/blocFissure/fissureLauncher.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/CMakeLists.txt
src/Tools/blocFissure/gmu/__init__.py
src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/casStandard.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/compoundFromList.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/construitFissureGenerale.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/construitMaillagePipe.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/creePointsPipePeau.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py
src/Tools/blocFissure/gmu/creeZoneDefautFilling.py
src/Tools/blocFissure/gmu/creeZoneDefautGeom.py
src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py
src/Tools/blocFissure/gmu/elimineExtremitesPipe.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/extractionOrientee.py
src/Tools/blocFissure/gmu/extractionOrienteeMulti.py
src/Tools/blocFissure/gmu/facesCirculaires.py
src/Tools/blocFissure/gmu/facesFissure.py
src/Tools/blocFissure/gmu/facesToreInBloc.py
src/Tools/blocFissure/gmu/facesVolumesToriques.py
src/Tools/blocFissure/gmu/findWireEndVertices.py
src/Tools/blocFissure/gmu/findWireIntermediateVertices.py
src/Tools/blocFissure/gmu/fissureCoude.py
src/Tools/blocFissure/gmu/fissureGenerique.py
src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py
src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py
src/Tools/blocFissure/gmu/geomsmesh.py
src/Tools/blocFissure/gmu/getCentreFondFiss.py
src/Tools/blocFissure/gmu/identifieEdgesPeau.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/identifieElementsDebouchants.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/identifieElementsFissure.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/identifieFacesPeau.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/initLog.py
src/Tools/blocFissure/gmu/insereFissureElliptique.py
src/Tools/blocFissure/gmu/insereFissureGenerale.py
src/Tools/blocFissure/gmu/insereFissureLongue.py
src/Tools/blocFissure/gmu/listOfExtraFunctions.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/mailleAretesEtJonction.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/mailleFacesFissure.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/mailleFacesPeau.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/partitionBlocDefaut.py
src/Tools/blocFissure/gmu/partitionVolumeSain.py
src/Tools/blocFissure/gmu/partitionneFissureParPipe.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/peauInterne.py
src/Tools/blocFissure/gmu/prolongeWire.py
src/Tools/blocFissure/gmu/propagateTore.py
src/Tools/blocFissure/gmu/quadranglesToShape.py
src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/restreintFaceFissure.py [new file with mode: 0644]
src/Tools/blocFissure/gmu/rotTrans.py
src/Tools/blocFissure/gmu/shapeSurFissure.py
src/Tools/blocFissure/gmu/sortGeneratrices.py
src/Tools/blocFissure/gmu/toreFissure.py
src/Tools/blocFissure/gmu/triedreBase.py
src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py [new file with mode: 0644]
src/Tools/blocFissure/ihm/CMakeLists.txt
src/Tools/blocFissure/ihm/fissureCoude.ui
src/Tools/blocFissure/ihm/fissureCoude_plugin.py
src/Tools/blocFissure/ihm/fissureGenerale.ui
src/Tools/blocFissure/ihm/fissureGenerale_plugin.py [new file with mode: 0644]
src/Tools/blocFissure/lanceurSoudureArrondieTest.py [new file with mode: 0644]
src/Tools/blocFissure/lanceurSoudureViveTest.py [new file with mode: 0644]
src/Tools/blocFissure/lanceurTestAubry.py [new file with mode: 0644]
src/Tools/blocFissure/materielCasTests/CMakeLists.txt
src/Tools/blocFissure/materielCasTests/cubeAngle.py
src/Tools/blocFissure/materielCasTests/cubeFin.py [new file with mode: 0644]
src/Tools/blocFissure/materielCasTests/decoupeCylindre.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/genereMateriel.py
src/Tools/blocFissure/materielCasTests/vis.py
src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx
src/Tools/smesh_plugins.py

index 08f74713394c0b9db53c69d8a5eeadbc612731dc..312c48e842c6af0a4a3fd42841bf1fbefcb4c6cd 100755 (executable)
@@ -32,7 +32,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Find KERNEL
 # ===========
@@ -87,7 +87,8 @@ MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB)
 
 # Various
 # Python
-FIND_PACKAGE(SalomePython REQUIRED)
+FIND_PACKAGE(SalomePythonInterp REQUIRED)
+FIND_PACKAGE(SalomePythonLibs REQUIRED)
 # PThread
 FIND_PACKAGE(SalomePThread REQUIRED)
 # SWIG
index 8a8827406dd0d49927917387f86492bccb759362..3ec182cbea5fa8afe79782e58a8fd3b59260bfb9 100644 (file)
@@ -75,32 +75,34 @@ IF(SALOME_SMESH_USE_TBB)
   SET_AND_CHECK(TBB_ROOT_DIR_EXP "@PACKAGE_TBB_ROOT_DIR@")
 ENDIF()
 
-# For all prerequisites, load the corresponding targets if the package was used 
+# For all prerequisites, load the corresponding targets if the package was used
 # in CONFIG mode. This ensures dependent projects link correctly
 # without having to set LD_LIBRARY_PATH:
-SET(_PREREQ @_PREREQ_LIST@)
-SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@)
-SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@")
-LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
-IF(NOT _list_len EQUAL 0)
+SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
+LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
+IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
-  MATH(EXPR _range "${_list_len}-1")
-  FOREACH(_p RANGE ${_range})  
-    LIST(GET _PREREQ            ${_p} _pkg    )
-    LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
-    LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo)
-    MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
-    IF(NOT _pkg_compo)
-      FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE 
-          PATHS "${_pkg_dir}" 
-          NO_DEFAULT_PATH)
-    ELSE()
-      STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}")
-      MESSAGE(STATUS "===> (components: ${_pkg_compo})")
-      FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
-          COMPONENTS ${_compo_lst} 
-          PATHS "${_pkg_dir}"
-          NO_DEFAULT_PATH)
+  MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
+  FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
+    LIST(GET _PREREQ_@PROJECT_NAME@            ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@    )
+    LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
+    LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
+    IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
+      MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
+      IF(NOT _pkg_compo_@PROJECT_NAME@)
+        FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+            PATHS "${_pkg_dir_@PROJECT_NAME@}"
+            NO_DEFAULT_PATH)
+      ELSE()
+        STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
+        MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
+        FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+            COMPONENTS ${_compo_lst_@PROJECT_NAME@}
+            PATHS "${_pkg_dir_@PROJECT_NAME@}"
+            NO_DEFAULT_PATH)
+      ENDIF()
     ENDIF()
   ENDFOREACH()
 ENDIF()
index 233b699a9fae0aed51653378aaed73861670cbdd..88305c97f9523b52ad8809b37456bf7bf1d031a1 100644 (file)
@@ -25,3 +25,10 @@ crit = [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_AspectRatio, '<', 1.5, BinaryO
 triaGroup = mesh.MakeGroupByCriteria( "Tria AR < 1.5", crit )
 print "Number of triangles with aspect ratio < 1.5:", triaGroup.Size()
 
+# get range of values of Aspect Ratio of all faces in the mesh
+aspects = mesh.GetMinMax( SMESH.FT_AspectRatio )
+print "MESH: Min aspect = %s, Max aspect = %s" % ( aspects[0], aspects[1] )
+
+# get max value of Aspect Ratio of faces in triaGroup
+grAspects = mesh.GetMinMax( SMESH.FT_AspectRatio, triaGroup )
+print "GROUP: Max aspect = %s" % grAspects[1]
index 3dc8e4fc6443614f2e6deacf038496b63a41e97e..ec1e2b4fbfc786b08ba5cb60773da10ee956be7c 100644 (file)
@@ -1,13 +1,17 @@
-# Combine filters with Criterion structures using of "criteria".
+# Combine several criteria into a filter
 
 # create mesh
 from SMESH_mechanic import *
+
 # get all the quadrangle faces ...
 criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_QUADRANGLE, SMESH.FT_LogicalAND)
-# ... AND do NOT get those from sub_face3
+# ... but those from sub_face3
 criterion2 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGeom, sub_face3, SMESH.FT_LogicalNOT)
-filter = smesh.CreateFilterManager().CreateFilter()
-filter.SetCriteria([criterion1,criterion2])
-ids = mesh.GetIdsFromFilter(filter)
 
-myGroup = mesh.MakeGroupByIds("Quads_on_cylindrical_faces",SMESH.FACE,ids)
+quadFilter = smesh.GetFilterFromCriteria([criterion1,criterion2])
+
+# get faces satisfying the criteria
+ids = mesh.GetIdsFromFilter(quadFilter)
+
+# create a group of faces satisfying the criteria
+myGroup = mesh.GroupOnFilter(SMESH.FACE,"Quads_on_cylindrical_faces",quadFilter)
index 510a408f8d5022a28898ee218f664512fbd90834..cd74c44959f351fd6963101670401544f9c44c0c 100755 (executable)
@@ -24,11 +24,21 @@ import unittest, sys, os
 class SalomeSession(object):
     def __init__(self, script):
         import runSalome
-        sys.argv  = ["runSalome.py"]
+        run_script = "runSalome.py"
+        if sys.platform == 'win32':
+            module_dir = os.getenv("KERNEL_ROOT_DIR")
+            if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script)
+            pass
+        sys.argv  = [run_script]
         sys.argv += ["--terminal"]
         sys.argv += ["--modules=GEOM,MED,SMESH"]
         sys.argv += ["%s" % script]
+        if sys.platform == 'win32':
+            main_module_path = sys.modules['__main__'].__file__
+            sys.modules['__main__'].__file__ = ''
         clt, d = runSalome.main()
+        if sys.platform == 'win32':
+            sys.modules['__main__'].__file__ = main_module_path
         return
 
     def __del__(self):
index a5b54c82c0422fd3d8cbd7e11db971d3edba118b..01deffbcd3dd5030cb77f5859b5571bc3367a912 100644 (file)
@@ -241,7 +241,7 @@ in the plot the density function curve in red and the node
 distribution as blue crosses. The node distribution is computed in the
 same way as for 
 \ref analyticdensity_anchor "Distribution with Analytic Density". You
-can select the <b>Conversion mode</b> from\b Exponent and <b>Cut
+can select the <b>Conversion mode</b> from \b Exponent and <b>Cut
 negative</b>.
 
 \image html distributionwithtabledensity.png
@@ -250,7 +250,7 @@ negative</b>.
 \ref tui_deflection_1d "Defining Number of Segments" hypothesis
 operation.
 
-\note The plot functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module).
+\note The plot functionality is available only if GUI module is built with Plot 2D Viewer (option SALOME_USE_PLOT2DVIEWER is ON when building GUI module).
 
 <br>
 \anchor start_and_end_length_anchor
@@ -344,16 +344,24 @@ geometrical model in the 3D Viewer, which can help to understand the
 location of a set of edges within the model.
 
 <b>Propagation chains</b> group allows defining <b>Reversed Edges</b>
-for splitting opposite edges of quadrilateral faces
-in a logically uniform direction. When this group is
-activated, the list is filled with propagation chains found within the
-model. When a chain is selected in the list its edges are
-shown in the Viewer with arrows, which enables choosing a common
-direction for all chain edges. \b Reverse button inverts the common
-direction of chain edges. If \b Add button is active, some
-edges of a chain have a different direction, so you can click \b Add
-button to add them to <b>Reversed Edges</b> list.
+for splitting opposite edges of quadrilateral faces in a logically
+uniform direction. When this group is activated, the list is filled
+with propagation chains found within the shape on which a hypothesis
+is assigned. When a chain is selected in the list its edges are shown
+in the Viewer with arrows, which enables choosing a common direction
+for all chain edges. \b Reverse button inverts the common direction of
+chain edges. \b Add button is active if some edges of a chain have a
+different direction, so you can click \b Add button to add them
+to <b>Reversed Edges</b> list.
 
 \image html propagation_chain.png "The whole geometry and a propagation chain"
 
+\note Alternatively, uniform direction of edges of one propagation
+chain can be achieved by 
+\ref constructing_submeshes_page "definition of a sub-mesh" on one
+edge of the chain and assigning a 
+\ref propagation_anchor "Propagation" additional hypothesis.
+Orientation of this edge (and hence of all the rest edges of the chain) can be
+controlled by using <b>Reversed Edges</b> field.
+
 */
index 7550e893495c187f75e969a7f1c20f72e2f9d6eb..621a47e990cd5cb5febd22133da91b94cdafbd3d 100644 (file)
@@ -3,14 +3,19 @@
 \page about_meshes_page About meshes
 
 \n \b MESH represents a discrete approximation of a subset of the
-three-dimensional space by \ref mesh_entities "elementary geometrical elements".
+three-dimensional space by \ref mesh_entities "elementary geometrical
+elements".
+
+A SALOME study can contain multiple meshes, but they do not
+implicitly compose one super-mesh, and finally each of them
+can be used (e.g. exported) only individually.
 
 Mesh module provides several ways to create the mesh:
 <ul>
   <li>The main way is to \subpage constructing_meshes_page "construct the mesh" 
     on the basis of the geometrical shape produced in the Geometry
     module. This way implies selection of 
-    - a geometrical object (<em> main shape</em>) and
+    - a geometrical object (<em>main shape</em>) and
     - <em>meshing parameters</em> (\ref
       basic_meshing_algos_page "meshing algorithms" and
     characteristics (e.g. element size) of a
@@ -19,7 +24,7 @@ Mesh module provides several ways to create the mesh:
 
     Construction of \subpage constructing_submeshes_page "sub-meshes"
     allows to discretize some sub-shapes of the main shape, for example a face,
-    using the meshing parameters that differ from those for other sub-shapes.<br>
+    using the meshing parameters that differ from those used for other sub-shapes.<br>
     Meshing parameters of meshes and sub-meshes can be 
     \subpage editing_meshes_page "edited". (Upon edition only mesh entities
     generated using changed meshing parameters are removed and will be
@@ -39,7 +44,7 @@ Mesh module provides several ways to create the mesh:
     (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and
     SAUVE formats.
   </li>
-  <li>The 3D mesh can be generated from the 2D mesh, \ref
+  <li>The 3D mesh can be generated from the 2D mesh, which was \ref
     importing_exporting_meshes_page "imported" or manually created. To
     setup the meshing parameters of a mesh not based on a geometry, just
     invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on
@@ -98,16 +103,17 @@ surface in addition stores its position in parametric space of the
 associated geometrical entity.
 
 Mesh entities are identified by integer IDs starting from 1.
-Nodes and elements are countered separately, i.e. there can be a node
+Nodes and elements are counted separately, i.e. there can be a node
 and element with the same ID.
 
 SALOME supports elements of second order, without a central node
 (quadratic triangle, quadrangle, polygon, tetrahedron, hexahedron,
 pentahedron and pyramid) and with central nodes (bi-quadratic triangle
 and quadrangle and tri-quadratic hexahedron).<br>
-Quadratic mesh can be obtained in two ways:
+Quadratic mesh can be obtained in three ways:
 - Using a global \ref quadratic_mesh_anchor "Quadratic Mesh"
 hypothesis. (Elements with the central node are not generated in this way).
 - Using \ref convert_to_from_quadratic_mesh_page operation.
-
+- Using an appropriate option of some meshing algorithms, which
+generate elements of several dimensions starting from mesh segments.
 */
index 56cb32f4c687ea4aa1bdfa8728f47dbc9c2cacf6..6b07af9e1aa89d836a8adb0cb9140eb05388f725 100644 (file)
@@ -23,10 +23,10 @@ elements is extruded into a corresponding type of result elements:
 </table>
 
 When 2D elements are extruded, in addition to 3D elements segments are
-created on ribs of the result 3D mesh. Free edges of input 2D elements
+created on the ribs of the resulting 3D mesh. Free edges of input 2D elements
 generate logically horizontal rib segments. Logically vertical rib
-segments are generated from nodes belonging to a sole input 2D element
-(a figure below illustrates this rule).
+segments are generated from the nodes belonging to a sole input 2D element
+(the figure below illustrates this rule).
 
 \image html extru_rib_segs.png "Two triangles extruded: no vertical rib segments generated from nodes #2 and #3 as they are shared by both triangles"
 
@@ -68,30 +68,30 @@ The following dialog will appear:
         the \ref filtering_elements "Selection filters" page.</li> 
     </ul>
   </li>
+
   <li>If the <b>Extrusion to Distance</b> radio button is selected
-    - specify the translation vector by which the elements will be extruded.
+    <ul>
+      <li> specify the translation vector by which the elements will
+      be extruded.</li>
+    </ul>
   </li>
-  <p><br></p>
-
-\image html extrusionalongaline2.png  
 
  <li>If the <b>Extrusion Along Vector</b> radio button is selected
+\image html extrusionalongaline2.png  
     <ul>
-      <li>specify the coordinates of the \b Vector along which the elements
+      <li>specify the components of the \b Vector along which the elements
         will be extruded, either directly or by selecting the mesh face (the
         normal to the face will define the vector),</li>
       <li>specify the \b Distance of extrusion along the vector (it can
         be negative).</li>
     </ul>
   </li>
-  <p><br></p>
 
-\image html extrusionalongaline3.png  
-  
   <li>If the <b>Extrusion By Normal</b> radio button is selected,
     every node of the selected faces is extruded along the \a average
     of the \a normal vectors to the faces sharing the node. (Nodes and
     edges cannot be extruded in this mode.)
+\image html extrusionalongaline3.png 
     <ul>
       <li>Specify the \b Distance of extrusion (it can be negative),</li>
       <li>Use <b>Along average normal</b> check-box to specify along
index 03717c77fb60f1ed6d72d70c02a03bc73f8f3b6f..ca782049a01817646cd9d922ec8c12df74ccd0d6 100644 (file)
@@ -134,9 +134,11 @@ The following dialog will appear:
 <li>If the path of extrusion is curvilinear, at each iteration the
   extruded elements are rotated to keep its initial angularity to the
   curve. By default, the <b>Base Point</b> around which the elements
-  are rotated is the mass center of the elements, however, you can
-  specify any point as the <b>Base Point</b> and the elements will be
-  rotated with respect to this point.<br>
+  are rotated is the mass center of the elements (note that it can
+  differ from the gravity center computed by \a Geometry module for the
+  underlying shape), however, you can specify any point as the <b>Base
+  Point</b> and the elements will be rotated with respect to this
+  point.<br>
   Note that only the displacement of the <b>Base Point</b> exactly
   equals to the path, and all other extruded elements simply keep
   their position relatively to the <b>Base Point</b> at each
@@ -153,7 +155,7 @@ The following dialog will appear:
 
 <b>Linear variation of the angles</b> option allows defining the angle
 of gradual rotation for the whole path. At each step the elements will
-be rotated by <code>angle / nb. of steps</code>.
+be rotated by <code>( angle / nb. of steps )</code>.
 </li>
 </ul>
 </li>
index 2013cd426aca786b2bf7ce75ca87b481f26be2a7..929deb8f3f34e98d1b8eb885ba7c8235fefecfb8 100644 (file)
@@ -46,7 +46,7 @@ information about the selected mesh node(s) or element(s), namely:
   - Node ID;
   - Coordinates (X, Y, Z);
   - Connectivity information (connected elements); double click in
-    this line makes the dialog show information of these elements;
+    this line reveals information about these elements;
   - Position on a shape (for meshes built on a geometry);
   - Groups information (names of groups the node belongs to).
 
@@ -59,7 +59,7 @@ information about the selected mesh node(s) or element(s), namely:
   - Type (triangle, quadrangle, etc.);
   - Gravity center (X, Y, Z coordinates);
   - Connectivity information (connected nodes); double click in
-    a line of a node makes the dialog show information of this node;
+    a line of a node reveals the information about this node;
   - Quality controls (area, aspect ration, volume, etc.);
   - Position on a shape (for meshes built on a geometry);
   - Groups information (names of groups the element belongs to).
@@ -156,7 +156,7 @@ button. Also, values are automatically computed if the number of
 nodes / elements does not exceed the "Automatic controls compute limit" set 
 via the "Mesh information" preferences (zero value means that there is no limit).
 
-\note The plot functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module).
+\note The plot functionality is available only if the GUI module is built with Plot 2D Viewer (option SALOME_USE_PLOT2DVIEWER is ON when building GUI module).
 
 The button \b "Dump" allows printing the information displayed in the
 dialog box to a .txt file.
index 6a90f376e4e63b7de1e9bba8c631fbf7815c1c2a..e3df9e4a51cb28f6c1593f70c9c1d25cbb361744 100644 (file)
@@ -3,9 +3,9 @@
 \page quad_from_ma_algo_page Medial Axis Projection Quadrangle meshing algorithm
 
 Medial Axis Projection algorithm can be used for meshing faces with
-sinuous borders and having channel-like shape, for which is it
-difficult to define 1D hypotheses so that generated quadrangles to be
-of good shape. The algorithm can be also applied to faces with ring
+sinuous borders and a channel-like shape, for which it can be
+difficult to define 1D hypotheses such that to obtain a good shape of
+resulting quadrangles. The algorithm can be also applied to faces with ring
 topology, which can be viewed as a closed 'channel'. In the latter
 case radial discretization of a ring can be specified by
 using <em>Number of Layers</em> or <em>Distribution of Layers</em>
@@ -13,7 +13,7 @@ hypothesis.
 
 \image html quad_from_ma_mesh.png "A mesh of a river model to the left and of a ring-face to the right"
 
-The algorithm assures good shape of quadrangles by constructing Medial
+The algorithm provides proper shape of quadrangles by constructing Medial
 Axis between sinuous borders of the face and using it to
 discretize the borders. (Shape of quadrangles can be not perfect at
 locations where opposite sides of a 'channel' are far from being parallel.)
@@ -22,13 +22,13 @@ locations where opposite sides of a 'channel' are far from being parallel.)
 
 The Medial Axis is used in two ways:
 <ol>
-<li>If there is a sub-mesh on either sinuous border, then the nodes of
+<li>If there is a sub-mesh on a sinuous border, then the nodes of
   this border are mapped to the opposite border via the Medial
   Axis.</li>
-<li> If there is no sub-meshes on the sinuous borders, then a part of
+<li> If there are no sub-meshes on sinuous borders, then the part of
   the Medial Axis that can be mapped to both borders is discretized
   using a 1D hypothesis assigned to the face or its ancestor shapes,
-  and the division points are mapped from the Medial Axis to the both
+  and the division points are mapped from the Medial Axis to both
   borders to find positions of nodes.</li>
 </ol>
 
index f0d4194df922cd2740cc5de2a62fc8b49a377a70..4b1d8124057b511f576c9db87c447ae61c0d29d7 100644 (file)
@@ -7,7 +7,7 @@ dimension than the input ones.  Boundary elements around generated
 mesh of plus one dimension are additionally created. All created
 elements can be automatically grouped. Revolution can be used to create
 a \ref extrusion_struct "structured mesh from scratch". 
-See \ref extrusion_page page for general information on Revolution
+See \ref extrusion_page page for general information on Revolution,
 which can be viewed as extrusion along a circular path.
 
 <em>To apply revolution:</em>
index 30870607574f58c3dc6b1b4465c452de6fc6ad2c..c87d928e8ae4ad9fb508e790885d61e288534b4e 100644 (file)
@@ -3,10 +3,10 @@
 \page selection_filter_library_page Selection filter library
 
 \n Selection filter library allows creating and storing in files
-filters that can be later loaded and used for operations on meshes. You can
-access to it from the Main Menu via <b>Tools / Selection filter library</b>.
-It is also possible to save any filter by invoking the filter library
-from \a Filter dialog launched from any mesh operation.
+the filters that can be later reused for operations on meshes. You can
+access it from the Main Menu via <b>Tools / Selection filter library</b>.
+It is also possible to save/load a filter by invoking the filter library
+from \ref filtering_elements "Filter dialog" launched from any mesh operation.
 
 \image html selectionfilterlibrary.png
 
@@ -19,8 +19,9 @@ the current study. You can \b Add or \b Delete filters.
 filter. By default it is prefixed with the corresponding entity type.
 
 \anchor filtering_elements
+<h2>Filter Dialog</h2>
 
-When we use filters during group creation or another operation (by 
+When we use filters during group creation or another operation (by 
 clicking <b>Set Filter</b> button in the corresponding dialog), the
 dialog for setting filters looks as shown below.
 
@@ -29,7 +30,10 @@ dialog for setting filters looks as shown below.
 The \b Add button creates a new criterion at the end of the list of
 criteria. The \b Insert button creates a new criterion before the
 selected criterion. The \b Remove button deletes the selected
-criterion. The \b Clear button deletes all criteria.
+criterion. The \b Clear button deletes all criteria.\n
+If there is a choice of <b>Entity type</b> in the dialog, only
+criteria of currently selected type are used to create or change a
+filter, and criteria of hidden types (if were specified) are ignored.
 \n Each <b>Entity type</b> has its specific list of criteria, however all
 filters have common syntax. The <b>Threshold Value</b> should be specified 
 for most criteria. For numerical criteria it is necessary to indicate if 
@@ -63,15 +67,22 @@ created. You have to select the mesh and the button will be enabled.
 Some criteria are applicable to all <b>Entity types</b>:
 <ul><li>
 <b>Belong to Geom</b> selects entities whose all nodes lie on the
-shape defined by <b>Threshold Value</b>. If the threshold shape is a
-sub-shape of the main shape of the mesh the algorithm works faster, if
-this is any other shape the algorithm works slower.
+shape defined by <b>Threshold Value</b>. 
+If the threshold shape is a sub-shape of the main shape of the mesh,
+the filtering algorithm works faster because node-to-shape association
+is used instead of measuring distance between nodes and the shape, and
+\b Tolerance is not used. If the threshold shape is any other shape,
+the algorithm works slower because distance between nodes and the
+shape is measured and is compared with \b Tolerance.
 </li><li>
 <b>Lying on Geom</b> selects entities whose at least one node
 lies on the shape defined by the <b>Threshold Value</b>.
-If the threshold shape is a sub-shape of the main shape of the mesh the
-algorithm works faster, if this is any other
-shape, the algorithm works slower.
+If the threshold shape is a sub-shape of the main shape of the mesh,
+the filtering algorithm works faster because node-to-shape association
+is used instead of measuring distance between nodes and the shape, and
+\b Tolerance is not used. If the threshold shape is any other shape,
+the algorithm works slower because distance between nodes and the
+shape is measured and is compared with \b Tolerance.
 </li><li>
 <b>Belong to Mesh Group</b> selects entities included into the mesh group
 defined by the <b>Threshold Value</b>.
@@ -94,7 +105,7 @@ other parts. <b>Threshold Value</b> locating any element of the domain can be ei
 </li>
 </ul>
 
-Some criteria are applicable to all <b>Entity types</b> of dimension
+Some criteria are applicable to entities of dimension
 more than zero, i.e. to \b Edges, \b Faces and \b Volumes:
 <ul><li>
 <b>Linear</b> allows selection of Linear or Quadratic elements (if Unary is set to "Not")
@@ -108,8 +119,8 @@ as a combination of geometry type and the number of nodes.
 </li>
 </ul>
 
-The following criteria are applicable to all <b>Entity types</b>
-except for <b>Volumes</b>:
+The following criteria are applicable to Entities of \b all types
+except for \a Volumes:
 <ul><li>
 <b>Belong to Plane</b> selects entities whose all nodes belong to a
 specified plane within a given <b>Tolerance</b>.
@@ -179,8 +190,8 @@ The following criteria allow selecting mesh <b>Faces</b>:
 \ref area_page "Area quality control"), which is more, less or equal (within a given
 <b>Tolerance</b>) to the predefined <b>Threshold Value</b>.
 </li><li>
-<b>Free edges</b> selects 2D mesh elements having at least one of its
-edges not shared with other faces. See also a
+<b>Free edges</b> selects 2D mesh elements having at least one 
+edge, which is not shared with other faces. See also a
 \ref free_edges_page "Free Edges quality control".
 </li><li>
 <b>Free faces</b> selects 2D mesh elements, which belong to less than two volumes.
@@ -219,7 +230,7 @@ diagonals with a value of length, which is more, less or equal
 </li>
 </ul>
 
-The following criteria allow selecting  mesh <b>Volumes</b>:
+The following criteria allow selecting mesh <b>Volumes</b>:
 <ul><li>
 <b>Aspect ratio 3D</b> selects 3D mesh elements with an aspect ratio (see also an
 \ref aspect_ratio_3d_page "Aspect Ratio 3D quality control"), which is more, less or equal
index 8697b36f48b7437b7a04232c5f6acc9e28f4790d..cfb6206dd34d66b6226df0465d9a8bf423ba6f5c 100644 (file)
@@ -32,9 +32,9 @@ the type of sewing operation you would like to perform.</li>
 This functionality allows you to unite free borders of a 2D mesh.
 
 There are two working modes: \a Automatic and \a Manual. In the \b
-Automatic mode, the program finds free borders coincident within a
+Automatic mode, the program finds free borders coincident within the
 specified tolerance and sews them. Optionally it is possible to
-visually check and correct is necessary the found free borders before
+visually check and correct if necessary the found free borders before
 sewing. <br>
 In the \b Manual mode you are to define borders to sew by picking
 three nodes of each of two borders.
@@ -44,14 +44,14 @@ three nodes of each of two borders.
 
 To use \b Automatic sewing:
 <ul>
-<li>Specify a mesh you want to sew by selecting it or any its part
+<li>Specify the mesh you want to sew by selecting it or any its part
   (group or sub-mesh) in the Object Browser or in the VTK Viewer.</li>
-<li>Specify the \b Tolerance within which free borders are considered
+<li>Specify the \b Tolerance, within which free borders are considered
   coincident. At the default zero \b Tolerance, the tolerance used by
   the search algorithm is defined as one tenth of an average size of
-  elements adjacent to free borders being compared.</li>
+  elements adjacent to compared free borders.</li>
 <li>To visually check the coincident free borders found by the
-  algorithm, switch off <b>Auto Sewing</b> check-box. Then controls
+  algorithm, switch off <b>Auto Sewing</b> check-box. The controls
   to adjust groups of coincident free borders will become available in
   the dialog.</li>
 
@@ -60,13 +60,13 @@ To use \b Automatic sewing:
 
 <li>\b Detect button launches the algorithm of search of coincident
   free borders.</li>
-<li>The found groups of <b>Coincident Free Borders</b> are shown in a
-  list, a group per a line. Each group has its own color which is used
-  to display the borders of the group in the VTK Viewer. A free border
-  within a group is designated by IDs of its first, second and last
-  nodes within parenthesis. All borders present in the list will be
-  sewn upon \b Apply.</li>
-<li>\b Remove button removes selected groups from the list.</li>
+<li>The found groups of <b>Coincident Free Borders</b> are shown in the
+  list, one group per line. Each group has its own color, which is used
+  to display the group borders in the VTK Viewer. A free border
+  within a group is designated by the IDs of its first, second and
+  last nodes within parenthesis. All borders present in the list will
+  be sewn upon \b Apply. </li>
+<li>\b Remove button removes the selected groups from the list.</li>
 <li><b>Select All</b> check-box selects all groups in the list.</li>
 <li>When a group is selected, its borders appear in <b>Edit Selected
     Group</b> list that allows you to change this group.</li>
@@ -77,12 +77,12 @@ To use \b Automatic sewing:
   to this border during sewing.
 </li><li>
 \image html remove.png
-<em>Remove Border</em> button removes selected borders from the
+<em>Remove Border</em> button removes the selected borders from the
   group. It is active if there are more than two borders in the group.
 </li>
-<li>Selection of a border in the list allows to change its first and
+<li>Selection of a border in the list allows changing its first and
   last nodes whose IDs appear in two fields below the list. \a Arrow
-  buttons near each field move the corresponding end node by
+  buttons near each field move the corresponding end node by the
   number of nodes defined by \b Step field.</li>
 <li>
 \image html swap.png
@@ -92,7 +92,7 @@ To use \b Automatic sewing:
 </ul>
 
 For sewing free borders manually you should switch the \b Mode to \b
-Manual and define three points on each border: first, second and the
+Manual and define three points on each border: the first, the second and the
 last node:
 
 \image html sewing_manual.png
@@ -119,7 +119,7 @@ they coincide with the first and the last nodes of the other
 border. To cope with this,
 \ref merging_nodes_page "merge" coincident nodes into one
 beforehand. Two figures below illustrate this approach.
-\image html sew_using_merge.png "Merge coincident nodes which are difficult to distinguish"
+\image html sew_using_merge.png "Merge coincident nodes, which are difficult to distinguish"
 <br>
 \image html sew_after_merge.png "After merging nodes it is easy to specify border nodes"
 
index bf3a1f72e23a4180e163ca9407571d6cd1dfaede..cfe65fff5a46161b183718d1e5f361686354ad61 100755 (executable)
@@ -10,10 +10,10 @@ or edit mesh groups, remove elements from the mesh object, control
 mesh quality by different parameters, etc.
 
 Several filtering criteria can be combined together by using logical
-operators \a AND and \a OR. In addition, applied filter criterion can
+operators \a AND and \a OR. In addition, a filtering criterion can
 be reverted using logical operator \a NOT.
 
-Mesh filters use the functionality of mesh quality controls to filter
+Mesh filters can use the functionality of mesh quality controls to filter
 mesh nodes / elements by a specific characteristic (Area, Length, etc).
 
 This page provides a short description of the existing mesh filters,
@@ -416,9 +416,9 @@ entity type.
 
 \tui_script{filters_ex35.py}
 
-\section combining_filters How to combine filters with Criterion structures?
+\section combining_filters How to combine several criteria into a filter?
 
-Filters can be combined by making use of "criteria".
+Several criteria can be combined into a filter.
 
 Example :
 
index 6157618d6eb4e09006dedd0ed3b8c43bf8502135..ab6e7dd43c1fc2f40803cfa5d0fe7d1a6eb06eff 100644 (file)
@@ -87,6 +87,13 @@ module SMESH
      * Verify whether hypothesis supports given entity type 
      */
     boolean IsDimSupported( in Dimension type );
+
+    /*!
+     * Return true if a hypothesis has parameters.
+     *
+     * This method is intended for GUI to know if "Edit" menu item sould be available
+     */
+    boolean HasParameters();
   };
 
   typedef sequence<string> ListOfHypothesisName;
index 8c63fdbdab7dc8a9eb4e57da139fe1d08ef25781..b28fb1432a386c4ad5f2fba7e6bdde23cc96fb3e 100644 (file)
@@ -773,8 +773,9 @@ module SMESH
       SEW_DIFF_NB_OF_ELEMENTS,
       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
       SEW_BAD_SIDE1_NODES,
-      SEW_BAD_SIDE2_NODES
-      };
+      SEW_BAD_SIDE2_NODES,
+      SEW_INTERNAL_ERROR
+    };
 
     Sew_Error SewFreeBorders (in long FirstNodeID1,
                               in long SecondNodeID1,
index 769096df4344b7e69a9d61ac59e8d7d6d903b5f9..bc79e1fc70abe3bc8d254029b6c9ab20bdf0201e 100644 (file)
@@ -44,6 +44,7 @@
 #include <Geom_CylindricalSurface.hxx>
 #include <Geom_Plane.hxx>
 #include <Geom_Surface.hxx>
+#include <NCollection_Map.hxx>
 #include <Precision.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
@@ -174,7 +175,7 @@ namespace {
       n += q2 ^ q3;
     }
     double len = n.Modulus();
-    bool zeroLen = ( len <= numeric_limits<double>::min());
+    bool zeroLen = ( len <= std::numeric_limits<double>::min());
     if ( !zeroLen )
       n /= len;
 
@@ -311,12 +312,12 @@ double NumericalFunctor::Round( const double & aVal )
  */
 //================================================================================
 
-void NumericalFunctor::GetHistogram(int                  nbIntervals,
-                                    std::vector<int>&    nbEvents,
-                                    std::vector<double>& funValues,
-                                    const vector<int>&   elements,
-                                    const double*        minmax,
-                                    const bool           isLogarithmic)
+void NumericalFunctor::GetHistogram(int                     nbIntervals,
+                                    std::vector<int>&       nbEvents,
+                                    std::vector<double>&    funValues,
+                                    const std::vector<int>& elements,
+                                    const double*           minmax,
+                                    const bool              isLogarithmic)
 {
   if ( nbIntervals < 1 ||
        !myMesh ||
@@ -335,7 +336,7 @@ void NumericalFunctor::GetHistogram(int                  nbIntervals,
   }
   else
   {
-    vector<int>::const_iterator id = elements.begin();
+    std::vector<int>::const_iterator id = elements.begin();
     for ( ; id != elements.end(); ++id )
       values.insert( GetValue( *id ));
   }
@@ -521,148 +522,164 @@ double MaxElementLength3D::GetValue( long theElementId )
   if( GetPoints( theElementId, P ) ) {
     double aVal = 0;
     const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
-    SMDSAbs_ElementType aType = aElem->GetType();
+    SMDSAbs_EntityType      aType = aElem->GetEntityType();
     int len = P.size();
-    switch( aType ) {
-    case SMDSAbs_Volume:
-      if( len == 4 ) { // tetras
-        double L1 = getDistance(P( 1 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 1 ));
-        double L4 = getDistance(P( 1 ),P( 4 ));
-        double L5 = getDistance(P( 2 ),P( 4 ));
-        double L6 = getDistance(P( 3 ),P( 4 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        break;
-      }
-      else if( len == 5 ) { // pyramids
-        double L1 = getDistance(P( 1 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 4 ));
-        double L4 = getDistance(P( 4 ),P( 1 ));
-        double L5 = getDistance(P( 1 ),P( 5 ));
-        double L6 = getDistance(P( 2 ),P( 5 ));
-        double L7 = getDistance(P( 3 ),P( 5 ));
-        double L8 = getDistance(P( 4 ),P( 5 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        aVal = Max(aVal,Max(L7,L8));
-        break;
-      }
-      else if( len == 6 ) { // pentas
-        double L1 = getDistance(P( 1 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 1 ));
-        double L4 = getDistance(P( 4 ),P( 5 ));
-        double L5 = getDistance(P( 5 ),P( 6 ));
-        double L6 = getDistance(P( 6 ),P( 4 ));
-        double L7 = getDistance(P( 1 ),P( 4 ));
-        double L8 = getDistance(P( 2 ),P( 5 ));
-        double L9 = getDistance(P( 3 ),P( 6 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        aVal = Max(aVal,Max(Max(L7,L8),L9));
-        break;
-      }
-      else if( len == 8 ) { // hexas
-        double L1 = getDistance(P( 1 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 4 ));
-        double L4 = getDistance(P( 4 ),P( 1 ));
-        double L5 = getDistance(P( 5 ),P( 6 ));
-        double L6 = getDistance(P( 6 ),P( 7 ));
-        double L7 = getDistance(P( 7 ),P( 8 ));
-        double L8 = getDistance(P( 8 ),P( 5 ));
-        double L9 = getDistance(P( 1 ),P( 5 ));
-        double L10= getDistance(P( 2 ),P( 6 ));
-        double L11= getDistance(P( 3 ),P( 7 ));
-        double L12= getDistance(P( 4 ),P( 8 ));
-        double D1 = getDistance(P( 1 ),P( 7 ));
-        double D2 = getDistance(P( 2 ),P( 8 ));
-        double D3 = getDistance(P( 3 ),P( 5 ));
-        double D4 = getDistance(P( 4 ),P( 6 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
-        aVal = Max(aVal,Max(L11,L12));
-        aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
-        break;
-      }
-      else if( len == 12 ) { // hexagonal prism
-        for ( int i1 = 1; i1 < 12; ++i1 )
-          for ( int i2 = i1+1; i1 <= 12; ++i1 )
-            aVal = Max( aVal, getDistance(P( i1 ),P( i2 )));
-        break;
-      }
-      else if( len == 10 ) { // quadratic tetras
-        double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
-        double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
-        double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
-        double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        break;
-      }
-      else if( len == 13 ) { // quadratic pyramids
-        double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
-        double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
-        double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
-        double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
-        double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
-        double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        aVal = Max(aVal,Max(L7,L8));
-        break;
-      }
-      else if( len == 15 ) { // quadratic pentas
-        double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
-        double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
-        double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
-        double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
-        double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
-        double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
-        double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        aVal = Max(aVal,Max(Max(L7,L8),L9));
-        break;
-      }
-      else if( len == 20 || len == 27 ) { // quadratic hexas
-        double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
-        double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
-        double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
-        double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
-        double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
-        double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
-        double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
-        double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
-        double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
-        double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
-        double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
-        double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
-        double D1 = getDistance(P( 1 ),P( 7 ));
-        double D2 = getDistance(P( 2 ),P( 8 ));
-        double D3 = getDistance(P( 3 ),P( 5 ));
-        double D4 = getDistance(P( 4 ),P( 6 ));
-        aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
-        aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
-        aVal = Max(aVal,Max(L11,L12));
-        aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
-        break;
-      }
-      else if( len > 1 && aElem->IsPoly() ) { // polys
-        // get the maximum distance between all pairs of nodes
-        for( int i = 1; i <= len; i++ ) {
-          for( int j = 1; j <= len; j++ ) {
-            if( j > i ) { // optimization of the loop
-              double D = getDistance( P(i), P(j) );
-              aVal = Max( aVal, D );
-            }
+    switch ( aType ) {
+    case SMDSEntity_Tetra: { // tetras
+      double L1 = getDistance(P( 1 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 1 ));
+      double L4 = getDistance(P( 1 ),P( 4 ));
+      double L5 = getDistance(P( 2 ),P( 4 ));
+      double L6 = getDistance(P( 3 ),P( 4 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      break;
+    }
+    case SMDSEntity_Pyramid: { // pyramids
+      double L1 = getDistance(P( 1 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 4 ));
+      double L4 = getDistance(P( 4 ),P( 1 ));
+      double L5 = getDistance(P( 1 ),P( 5 ));
+      double L6 = getDistance(P( 2 ),P( 5 ));
+      double L7 = getDistance(P( 3 ),P( 5 ));
+      double L8 = getDistance(P( 4 ),P( 5 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      aVal = Max(aVal,Max(L7,L8));
+      break;
+    }
+    case SMDSEntity_Penta: { // pentas
+      double L1 = getDistance(P( 1 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 1 ));
+      double L4 = getDistance(P( 4 ),P( 5 ));
+      double L5 = getDistance(P( 5 ),P( 6 ));
+      double L6 = getDistance(P( 6 ),P( 4 ));
+      double L7 = getDistance(P( 1 ),P( 4 ));
+      double L8 = getDistance(P( 2 ),P( 5 ));
+      double L9 = getDistance(P( 3 ),P( 6 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      aVal = Max(aVal,Max(Max(L7,L8),L9));
+      break;
+    }
+    case SMDSEntity_Hexa: { // hexas
+      double L1 = getDistance(P( 1 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 4 ));
+      double L4 = getDistance(P( 4 ),P( 1 ));
+      double L5 = getDistance(P( 5 ),P( 6 ));
+      double L6 = getDistance(P( 6 ),P( 7 ));
+      double L7 = getDistance(P( 7 ),P( 8 ));
+      double L8 = getDistance(P( 8 ),P( 5 ));
+      double L9 = getDistance(P( 1 ),P( 5 ));
+      double L10= getDistance(P( 2 ),P( 6 ));
+      double L11= getDistance(P( 3 ),P( 7 ));
+      double L12= getDistance(P( 4 ),P( 8 ));
+      double D1 = getDistance(P( 1 ),P( 7 ));
+      double D2 = getDistance(P( 2 ),P( 8 ));
+      double D3 = getDistance(P( 3 ),P( 5 ));
+      double D4 = getDistance(P( 4 ),P( 6 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
+      aVal = Max(aVal,Max(L11,L12));
+      aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
+      break;
+    }
+    case SMDSEntity_Hexagonal_Prism: { // hexagonal prism
+      for ( int i1 = 1; i1 < 12; ++i1 )
+        for ( int i2 = i1+1; i1 <= 12; ++i1 )
+          aVal = Max( aVal, getDistance(P( i1 ),P( i2 )));
+      break;
+    }
+    case SMDSEntity_Quad_Tetra: { // quadratic tetras
+      double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
+      double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
+      double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
+      double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      break;
+    }
+    case SMDSEntity_Quad_Pyramid: { // quadratic pyramids
+      double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
+      double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
+      double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
+      double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
+      double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
+      double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      aVal = Max(aVal,Max(L7,L8));
+      break;
+    }
+    case SMDSEntity_Quad_Penta: { // quadratic pentas
+      double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
+      double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
+      double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
+      double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
+      double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
+      double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
+      double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      aVal = Max(aVal,Max(Max(L7,L8),L9));
+      break;
+    }
+    case SMDSEntity_Quad_Hexa:
+    case SMDSEntity_TriQuad_Hexa: { // quadratic hexas
+      double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
+      double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
+      double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
+      double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
+      double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
+      double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
+      double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
+      double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
+      double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
+      double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
+      double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
+      double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
+      double D1 = getDistance(P( 1 ),P( 7 ));
+      double D2 = getDistance(P( 2 ),P( 8 ));
+      double D3 = getDistance(P( 3 ),P( 5 ));
+      double D4 = getDistance(P( 4 ),P( 6 ));
+      aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
+      aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
+      aVal = Max(aVal,Max(L11,L12));
+      aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
+      break;
+    }
+    case SMDSEntity_Quad_Polyhedra:
+    case SMDSEntity_Polyhedra: { // polys
+      // get the maximum distance between all pairs of nodes
+      for( int i = 1; i <= len; i++ ) {
+        for( int j = 1; j <= len; j++ ) {
+          if( j > i ) { // optimization of the loop
+            double D = getDistance( P(i), P(j) );
+            aVal = Max( aVal, D );
           }
         }
       }
+      break;
     }
+    case SMDSEntity_Node:
+    case SMDSEntity_0D:
+    case SMDSEntity_Edge:
+    case SMDSEntity_Quad_Edge:
+    case SMDSEntity_Triangle:
+    case SMDSEntity_Quad_Triangle:
+    case SMDSEntity_BiQuad_Triangle:
+    case SMDSEntity_Quadrangle:
+    case SMDSEntity_Quad_Quadrangle:
+    case SMDSEntity_BiQuad_Quadrangle:
+    case SMDSEntity_Polygon:
+    case SMDSEntity_Quad_Polygon:
+    case SMDSEntity_Ball:
+    case SMDSEntity_Last: return 0;
+    } // switch ( aType )
 
     if( myPrecision >= 0 )
     {
@@ -701,7 +718,7 @@ double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
   aMin = getAngle(P( P.size() ), P( 1 ), P( 2 ));
   aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 )));
 
-  for ( int i = 2; i < P.size(); i++ )
+  for ( size_t i = 2; i < P.size(); i++ )
   {
     double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) );
     aMin = Min(aMin,A0);
@@ -1476,10 +1493,10 @@ double Area::GetValue( const TSequenceOfXYZ& P )
     gp_Vec aVec2( P(3) - P(1) );
     gp_Vec SumVec = aVec1 ^ aVec2;
 
-    for (int i=4; i<=P.size(); i++)
+    for (size_t i=4; i<=P.size(); i++)
     {
       gp_Vec aVec1( P(i-1) - P(1) );
-      gp_Vec aVec2( P(i) - P(1) );
+      gp_Vec aVec2( P(i  ) - P(1) );
       gp_Vec tmp = aVec1 ^ aVec2;
       SumVec.Add(tmp);
     }
@@ -2146,7 +2163,7 @@ bool BareBorderVolume::IsSatisfy(long theElementId )
       if ( myTool.IsFreeFace( iF ))
       {
         const SMDS_MeshNode** n = myTool.GetFaceNodes(iF);
-        vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF));
+        std::vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF));
         if ( !myMesh->FindElement( nodes, SMDSAbs_Face, /*Nomedium=*/false))
           return true;
       }
@@ -2285,15 +2302,15 @@ void CoincidentNodes::SetMesh( const SMDS_Mesh* theMesh )
     while ( nIt->more() )
       nodesToCheck.insert( nodesToCheck.end(), nIt->next() );
 
-    list< list< const SMDS_MeshNode*> > nodeGroups;
+    std::list< std::list< const SMDS_MeshNode*> > nodeGroups;
     SMESH_OctreeNode::FindCoincidentNodes ( nodesToCheck, &nodeGroups, myToler );
 
     myCoincidentIDs.Clear();
-    list< list< const SMDS_MeshNode*> >::iterator groupIt = nodeGroups.begin();
+    std::list< std::list< const SMDS_MeshNode*> >::iterator groupIt = nodeGroups.begin();
     for ( ; groupIt != nodeGroups.end(); ++groupIt )
     {
-      list< const SMDS_MeshNode*>& coincNodes = *groupIt;
-      list< const SMDS_MeshNode*>::iterator n = coincNodes.begin();
+      std::list< const SMDS_MeshNode*>& coincNodes = *groupIt;
+      std::list< const SMDS_MeshNode*>::iterator n = coincNodes.begin();
       for ( ; n != coincNodes.end(); ++n )
         myCoincidentIDs.Add( (*n)->GetID() );
     }
@@ -2325,7 +2342,7 @@ bool CoincidentElements::IsSatisfy( long theElementId )
   if ( const SMDS_MeshElement* e = myMesh->FindElement( theElementId ))
   {
     if ( e->GetType() != GetType() ) return false;
-    set< const SMDS_MeshNode* > elemNodes( e->begin_nodes(), e->end_nodes() );
+    std::set< const SMDS_MeshNode* > elemNodes( e->begin_nodes(), e->end_nodes() );
     const int nbNodes = e->NbNodes();
     SMDS_ElemIteratorPtr invIt = (*elemNodes.begin())->GetInverseElementIterator( GetType() );
     while ( invIt->more() )
@@ -2572,18 +2589,20 @@ bool FreeFaces::IsSatisfy( long theId )
   int nbNode = aFace->NbNodes();
 
   // collect volumes to check that number of volumes with count equal nbNode not less than 2
-  typedef map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters
-  typedef map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator
+  typedef std::map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters
+  typedef std::map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator
   TMapOfVolume mapOfVol;
 
   SMDS_ElemIteratorPtr nodeItr = aFace->nodesIterator();
-  while ( nodeItr->more() ) {
+  while ( nodeItr->more() )
+  {
     const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(nodeItr->next());
     if ( !aNode ) continue;
     SMDS_ElemIteratorPtr volItr = aNode->GetInverseElementIterator(SMDSAbs_Volume);
-    while ( volItr->more() ) {
+    while ( volItr->more() )
+    {
       SMDS_MeshElement* aVol = (SMDS_MeshElement*)volItr->next();
-      TItrMapOfVolume itr = mapOfVol.insert(make_pair(aVol, 0)).first;
+      TItrMapOfVolume    itr = mapOfVol.insert( std::make_pair( aVol, 0 )).first;
       (*itr).second++;
     } 
   }
@@ -2687,8 +2706,8 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh )
     return;
 
   // iterates on groups and find necessary elements ids
-  const std::set<SMESHDS_GroupBase*>& aGroups = aMesh->GetGroups();
-  set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
+  const std::set<SMESHDS_GroupBase*>&       aGroups = aMesh->GetGroups();
+  std::set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
   for (; GrIt != aGroups.end(); GrIt++)
   {
     SMESHDS_GroupBase* aGrp = (*GrIt);
@@ -2915,10 +2934,10 @@ void ConnectedElements::SetPoint( double x, double y, double z )
   // find myNodeID by myXYZ if possible
   if ( myMeshModifTracer.GetMesh() )
   {
-    auto_ptr<SMESH_ElementSearcher> searcher
+    SMESHUtils::Deleter<SMESH_ElementSearcher> searcher
       ( SMESH_MeshAlgos::GetElementSearcher( (SMDS_Mesh&) *myMeshModifTracer.GetMesh() ));
 
-    vector< const SMDS_MeshElement* > foundElems;
+    std::vector< const SMDS_MeshElement* > foundElems;
     searcher->FindElementsByPoint( gp_Pnt(x,y,z), SMDSAbs_All, foundElems );
 
     if ( !foundElems.empty() )
@@ -2944,7 +2963,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
     if ( !node0 )
       return false;
 
-    list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
+    std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
     std::set< int > checkedNodeIDs;
     // algo:
     // foreach node in nodeQueue:
@@ -2994,6 +3013,17 @@ bool ConnectedElements::IsSatisfy( long theElementId )
  */
 //================================================================================
 
+namespace
+{
+  inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos )
+  {
+    double dot = v1 * v2; // cos * |v1| * |v2|
+    double l1  = v1.SquareMagnitude();
+    double l2  = v2.SquareMagnitude();
+    return (( dot * cos >= 0 ) && 
+            ( dot * dot ) / l1 / l2 >= ( cos * cos ));
+  }
+}
 CoplanarFaces::CoplanarFaces()
   : myFaceID(0), myToler(0)
 {
@@ -3005,7 +3035,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
   {
     // Build a set of coplanar face ids
 
-    myCoplanarIDs.clear();
+    myCoplanarIDs.Clear();
 
     if ( !myMeshModifTracer.GetMesh() || !myFaceID || !myToler )
       return;
@@ -3019,11 +3049,11 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
     if (!normOK)
       return;
 
-    const double radianTol = myToler * M_PI / 180.;
-    std::set< SMESH_TLink > checkedLinks;
+    const double cosTol = Cos( myToler * M_PI / 180. );
+    NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks;
 
-    std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
-    faceQueue.push_back( make_pair( face, myNorm ));
+    std::list< std::pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
+    faceQueue.push_back( std::make_pair( face, myNorm ));
     while ( !faceQueue.empty() )
     {
       face   = faceQueue.front().first;
@@ -3034,7 +3064,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
       {
         const SMDS_MeshNode*  n1 = face->GetNode( i );
         const SMDS_MeshNode*  n2 = face->GetNode(( i+1 )%nbN);
-        if ( !checkedLinks.insert( SMESH_TLink( n1, n2 )).second )
+        if ( !checkedLinks.Add( SMESH_TLink( n1, n2 )))
           continue;
         SMDS_ElemIteratorPtr fIt = n1->GetInverseElementIterator(SMDSAbs_Face);
         while ( fIt->more() )
@@ -3043,10 +3073,10 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
           if ( f->GetNodeIndex( n2 ) > -1 )
           {
             gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
-            if (!normOK || myNorm.Angle( norm ) <= radianTol)
+            if (!normOK || isLessAngle( myNorm, norm, cosTol))
             {
-              myCoplanarIDs.insert( f->GetID() );
-              faceQueue.push_back( make_pair( f, norm ));
+              myCoplanarIDs.Add( f->GetID() );
+              faceQueue.push_back( std::make_pair( f, norm ));
             }
           }
         }
@@ -3056,7 +3086,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
 }
 bool CoplanarFaces::IsSatisfy( long theElementId )
 {
-  return myCoplanarIDs.count( theElementId );
+  return myCoplanarIDs.Contains( theElementId );
 }
 
 /*
@@ -3184,14 +3214,13 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr )
   myIds.Clear();
 
   TCollection_AsciiString aStr = theStr;
-  //aStr.RemoveAll( ' ' );
-  //aStr.RemoveAll( '\t' );
   for ( int i = 1; i <= aStr.Length(); ++i )
-    if ( isspace( aStr.Value( i )))
-      aStr.SetValue( i, ',');
-
-  for ( int aPos = aStr.Search( ",," ); aPos != -1; aPos = aStr.Search( ",," ) )
-    aStr.Remove( aPos, 1 );
+  {
+    char c = aStr.Value( i );
+    if ( !isdigit( c ) && c != ',' && c != '-' )
+      aStr.SetValue( i, ' ');
+  }
+  aStr.RemoveAll( ' ' );
 
   TCollection_AsciiString tmpStr = aStr.Token( ",", 1 );
   int i = 1;
@@ -3667,7 +3696,7 @@ bool ManifoldPart::process()
       myMapIds.Add( aFaceId );
     }
 
-    if ( fi == ( myAllFacePtr.size() - 1 ) )
+    if ( fi == int( myAllFacePtr.size() - 1 ))
       fi = 0;
   } // end run on vector of faces
   return !myMapIds.IsEmpty();
@@ -4458,6 +4487,7 @@ bool BelongToGeom::IsSatisfy (long theId)
       case SMDS_TOP_FACE   : return ( IsContains( myMeshDS,myShape,aNode,TopAbs_FACE ));
       case SMDS_TOP_3DSPACE: return ( IsContains( myMeshDS,myShape,aNode,TopAbs_SOLID ) ||
                                       IsContains( myMeshDS,myShape,aNode,TopAbs_SHELL ));
+      default:;
       }
     }
   }
@@ -4483,6 +4513,7 @@ bool BelongToGeom::IsSatisfy (long theId)
         case SMDSAbs_Face  : return ( IsContains( myMeshDS,myShape,anElem,TopAbs_FACE ));
         case SMDSAbs_Volume: return ( IsContains( myMeshDS,myShape,anElem,TopAbs_SOLID )||
                                       IsContains( myMeshDS,myShape,anElem,TopAbs_SHELL ));
+        default:;
         }
       }
     }
index 8a2ff7e245becdcf4147fa98c3ce0dc4c98cb65f..c7398b0ef4d0364f7d49480b2e8e5aa3924a85f7 100644 (file)
@@ -1088,7 +1088,7 @@ namespace SMESH{
       TMeshModifTracer     myMeshModifTracer;
       long                 myFaceID;
       double               myToler;
-      std::set< long >     myCoplanarIDs;
+      TColStd_MapOfInteger myCoplanarIDs;
     };
     typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
 
index cf4709edbdbc27d9adbe8c1656e5a1c2412a5f38..4393e471c2f72361e7ecc3880a5f251fcb8e2d4c 100644 (file)
@@ -234,7 +234,7 @@ namespace
         dist2 = ( nn1[1] - nn2[1] ).Modulus();
         tol   = 1e-5 * ( nn1[0] - nn1[1] ).Modulus();
       }
-      return ( dist1 < tol & dist2 < tol );
+      return ( dist1 < tol && dist2 < tol );
     }
     return false;
   }
@@ -451,7 +451,7 @@ namespace
     if ( !_nodeReplacementMap.empty() )
     {
       map< int, int >::const_iterator it, end = _nodeReplacementMap.end();
-      for ( size_t i = 0; i < nbIds; ++i )
+      for ( int i = 0; i < nbIds; ++i )
         if (( it = _nodeReplacementMap.find( ids[i] + idShift)) != end )
           ids[i] = it->second;
         else
@@ -459,7 +459,7 @@ namespace
     }
     else if ( idShift )
     {
-      for ( size_t i = 0; i < nbIds; ++i )
+      for ( int i = 0; i < nbIds; ++i )
         ids[i] += idShift;
     }
   }
@@ -1022,7 +1022,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform()
           if ( zone.IsStructured() )
           {
             int axis = 0; // axis perpendiculaire to which boundary elements are oriented
-            if ( ids.size() >= meshDim * 2 )
+            if ( (int) ids.size() >= meshDim * 2 )
             {
               for ( ; axis < meshDim; ++axis )
                 if ( ids[axis] - ids[axis+meshDim] == 0 )
@@ -1127,7 +1127,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform()
 
             if ( psType == CGNS_ENUMV( PointRange ) && ids.size() == 2 )
             {
-              for ( size_t i = ids[0]; i <= ids[1]; ++i )
+              for ( cgsize_t i = ids[0]; i <= ids[1]; ++i )
                 if ( const SMDS_MeshElement* e = myMesh->FindElement( i ))
                   groupDS.Add( e );
             }
index c918eb0d355f35bce56baa317a15506553d6ec4e..5dee87177794b9ddb04723c4f49215d18a2d6ff4 100644 (file)
@@ -407,7 +407,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
   {
     // get ids of existing groups
     std::set< int > groupIDs;
-    const std::set<SMESHDS_GroupBase*>& groups = myMesh->GetGroups();
+    const std::set<SMESHDS_GroupBase*>&          groups = myMesh->GetGroups();
     std::set<SMESHDS_GroupBase*>::const_iterator grIter = groups.begin();
     for ( ; grIter != groups.end(); ++grIter )
       groupIDs.insert( (*grIter)->GetID() );
index 158eea06760e45717a5bda9b7204e77f5be4dcf1..5beadcd1797e55f3d144d7e5c36a2dc172b31fae 100644 (file)
@@ -70,9 +70,9 @@ extern "C"
   elem->getshapeId() );                         \
   }}
 
-#define END_ELEM_WRITE_ADD_TO_MAP( elem, e2id )         \
-  elem->getshapeId() );                                 \
-  e2id.insert( e2id.end(), make_pair( elem, gmfID ));   \
+#define END_ELEM_WRITE_ADD_TO_MAP( elem, e2id )            \
+  elem->getshapeId() );                                    \
+  e2id.insert( e2id.end(), std::make_pair( elem, gmfID )); \
   }}
 
 #define END_EXTRA_VERTICES_WRITE()           \
@@ -145,7 +145,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
     const SMDS_MeshNode* n = nodeIt->next();
     n->GetXYZ( xyz );
     GmfSetLin( meshID, GmfVertices, xyz[0], xyz[1], xyz[2], n->getshapeId() );
-    node2IdMap.insert( node2IdMap.end(), make_pair( n, ++iN ));
+    node2IdMap.insert( node2IdMap.end(), std::make_pair( n, ++iN ));
   }
   if ( iN != nbNodes )
     return addMessage("Wrong nb of nodes returned by nodesIterator", /*fatal=*/true);
@@ -296,19 +296,19 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
       SMDSAbs_EntityType smdsEntity;
       std::string entity = groupName.substr( pos + strlen("_required_"));
       if      ( entity == "Vertices" ) {
-        gmfKwd   = GmfRequiredVertices;
+        gmfKwd     = GmfRequiredVertices;
         smdsEntity = SMDSEntity_Node;
       }
       else if ( entity == "Edges" ) {
-        gmfKwd   = GmfRequiredEdges;
+        gmfKwd     = GmfRequiredEdges;
         smdsEntity = SMDSEntity_Edge;
       }
       else if ( entity == "Triangles" ) {
-        gmfKwd   = GmfRequiredTriangles;
+        gmfKwd     = GmfRequiredTriangles;
         smdsEntity = SMDSEntity_Triangle;
       }
       else if ( entity == "Quadrilaterals" ) {
-        gmfKwd   = GmfRequiredQuadrilaterals;
+        gmfKwd     = GmfRequiredQuadrilaterals;
         smdsEntity = SMDSEntity_Quadrangle;
       }
       else {
@@ -330,11 +330,11 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
 
       // choose a TElem2IDMap
       TElem2IDMap* elem2IDMap = 0;
-      if ( smdsEntity == SMDSEntity_Quadrangle && nbOkElems != myMesh->NbFaces() )
+      if ( smdsEntity == SMDSEntity_Quadrangle    && nbOkElems != myMesh->NbFaces() )
         elem2IDMap = & quad2IDMap;
       else if ( smdsEntity == SMDSEntity_Triangle && nbOkElems != myMesh->NbFaces() )
         elem2IDMap = & tria2IDMap;
-      else if ( smdsEntity == SMDSEntity_Edge && nbOkElems != myMesh->NbEdges() )
+      else if ( smdsEntity == SMDSEntity_Edge     && nbOkElems != myMesh->NbEdges() )
         elem2IDMap = & edge2IDMap;
 
       // write the group
index ba851616c2851908b1dc7c075d991668fad55a39..58f9c0ca024bcb095ba5b5b63407b84149060769 100644 (file)
@@ -172,7 +172,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
       //------------------------------------------------------
       PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
       if (!aNodeInfo) {
-        aResult = DRS_FAIL;
+        aResult = addMessage("No nodes", /*isFatal=*/true );
         continue;
       }
       aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false
@@ -365,9 +365,9 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
                 }
 #ifndef _DEXCEPT_
               } catch(const std::exception& exc) {
-                aResult = DRS_FAIL;
+                aResult = addMessage( exc.what(), /*isFatal=*/true );
               } catch (...) {
-                aResult = DRS_FAIL;
+                aResult = addMessage( "Unknown exception", /*isFatal=*/true );
               }
 #endif
               if ( !anElement ) {
@@ -500,7 +500,8 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
             default:;
             }
             vector<TInt> aNodeIds(aNbNodes);
-            for(int iElem = 0; iElem < aNbElems; iElem++){
+            for ( int iElem = 0; iElem < aNbElems; iElem++ )
+            {
               bool anIsValidConnect = false;
               TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
 #ifndef _DEXCEPT_
@@ -521,10 +522,10 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
 #ifndef _DEXCEPT_
               }catch(const std::exception& exc){
                 INFOS("Following exception was caught:\n\t"<<exc.what());
-                aResult = DRS_FAIL;
+                aResult = addMessage( exc.what(), /*isFatal=*/true );
               }catch(...){
                 INFOS("Unknown exception was caught !!!");
-                aResult = DRS_FAIL;
+                aResult = addMessage( "Unknown exception", /*isFatal=*/true );
               }
 #endif          
               if(!anIsValidConnect)
@@ -950,17 +951,19 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
                   }
                   break;
 
+                default:;
+
                 } // switch(aGeom)
 
 #ifndef _DEXCEPT_
-              }catch(const std::exception& exc){
+              } catch(const std::exception& exc) {
                 INFOS("The following exception was caught:\n\t"<<exc.what());
-                aResult = DRS_FAIL;
-              }catch(...){
+                aResult = addMessage( exc.what(), /*isFatal=*/true );
+              } catch(...) {
                 INFOS("Unknown exception was caught !!!");
-                aResult = DRS_FAIL;
+                aResult = addMessage( "Unknown exception", /*isFatal=*/true );
               }
-#endif          
+#endif
               if (!anElement) {
                 aResult = DRS_WARN_SKIP_ELEM;
               }
@@ -977,23 +980,25 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
                   myFamilies[aFamNum]->SetType(anElement->GetType());
                 }
               }
-            }
-          }}
-        }
-      }
+            } // loop on aNbElems
+          }} // switch(aGeom)
+        } // loop on aGeom2Size
+      } // loop on aEntityInfo
+
       if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483
+
     } // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++)
 #ifndef _DEXCEPT_
   }
   catch(const std::exception& exc)
   {
     INFOS("The following exception was caught:\n\t"<<exc.what());
-    aResult = DRS_FAIL;
+    aResult = addMessage( exc.what(), /*isFatal=*/true );
   }
   catch(...)
   {
     INFOS("Unknown exception was caught !!!");
-    aResult = DRS_FAIL;
+    aResult = addMessage( "Unknown exception", /*isFatal=*/true );
   }
 #endif
   if (myMesh)
index 71082464c27dc547bd3fd487494adf3648cca0b3..5fa6a6317b9cdd32999d5ffacdf1a63a1a6daa4c 100644 (file)
@@ -95,7 +95,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh *      mesh,
   if ( _nbElemsByGeom.empty() || _elemType != type )
   {
     _elemType = type;
-    _nbElemsByGeom.resize( 1, make_pair( SMDSEntity_Last, 0 ));
+    _nbElemsByGeom.resize( 1, std::make_pair( SMDSEntity_Last, 0 ));
 
     // count nb of elems of each geometry
     for ( int iG = 0; iG < SMDSEntity_Last; ++iG )
@@ -107,7 +107,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh *      mesh,
       nbElems = mesh->GetMeshInfo().NbElements( geom );
       if ( nbElems < 1 ) continue;
 
-      _nbElemsByGeom.push_back( make_pair( geom, nbElems + _nbElemsByGeom.back().second ));
+      _nbElemsByGeom.push_back( std::make_pair( geom, nbElems + _nbElemsByGeom.back().second ));
     }
     // add nodes of missing 0D elements on VERTEXes
     if ( _addODOnVertices && _elemType == SMDSAbs_0DElement )
@@ -118,8 +118,8 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh *      mesh,
       if ( !nodes.empty() )
       {
         if ( _nbElemsByGeom.size() == 1 )
-          _nbElemsByGeom.push_back( make_pair( SMDSEntity_0D, 0));
-        _nbElemsByGeom.push_back( make_pair( SMDSEntity_Node,
+          _nbElemsByGeom.push_back( std::make_pair( SMDSEntity_0D, 0));
+        _nbElemsByGeom.push_back( std::make_pair( SMDSEntity_Node,
                                              nodes.size() + _nbElemsByGeom.back().second ));
       }
     }
@@ -168,7 +168,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh *      mesh,
 
 void DriverMED_W_Field::SetCompName(const int iComp, const char* name)
 {
-  if ( _compNames.size() <= iComp )
+  if ( (int)_compNames.size() <= iComp )
     _compNames.resize( iComp + 1 );
   _compNames[ iComp ] = name;
 }
@@ -314,7 +314,7 @@ Driver_Mesh::Status DriverMED_W_Field::Perform()
     SMDSAbs_EntityType    smdsType = _nbElemsByGeom[iG].first;
     MED::EGeometrieElement medType = (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
     int                    nbElems = _nbElemsByGeom[iG].second - _nbElemsByGeom[iG-1].second;
-    type2nb.insert( make_pair( medType, nbElems ));
+    type2nb.insert( std::make_pair( medType, nbElems ));
   }
 
   MED::EEntiteMaillage       entity = ( _elemType == SMDSAbs_Node ? MED::eNOEUD : MED::eMAILLE );
@@ -327,7 +327,7 @@ Driver_Mesh::Status DriverMED_W_Field::Perform()
   MED::PIntTimeStampValue   timeStampIntVal = timeStampVal;
 
   // set values
-  int iVal = 0, i, nbE;
+  int iVal = 0;
   MED::TFloat* ptrDbl = 0;
   MED::TInt*   ptrInt = 0;
   for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG )
@@ -354,6 +354,8 @@ Driver_Mesh::Status DriverMED_W_Field::Perform()
 
   _dblValues.clear();
   _intValues.clear();
+
+  return DRS_OK;
 }
 
 namespace DriverMED // Implemetation of fuctions declared in DriverMED.hxx
index b4ab8dbe401b4a8caf9d5649d61359ea9f110ea3..cee3e1b09f1c43971dcb4bb3d52128c11cce9b4a 100644 (file)
@@ -525,7 +525,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
     const SMDS_MeshInfo& nbElemInfo = myMesh->GetMeshInfo();
 
     // poly elements are not supported by med-2.1
-    bool polyTypesSupported = myMed->CrPolygoneInfo(aMeshInfo,eMAILLE,ePOLYGONE,0,0);
+    bool polyTypesSupported = ( myMed->CrPolygoneInfo(aMeshInfo,eMAILLE,ePOLYGONE,0,0).get() != 0 );
     TInt nbPolygonNodes = 0, nbPolyhedronNodes = 0, nbPolyhedronFaces = 0;
 
     // nodes on VERTEXes where 0D elements are absent
index 95d6a2ff1cb4d6bd6c7e05bedb8e6682c5d167fe..f72df42cfc4b7233cece4253123d25a031e88292 100644 (file)
@@ -435,6 +435,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
               const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
               if (aElement) {
                 switch (aElement->GetType()) {
+
                 case SMDSAbs_Edge:
                   if (!aEdgesGroup) {
                     aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
@@ -449,6 +450,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
                   }
                   aEdgesGroup->Add(aElement);
                   break;
+
                 case SMDSAbs_Face:
                   if (!aFacesGroup) {
                     aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
@@ -463,6 +465,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
                   }
                   aFacesGroup->Add(aElement);
                   break;
+
                 case SMDSAbs_Volume:
                   if (!aVolumeGroup) {
                     aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
@@ -477,6 +480,8 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
                   }
                   aVolumeGroup->Add(aElement);
                   break;
+
+                default:;
                 }
               } 
             }
index 243d9f350a8782ee84666f627c1ae719beaf8b3c..5aa64330ac6867cb50f93cdce16f4dec323aaecd 100644 (file)
@@ -183,7 +183,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
             aRec.fe_descriptor_id = anId;
             aRec.node_labels.reserve(aNbNodes);
             SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
-            while ( aNodesIter->more() && aRec.node_labels.size() < aNbNodes )
+            while ( aNodesIter->more() && (int)aRec.node_labels.size() < aNbNodes )
             {
               const SMDS_MeshElement* aNode = aNodesIter->next();
               aRec.node_labels.push_back(aNode->GetID());
index 413ccfa5a254d4c23c0bbfd99c0dd174b13abdda..28ebcd17fede540c129cdd7c4dc8de50050f5e8a 100644 (file)
@@ -93,17 +93,17 @@ namespace UNV{
    */
   inline double D_to_e(std::string& number)
   {
-    /* find "D" in string, start looking at 
+    /* find "D" in string, start looking at
      * 6th element, to improve speed.
      * We dont expect a "D" earlier
      */
-    const int position = number.find("D",6);
-    if(position != std::string::npos){
-      number.replace(position, 1, "e"); 
-    }
+    const size_t position = number.find("D",6);
+    if ( position != std::string::npos )
+      number.replace(position, 1, "e");
+
     return atof (number.c_str());
   }
-  
+
   /**
    * @returns \p false when file is incorrect, \p true otherwise.
    * Check file with name \p theFileName for correct terminate
index 3bb54574e402c2106f117aae1986d71e1b00bb22..f4108be584cd1a671031c1d2b4def94335926624 100644 (file)
@@ -25,6 +25,7 @@
 #include "MED_V2_2_Wrapper.hxx"
 
 #include <stdio.h>
+#include <errno.h>
 #include <sstream>
 
 #include <med.h>
@@ -53,7 +54,7 @@ namespace MED
 #ifndef WIN32
     if (access(theFileName.c_str(),F_OK))
       return aVersion;
-    if(theDoPreCheckInSeparateProcess){
+    if ( theDoPreCheckInSeparateProcess ) {
       // First check, is it possible to deal with the file
       std::ostringstream aStr;
       // File name is in quotes for the case of space(s) inside it (PAL13009)
@@ -64,8 +65,9 @@ namespace MED
       std::string aCommand = aStr.str();
       int aStatus = system(aCommand.c_str());
 
-      BEGMSG(MYDEBUG,"aCommand = '"<<aCommand<<"'; aStatus = "<<aStatus<<std::endl);
-      if(aStatus != 0)
+      BEGMSG( MYDEBUG,"aCommand = '" << aCommand << "'; aStatus = " << aStatus
+             << "; errno = " << errno << " = " << strerror( errno ) << std::endl );
+      if ( aStatus != 0 && errno != EAGAIN && errno != ENOMEM ) // "Cannot allocate memory" is OK
         return aVersion;
     }
 #endif
index 1c9af415d5b13b7b52435b590c1e1d92b1f71808..bdd94da6b30d6b0bc391cbab6bbbc3d01de2b01f 100644 (file)
@@ -1707,13 +1707,14 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
   my0DActor->SetRepresentation(aReperesent);
   myBallActor->SetRepresentation(aReperesent);
 
-  switch(myControlMode){
+  switch ( myControlMode ) {
   case eLength:
   case eMultiConnection:
     aProp = aBackProp = my1DProp;
     if(myRepresentation != ePoint)
       aReperesent = SMESH_DeviceActor::eInsideframe;
     break;
+  default:;
   }
 
   if(aQuadraticMode == SMESH_Actor::eLines)
@@ -2253,7 +2254,7 @@ vtkPlane*
 SMESH_ActorDef::
 GetClippingPlane(vtkIdType theID)
 {
-  if(theID >= myCippingPlaneCont.size())
+  if ( theID >= (vtkIdType)myCippingPlaneCont.size() )
     return NULL;
   return myCippingPlaneCont[theID].Get();
 }
@@ -2487,7 +2488,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() {
     bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
     fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic);
 
-    for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
+    for ( size_t i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
       my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast<double>(nbEvents[i]));
 
     if(funValues.size() >= 2)
index 87a7c84017af611678139273700022fc95b8f12b..9d8e4f3f3eb675a096ba3a57cef25d8287d47677 100644 (file)
@@ -37,7 +37,7 @@ namespace SMESH
   enum LabelFont { 
     FntArial,    //!< arial font family
     FntCourier,  //!< courier font family
-    FntTimes,    //!< times font family
+    FntTimes     //!< times font family
   };
 
 SMESHOBJECT_EXPORT  
index cf64055548d061995597599ddb4dd94a79305c8e..aeba34ad97d1ed7c87277dc2227842e659864a2d 100644 (file)
@@ -297,7 +297,7 @@ SMESH_DeviceActor
                  SMESH_ScalarBarActor* theScalarBarActor,
                  vtkLookupTable* theLookupTable)
 {
-  bool anIsInitialized = theFunctor;
+  bool anIsInitialized = theFunctor != NULL;
   if(anIsInitialized){
     vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New();
 
@@ -363,7 +363,7 @@ SMESH_DeviceActor
                     SMESH_ScalarBarActor* theScalarBarActor,
                     vtkLookupTable* theLookupTable)
 {
-  bool anIsInitialized = theFunctor;
+  bool anIsInitialized = theFunctor != NULL;
   myExtractUnstructuredGrid->ClearRegisteredCells();
   myExtractUnstructuredGrid->ClearRegisteredCellsWithType();
   myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
index b3ff7d74bd630b151851c9b49d1328db5e190d08..d966097193c7b73f5f2a8e69c3b2bbf45cef1363 100644 (file)
@@ -60,14 +60,14 @@ SMESH_ExtractGeometry::~SMESH_ExtractGeometry()
 
 vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID)
 {
-  if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1;
+  if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1;
   return myElemVTK2ObjIds[theVtkID];
 }
 
 
 vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID)
 {
-  if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1;
+  if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1;
   return myNodeVTK2ObjIds[theVtkID];
 }
 
index d82962cb9553341b1df2cbaac31906bdb2306316..56118211441c46d067c77361641719506ec2b32c 100644 (file)
@@ -320,7 +320,7 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
 
     // rnv begin
     // Customization of the vtkScalarBarActor to show distribution histogram.
-    bool distrVisibility =  (numColors == this->myNbValues.size());
+    bool distrVisibility =  (numColors == (int)this->myNbValues.size());
     vtkPoints *distrPts;
     vtkCellArray *distrPolys;
     vtkUnsignedCharArray *distColors = 0;
@@ -328,12 +328,12 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     if(!distrVisibility)
       vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()");
 
-    if (distrVisibility && GetDistributionVisibility()) {
-      for( i=0 ;i<myNbValues.size();i++ ) {
-        if(myNbValues[i]) {
+    if ( distrVisibility && GetDistributionVisibility() ) {
+      for ( i = 0 ; i < (int)myNbValues.size(); i++ ) {
+        if ( myNbValues[i] ) {
           numPositiveVal++;
           maxValue = std::max(maxValue,myNbValues[i]);
-        } 
+        }
       }
       numDistrPts = 4*(numPositiveVal);
       distrPts = vtkPoints::New();
@@ -820,7 +820,7 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize,
     int targetWidth, targetHeight;
     // rnv begin
     // Customization of the vtkScalarBarActor to show distribution histogram.
-    bool distrVisibility = this->MaximumNumberOfColors == this->myNbValues.size();
+    bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() );
     double coef;
     if( GetDistributionVisibility() && distrVisibility )
       if(this->Orientation == VTK_ORIENT_VERTICAL)
@@ -856,40 +856,39 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize,
 }
 
 //----------------------------------------------------------------------------
-void SMESH_ScalarBarActor::SizeTitle(int *titleSize, 
-                                  int *size, 
-                                  vtkViewport *viewport)
+void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
+                                     int *size,
+                                     vtkViewport *viewport)
 {
   titleSize[0] = titleSize[1] = 0;
 
   if (this->Title == NULL || !strlen(this->Title))
-    {
+  {
     return;
-    }
+  }
 
   int targetWidth, targetHeight;
-  
+
   targetWidth = size[0];
   // rnv begin
   // Customization of the vtkScalarBarActor to show distribution histogram.
-  bool distrVisibility =  this->MaximumNumberOfColors == this->myNbValues.size();
+  bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() );
   double coef;
-  if( GetDistributionVisibility() && distrVisibility ) 
+  if ( GetDistributionVisibility() && distrVisibility )
     coef=0.18;
-  else 
+  else
     coef=0.25;
 
   if ( this->Orientation == VTK_ORIENT_VERTICAL )
-    {
-      targetHeight = (int)(0.1*size[1]);
-    }
+  {
+    targetHeight = (int)(0.1*size[1]);
+  }
   else
-    {
-      targetHeight = (int)(coef*size[1]);
-    }
+  {
+    targetHeight = (int)(coef*size[1]);
+  }
 
-  this->TitleMapper->SetConstrainedFontSize(
-    viewport, targetWidth, targetHeight);
+  this->TitleMapper->SetConstrainedFontSize(viewport, targetWidth, targetHeight);
 
   this->TitleMapper->GetSize(viewport, titleSize);
 }
index 6bcd2fb5a1097d1c8b7215d05b674c23a0e63e01..77546227f5b99dbca90cd7704d1657eaf1b420a7 100644 (file)
@@ -122,7 +122,7 @@ class SMESHOBJECT_EXPORT SMESH_ScalarBarActor: public vtkActor2D {
   // Set/Get the maximum number of scalar bar segments to show. This may
   // differ from the number of colors in the lookup table, in which case
   // the colors are samples from the lookup table.
-  vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
+  vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_INT_MAX);
   vtkGetMacro(MaximumNumberOfColors, int);
   
   // Description:
index 03151a6405b4420d3df7b491b9ff234e8acb4b48..9faf99ec3efda40548f27b713f64d4b3f6553a32 100644 (file)
 #include <SalomeApp_Application.h>
 #include <SUIT_Session.h>
 
-#include <SALOME_ListIO.hxx>
-#include <GEOM_Client.hxx>
-#include <SMESHGUI_Utils.h>
-#include <boost/shared_ptr.hpp>
 #include <GEOMImpl_Types.hxx>
+#include <GEOM_Client.hxx>
 #include <GEOM_wrap.hxx>
+#include <SALOME_ListIO.hxx>
+#include <SMESHGUI_Utils.h>
 
-#include <TopoDS.hxx>
-#include <BRep_Tool.hxx>
-#include <Handle_Geom_Surface.hxx>
 #include <BRepAdaptor_Surface.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Iterator.hxx>
 
 #include "utilities.h"
 
@@ -237,6 +235,12 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){
 //             MESSAGE("GEOM client is OK and GEOM engine is not null");
             S = aClient->GetShape( _geomEngine, aShape );
             ShapeType=S.ShapeType();
+            if ( ShapeType == TopAbs_COMPOUND )
+            {
+              TopoDS_Iterator it( S );
+              if ( it.More() )
+                ShapeType = it.Value().ShapeType();
+            }
           }
         }
       }
@@ -275,7 +279,6 @@ GeomAbs_SurfaceType GeomSelectionTools::getFaceInformation(TopoDS_Shape S)
   GeomAbs_SurfaceType surf_type=GeomAbs_OtherSurface ;
   if (!S.IsNull() &&  S.ShapeType()==TopAbs_FACE){
     TopoDS_Face f=TopoDS::Face(S);
-    Handle(Geom_Surface) surf = BRep_Tool::Surface(f);
     BRepAdaptor_Surface surf_adap(f);
 
     /* Global Information */
index d6049c0bd198a319d4a3b15bc20e35fb38d4570b..257ab88ddc0a2380006acb9ea5ee2235bf9ce683 100644 (file)
@@ -217,13 +217,13 @@ void SMDS_Down1D::initCell(int cellId)
  */
 void SMDS_Down1D::allocate(int nbElems)
 {
-  if (nbElems >= _vtkCellIds.size())
-    {
-      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
-      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
-      _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
-    }
+  if (nbElems >= (int)_vtkCellIds.size())
+  {
+    _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
+    _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
+    _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
+  }
 }
 
 void SMDS_Down1D::compactStorage()
@@ -239,15 +239,15 @@ void SMDS_Down1D::compactStorage()
   _upCellIndex.resize(_maxId + 1, -1); // id and types of rank i correspond to [ _upCellIndex[i], _upCellIndex[i+1] [
   int current = 0;
   for (int i = 0; i < _maxId; i++)
+  {
+    _upCellIndex[i] = current;
+    for (size_t j = 0; j < _upCellIdsVector[i].size(); j++)
     {
-      _upCellIndex[i] = current;
-      for (int j = 0; j < _upCellIdsVector[i].size(); j++)
-        {
-          _upCellIds[current] = _upCellIdsVector[i][j];
-          _upCellTypes[current] = _upCellTypesVector[i][j];
-          current++;
-        }
+      _upCellIds[current] = _upCellIdsVector[i][j];
+      _upCellTypes[current] = _upCellTypesVector[i][j];
+      current++;
     }
+  }
   _upCellIndex[_maxId] = current;
 
   _upCellIdsVector.clear();
@@ -674,14 +674,14 @@ bool SMDS_Down2D::isInFace(int cellId, int *pts, int npts)
  */
 void SMDS_Down2D::allocate(int nbElems)
 {
-  if (nbElems >= _vtkCellIds.size())
-    {
-      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
-      _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
-    }
+  if (nbElems >= (int)_vtkCellIds.size())
+  {
+    _cellIds.resize    (_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _vtkCellIds.resize (nbElems + SMDS_Mesh::chunkSize, -1);
+    _upCellIds.resize  (2 * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _tempNodes.resize  (_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
+  }
 }
 
 void SMDS_Down2D::compactStorage()
@@ -764,11 +764,11 @@ SMDS_Down3D::~SMDS_Down3D()
 
 void SMDS_Down3D::allocate(int nbElems)
 {
-  if (nbElems >= _vtkCellIds.size())
-    {
-      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
-    }
+  if (nbElems >= (int)_vtkCellIds.size())
+  {
+    _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
+  }
 }
 
 void SMDS_Down3D::compactStorage()
@@ -1121,7 +1121,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1131,19 +1131,19 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
 
   set<int> tofind;
   int ids[12] = { 0, 1, 2,  0, 3, 1,  2, 3, 0,   1, 3, 2 };
-//int ids[12] = { 2, 1, 0,  1, 3, 0,  0, 3, 2,   2, 3, 1 };
+  //int ids[12] = { 2, 1, 0,  1, 3, 0,  0, 3, 2,   2, 3, 1 };
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 3; i++)
+      tofind.insert(nodes[ids[3 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 3; i++)
-        tofind.insert(nodes[ids[3 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 3; i++)
-            orderedNodes[i] = nodes[ids[3 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[3 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -1229,7 +1229,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1239,19 +1239,19 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
 
   set<int> tofind;
   int ids[24] = { 0, 1, 2, 4, 5, 6,  0, 3, 1, 7, 8, 4,  2, 3, 0, 9, 7, 6,  1, 3, 2, 8, 9, 5 };
-//int ids[24] = { 2, 1, 0, 5, 4, 6,  1, 3, 0, 8, 7, 4,  0, 3, 2, 7, 9, 6,  2, 3, 1, 9, 8, 5 };
+  //int ids[24] = { 2, 1, 0, 5, 4, 6,  1, 3, 0, 8, 7, 4,  0, 3, 2, 7, 9, 6,  2, 3, 1, 9, 8, 5 };
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 6; i++)
+      tofind.insert(nodes[ids[6 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 6; i++)
-        tofind.insert(nodes[ids[6 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 6; i++)
-            orderedNodes[i] = nodes[ids[6 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[6 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -1352,7 +1352,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1368,24 +1368,24 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
   for (int i = 0; i < 4; i++)
     tofind.insert(nodes[ids[i]]);
   if (setNodes == tofind)
-    {
-      for (int i = 0; i < 4; i++)
-        orderedNodes[i] = nodes[ids[i]];
-      return;
-    }
+  {
+    for (int i = 0; i < 4; i++)
+      orderedNodes[i] = nodes[ids[i]];
+    return;
+  }
   // Triangular faces
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 3; i++)
+      tofind.insert(nodes[ids[4 + 3 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 3; i++)
-        tofind.insert(nodes[ids[4 + 3 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 3; i++)
-            orderedNodes[i] = nodes[ids[4 + 3 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[4 + 3 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -1492,10 +1492,10 @@ SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid()
 
 void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes)
 {
-//   MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
+  //   MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++)
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1512,24 +1512,24 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdTy
   for (int i = 0; i < 8; i++)
     tofind.insert(nodes[ids[i]]);
   if (setNodes == tofind)
-    {
-      for (int i = 0; i < 8; i++)
-        orderedNodes[i] = nodes[ids[i]];
-      return;
-    }
+  {
+    for (int i = 0; i < 8; i++)
+      orderedNodes[i] = nodes[ids[i]];
+    return;
+  }
   // Triangular faces
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 6; i++)
+      tofind.insert(nodes[ids[8 + 6 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 6; i++)
-        tofind.insert(nodes[ids[8 + 6 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 6; i++)
-            orderedNodes[i] = nodes[ids[8 + 6 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[8 + 6 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -1655,7 +1655,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++)
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1664,35 +1664,35 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
-//int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
+  //int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
   int ids[18] = { 0, 1, 2,  3, 5, 4,   0, 3, 4, 1,   1, 4, 5, 2,   2, 5, 3, 0 };
 
   // Triangular faces
   for (int k = 0; k < 2; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 3; i++)
+      tofind.insert(nodes[ids[3 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 3; i++)
-        tofind.insert(nodes[ids[3 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 3; i++)
-            orderedNodes[i] = nodes[ids[3 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[3 * k + i]];
+      return;
     }
+  }
   // Quadrangular faces
   for (int k = 0; k < 3; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 4; i++)
+      tofind.insert(nodes[ids[6 + 4 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 4; i++)
-        tofind.insert(nodes[ids[6 + 4 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 4; i++)
-            orderedNodes[i] = nodes[ids[6 + 4 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[6 + 4 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -1704,7 +1704,7 @@ void SMDS_DownPenta::addDownCell(int cellId, int lowCellId, unsigned char aType)
   int *faces = &_cellIds[_nbDownCells * cellId];
   if (aType == VTK_QUAD)
     for (int i = 0; i < 3; i++)
-      {
+    {
         if (faces[i] < 0)
           {
             faces[i] = lowCellId;
@@ -1805,7 +1805,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1814,36 +1814,36 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
-//int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
+  //int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
   int ids[36] = { 0, 1, 2, 6, 7, 8,  3, 5, 4, 11, 10, 9,
                   0, 3, 4, 1, 12, 9, 13, 6,   1, 4, 5, 2, 13, 10, 14, 7,   2, 5, 3, 0, 14, 11, 12, 8 };
 
   // Triangular faces
   for (int k = 0; k < 2; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 6; i++)
+      tofind.insert(nodes[ids[6 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 6; i++)
-        tofind.insert(nodes[ids[6 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 6; i++)
-            orderedNodes[i] = nodes[ids[6 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[6 * k + i]];
+      return;
     }
+  }
   // Quadrangular faces
   for (int k = 0; k < 3; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 8; i++)
+      tofind.insert(nodes[ids[12 + 8 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 8; i++)
-        tofind.insert(nodes[ids[12 + 8 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 8; i++)
-            orderedNodes[i] = nodes[ids[12 + 8 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[12 + 8 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -1976,7 +1976,7 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& or
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -1985,20 +1985,20 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& or
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
-//int ids[24] = { 0, 1, 2, 3,  7, 6, 5, 4,  4, 0, 3, 7,  5, 1, 0, 4,  6, 2, 1, 5,  7, 3, 2, 6};
+  //int ids[24] = { 0, 1, 2, 3,  7, 6, 5, 4,  4, 0, 3, 7,  5, 1, 0, 4,  6, 2, 1, 5,  7, 3, 2, 6};
   int ids[24] = { 3, 2, 1, 0,  4, 5, 6, 7,  7, 3, 0, 4,  4, 0, 1, 5,  5, 1, 2, 6,  6, 2, 3, 7};
   for (int k = 0; k < 6; k++) // loop on the 6 faces
+  {
+    tofind.clear();
+    for (int i = 0; i < 4; i++)
+      tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 4; i++)
-        tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 4; i++)
-            orderedNodes[i] = nodes[ids[4 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[4 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
@@ -2107,7 +2107,7 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
@@ -2120,17 +2120,17 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>
   int ids[48] = { 3, 2, 1, 0,10, 9, 8,11,   4, 5, 6, 7,12,13,14,15,   7, 3, 0, 4,19,11,16,15,
                   4, 0, 1, 5,16, 8,17,12,   5, 1, 2, 6,17, 9,18,13,   6, 2, 3, 7,18,10,19,14};
   for (int k = 0; k < 6; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 8; i++)
+      tofind.insert(nodes[ids[8 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 8; i++)
-        tofind.insert(nodes[ids[8 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 8; i++)
-            orderedNodes[i] = nodes[ids[8 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[8 * k + i]];
+      return;
     }
+  }
   MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
index da8e96d69e1637ebd9f4cfad84ad4a4d92f73afb..42859c88a233a1dcb2e0e8167883322e341b7b59 100644 (file)
@@ -90,7 +90,7 @@ class SMDS_FaceOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
 class _MyEdgeIterator : public SMDS_ElemIterator
 {
   vector< const SMDS_MeshElement* > myElems;
-  int myIndex;
+  size_t                            myIndex;
 public:
   _MyEdgeIterator(const SMDS_FaceOfNodes* face):myIndex(0) {
     myElems.reserve( face->NbNodes() );
@@ -108,8 +108,7 @@ public:
   virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
 };
 
-SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator
-                         (SMDSAbs_ElementType type) const
+SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator( SMDSAbs_ElementType type ) const
 {
   switch(type)
   {
index 3719c6b56ee174d5c68f51807c15d602e4ff48fe..e775b5bdaecdeebd3d1e8918d4646608ef3edd14 100644 (file)
@@ -54,24 +54,24 @@ const SMDS_MeshElement * SMDS_IteratorOfElements::subNext()
 /// Create an iterator which look for elements of type type which are linked 
 /// to the element element. it is the iterator to get connectivity of element
 //////////////////////////////////////////////////////////////////////////////
-SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element,
-                                                 SMDSAbs_ElementType type,
+SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement *    element,
+                                                 SMDSAbs_ElementType         type,
                                                  const SMDS_ElemIteratorPtr& it)
-     : t1Iterator(it),
-       t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)),
-       myType(type), myElement(element),
-       myProxyElement(NULL)
+  : t1Iterator(it),
+    t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)),
+    myType(type), myElement(element),
+    myProxyElement(NULL)
 {
-        while(subMore())
-                alreadyReturnedElements.insert(subNext());
-        itAlreadyReturned= alreadyReturnedElements.begin();
-        switch(myElement->GetType())
-        {
-        case SMDSAbs_Node: 
-        case SMDSAbs_Edge: myReverseIteration=true; break;
-        case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
-        default: myReverseIteration=false;
-        }       
+  while(subMore())
+    alreadyReturnedElements.insert(subNext());
+  itAlreadyReturned= alreadyReturnedElements.begin();
+  switch(myElement->GetType())
+  {
+  case SMDSAbs_Node:
+  case SMDSAbs_Edge: myReverseIteration=true; break;
+  case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
+  default: myReverseIteration=false;
+  }
 }
 
 bool SMDS_IteratorOfElements::more()
index e0756198c9d2512d6635a3d3d786246cf30bf2ca..2b720b0cc2ffb67b6f9a0c06ac2e1765ebb21ac3 100644 (file)
@@ -43,11 +43,11 @@ class SMDS_EXPORT SMDS_IteratorOfElements:public SMDS_ElemIterator
         const SMDS_MeshElement * next();
 
   private:
-        SMDS_ElemIteratorPtr t2Iterator;
         SMDS_ElemIteratorPtr t1Iterator;
+        SMDS_ElemIteratorPtr t2Iterator;
         SMDSAbs_ElementType myType;     
-        const SMDS_MeshElement * myProxyElement;
         const SMDS_MeshElement * myElement;             
+        const SMDS_MeshElement * myProxyElement;
         bool myReverseIteration;
 
         std::set<const SMDS_MeshElement*> alreadyReturnedElements;
index 87a2f15589acdfe42066b515bf39be6ad6ebca0c..72da1ad743770b5a462b3853edca2139f084452c 100644 (file)
@@ -124,16 +124,16 @@ int SMDS_Mesh::CheckMemory(const bool doNotRaise) throw (std::bad_alloc)
 ///////////////////////////////////////////////////////////////////////////////
 /// Create a new mesh object
 ///////////////////////////////////////////////////////////////////////////////
-SMDS_Mesh::SMDS_Mesh()
-  :myParent(NULL),
-   myNodeIDFactory(new SMDS_MeshNodeIDFactory()),
-   myElementIDFactory(new SMDS_MeshElementIDFactory()),
-   myHasConstructionEdges(false), myHasConstructionFaces(false),
-   myHasInverseElements(true),
-   myNodeMin(0), myNodeMax(0),
-   myNodePool(0), myEdgePool(0), myFacePool(0), myVolumePool(0),myBallPool(0),
-   myModified(false), myModifTime(0), myCompactTime(0),
-   xmin(0), xmax(0), ymin(0), ymax(0), zmin(0), zmax(0)
+SMDS_Mesh::SMDS_Mesh():
+  myNodePool(0), myVolumePool(0), myFacePool(0), myEdgePool(0), myBallPool(0),
+  myParent(NULL),
+  myNodeIDFactory(new SMDS_MeshNodeIDFactory()),
+  myElementIDFactory(new SMDS_MeshElementIDFactory()),
+  myModified(false), myModifTime(0), myCompactTime(0),
+  myNodeMin(0), myNodeMax(0),
+  myHasConstructionEdges(false), myHasConstructionFaces(false),
+  myHasInverseElements(true),
+  xmin(0), xmax(0), ymin(0), ymax(0), zmin(0), zmax(0)
 {
   myMeshId = _meshList.size();         // --- index of the mesh to push back in the vector
   myNodeIDFactory->SetMesh(this);
@@ -169,16 +169,16 @@ SMDS_Mesh::SMDS_Mesh()
 /// Note that the tree structure of SMDS_Mesh seems to be unused in this version
 /// (2003-09-08) of SMESH
 ///////////////////////////////////////////////////////////////////////////////
-SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent)
-        :myParent(parent), myNodeIDFactory(parent->myNodeIDFactory),
-         myElementIDFactory(parent->myElementIDFactory),
-         myHasConstructionEdges(false), myHasConstructionFaces(false),
-         myHasInverseElements(true),
-         myNodePool(parent->myNodePool),
-         myEdgePool(parent->myEdgePool),
-         myFacePool(parent->myFacePool),
-         myVolumePool(parent->myVolumePool),
-         myBallPool(parent->myBallPool)
+SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent):
+  myNodePool(parent->myNodePool),
+  myVolumePool(parent->myVolumePool),
+  myFacePool(parent->myFacePool),
+  myEdgePool(parent->myEdgePool),
+  myBallPool(parent->myBallPool),
+  myParent(parent), myNodeIDFactory(parent->myNodeIDFactory),
+  myElementIDFactory(parent->myElementIDFactory),
+  myHasConstructionEdges(false), myHasConstructionFaces(false),
+  myHasInverseElements(true)
 {
 }
 
@@ -188,9 +188,9 @@ SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent)
 
 SMDS_Mesh *SMDS_Mesh::AddSubMesh()
 {
-        SMDS_Mesh *submesh = new SMDS_Mesh(this);
-        myChildren.insert(myChildren.end(), submesh);
-        return submesh;
+  SMDS_Mesh *submesh = new SMDS_Mesh(this);
+  myChildren.insert(myChildren.end(), submesh);
+  return submesh;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -223,7 +223,7 @@ SMDS_MeshNode * SMDS_Mesh::AddNodeWithID(double x, double y, double z, int ID)
     SMDS_MeshNode * node = myNodePool->getNew();
     node->init(ID, myMeshId, 0, x, y, z);
 
-    if (ID >= myNodes.size())
+    if (ID >= (int)myNodes.size())
     {
         myNodes.resize(ID+SMDS_Mesh::chunkSize, 0);
 //         MESSAGE(" ------------------ myNodes resize " << ID << " --> " << ID+SMDS_Mesh::chunkSize);
@@ -1649,7 +1649,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceFromVtkIdsWithID(const std::vector<vtkIdType>&
 bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
 {
   //MESSAGE("registerElement " << ID);
-  if ((ID >=0) && (ID < myCells.size()) && myCells[ID]) // --- already bound
+  if ((ID >=0) && (ID < (int)myCells.size()) && myCells[ID]) // --- already bound
   {
     MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId());
     return false;
@@ -1664,7 +1664,7 @@ bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
   if (vtkId == -1)
     vtkId = myElementIDFactory->SetInVtkGrid(element);
 
-  if (vtkId >= myCellIdVtkToSmds.size()) // --- resize local vector
+  if (vtkId >= (int)myCellIdVtkToSmds.size()) // --- resize local vector
   {
 //     MESSAGE(" --------------------- resize myCellIdVtkToSmds " << vtkId << " --> " << vtkId + SMDS_Mesh::chunkSize);
     myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1);
@@ -1691,7 +1691,7 @@ void SMDS_Mesh::MoveNode(const SMDS_MeshNode *n, double x, double y, double z)
 ///////////////////////////////////////////////////////////////////////////////
 const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const
 {
-  if (ID < 1 || ID >= myNodes.size())
+  if (ID < 1 || ID >= (int)myNodes.size())
   {
 //     MESSAGE("------------------------------------------------------------------------- ");
 //     MESSAGE("----------------------------------- bad ID " << ID << " " << myNodes.size());
@@ -1707,7 +1707,7 @@ const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const
 const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const
 {
   // TODO if needed use mesh->nodeIdFromVtkToSmds
-  if (vtkId < 0 || vtkId >= (myNodes.size() -1))
+  if ( vtkId < 0 || vtkId+1 >= (int) myNodes.size() )
   {
     MESSAGE("------------------------------------------------------------------------- ");
     MESSAGE("---------------------------- bad VTK ID " << vtkId << " " << myNodes.size());
@@ -2426,7 +2426,7 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
 
 const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const
 {
-  if ((IDelem <= 0) || IDelem >= myCells.size())
+  if ( IDelem <= 0 || IDelem >= (int)myCells.size() )
   {
     MESSAGE("--------------------------------------------------------------------------------- ");
     MESSAGE("----------------------------------- bad IDelem " << IDelem << " " << myCells.size());
@@ -2482,7 +2482,7 @@ const SMDS_MeshElement* SMDS_Mesh::FindElement (const vector<const SMDS_MeshNode
     {
       const SMDS_MeshElement* e = itF->next();
       int nbNodesToCheck = noMedium ? e->NbCornerNodes() : e->NbNodes();
-      if ( nbNodesToCheck == nodes.size() )
+      if ( nbNodesToCheck == (int)nodes.size() )
       {
         for ( size_t i = 1; e && i < nodes.size(); ++i )
         {
@@ -3110,28 +3110,27 @@ static set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement *
 ///////////////////////////////////////////////////////////////////////////////
 /// Return the list of nodes used only by the given elements
 ///////////////////////////////////////////////////////////////////////////////
-static set<const SMDS_MeshElement*> * getExclusiveNodes(
-        set<const SMDS_MeshElement*>& elements)
+static set<const SMDS_MeshElement*> * getExclusiveNodes(set<const SMDS_MeshElement*>& elements)
 {
-        set<const SMDS_MeshElement*> * toReturn=new set<const SMDS_MeshElement*>();
-        set<const SMDS_MeshElement*>::iterator itElements=elements.begin();
+  set<const SMDS_MeshElement*> * toReturn=new set<const SMDS_MeshElement*>();
+  set<const SMDS_MeshElement*>::iterator itElements=elements.begin();
 
-        while(itElements!=elements.end())
-        {
-                SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator();
-                itElements++;
+  while(itElements!=elements.end())
+  {
+    SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator();
+    itElements++;
 
-                while(itNodes->more())
-                {
-                        const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
-                        SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
-                        set<const SMDS_MeshElement*> s;
-                        while(itFe->more())
-                          s.insert(itFe->next());
-                        if(s==elements) toReturn->insert(n);
-                }
-        }
-        return toReturn;
+    while(itNodes->more())
+    {
+      const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
+      SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
+      set<const SMDS_MeshElement*> s;
+      while(itFe->more())
+        s.insert(itFe->next());
+      if(s==elements) toReturn->insert(n);
+    }
+  }
+  return toReturn;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -3145,62 +3144,65 @@ void SMDS_Mesh::addChildrenWithNodes(set<const SMDS_MeshElement*>& setOfChildren
                                      set<const SMDS_MeshElement*>& nodes)
 {
   switch(element->GetType())
+  {
+  case SMDSAbs_Node:
+    MESSAGE("Internal Error: This should not happen");
+    break;
+  case SMDSAbs_0DElement:
+  case SMDSAbs_Ball:
+  {
+  }
+  break;
+  case SMDSAbs_Edge:
+  {
+    SMDS_ElemIteratorPtr itn=element->nodesIterator();
+    while(itn->more())
     {
-    case SMDSAbs_Node:
-      MESSAGE("Internal Error: This should not happen");
-      break;
-    case SMDSAbs_0DElement:
+      const SMDS_MeshElement * e=itn->next();
+      if(nodes.find(e)!=nodes.end())
       {
+        setOfChildren.insert(element);
+        break;
+      }
+    }
+  } break;
+  case SMDSAbs_Face:
+  {
+    SMDS_ElemIteratorPtr itn=element->nodesIterator();
+    while(itn->more())
+    {
+      const SMDS_MeshElement * e=itn->next();
+      if(nodes.find(e)!=nodes.end())
+      {
+        setOfChildren.insert(element);
+        break;
       }
-      break;
-    case SMDSAbs_Edge:
-        {
-                SMDS_ElemIteratorPtr itn=element->nodesIterator();
-                while(itn->more())
-                {
-                        const SMDS_MeshElement * e=itn->next();
-                        if(nodes.find(e)!=nodes.end())
-                        {
-                          setOfChildren.insert(element);
-                          break;
-                        }
-                }
-        } break;
-    case SMDSAbs_Face:
-        {
-                SMDS_ElemIteratorPtr itn=element->nodesIterator();
-                while(itn->more())
-                {
-                        const SMDS_MeshElement * e=itn->next();
-                        if(nodes.find(e)!=nodes.end())
-                        {
-                          setOfChildren.insert(element);
-                          break;
-                        }
-                }
-                if(hasConstructionEdges())
-                {
-                        SMDS_ElemIteratorPtr ite=element->edgesIterator();
-                        while(ite->more())
-                                addChildrenWithNodes(setOfChildren, ite->next(), nodes);
-                }
-        } break;
-    case SMDSAbs_Volume:
-        {
-                if(hasConstructionFaces())
-                {
-                        SMDS_ElemIteratorPtr ite=element->facesIterator();
-                        while(ite->more())
-                                addChildrenWithNodes(setOfChildren, ite->next(), nodes);
-                }
-                else if(hasConstructionEdges())
-                {
-                        SMDS_ElemIteratorPtr ite=element->edgesIterator();
-                        while(ite->more())
-                                addChildrenWithNodes(setOfChildren, ite->next(), nodes);
-                }
-        }
     }
+    if(hasConstructionEdges())
+    {
+      SMDS_ElemIteratorPtr ite=element->edgesIterator();
+      while(ite->more())
+        addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+    }
+  } break;
+  case SMDSAbs_Volume:
+  {
+    if(hasConstructionFaces())
+    {
+      SMDS_ElemIteratorPtr ite=element->facesIterator();
+      while(ite->more())
+        addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+    }
+    else if(hasConstructionEdges())
+    {
+      SMDS_ElemIteratorPtr ite=element->edgesIterator();
+      while(ite->more())
+        addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+    }
+  }
+  case SMDSAbs_NbElementTypes:
+  case SMDSAbs_All: break;
+  }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -3226,7 +3228,6 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
                               list<const SMDS_MeshElement *>& removedNodes,
                               bool                            removenodes)
 {
-  //MESSAGE("SMDS_Mesh::RemoveElement " << elem->getVtkId() << " " << removenodes);
   // get finite elements built on elem
   set<const SMDS_MeshElement*> * s1;
   if (    (elem->GetType() == SMDSAbs_0DElement)
@@ -3271,19 +3272,16 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
       // Remove element from <InverseElements> of its nodes
       SMDS_ElemIteratorPtr itn = (*it)->nodesIterator();
       while (itn->more())
-        {
-          SMDS_MeshNode * n = static_cast<SMDS_MeshNode *> (const_cast<SMDS_MeshElement *> (itn->next()));
-          n->RemoveInverseElement((*it));
-        }
+      {
+        SMDS_MeshNode * n = static_cast<SMDS_MeshNode *> (const_cast<SMDS_MeshElement *> (itn->next()));
+        n->RemoveInverseElement((*it));
+      }
       int IdToRemove = (*it)->GetID();
       int vtkid = (*it)->getVtkId();
-      //MESSAGE("elem Id to remove " << IdToRemove << " vtkid " << vtkid <<
-      //        " vtktype " << (*it)->GetVtkType() << " type " << (*it)->GetType());
       switch ((*it)->GetType())
       {
         case SMDSAbs_Node:
-          MYASSERT("Internal Error: This should not happen")
-          ;
+          MYASSERT("Internal Error: This should not happen");
           break;
         case SMDSAbs_0DElement:
           if (IdToRemove >= 0)
@@ -3305,8 +3303,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
           if (const SMDS_VtkEdge* vtkElem = dynamic_cast<const SMDS_VtkEdge*>(*it))
             myEdgePool->destroy((SMDS_VtkEdge*) vtkElem);
-          else
+          else {
+            ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
             delete (*it);
+          }
           break;
         case SMDSAbs_Face:
           if (IdToRemove >= 0)
@@ -3318,8 +3318,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
           if (const SMDS_VtkFace* vtkElem = dynamic_cast<const SMDS_VtkFace*>(*it))
             myFacePool->destroy((SMDS_VtkFace*) vtkElem);
-          else
+          else {
+            ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
             delete (*it);
+          }
           break;
         case SMDSAbs_Volume:
           if (IdToRemove >= 0)
@@ -3331,8 +3333,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
           if (const SMDS_VtkVolume* vtkElem = dynamic_cast<const SMDS_VtkVolume*>(*it))
             myVolumePool->destroy((SMDS_VtkVolume*) vtkElem);
-          else
+          else {
+            ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
             delete (*it);
+          }
           break;
         case SMDSAbs_Ball:
           if (IdToRemove >= 0)
@@ -3344,43 +3348,46 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
           if (const SMDS_BallElement* vtkElem = dynamic_cast<const SMDS_BallElement*>(*it))
             myBallPool->destroy(const_cast<SMDS_BallElement*>( vtkElem ));
-          else
+          else {
+            ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
             delete (*it);
+          }
           break;
+
+        case SMDSAbs_All: // avoid compilation warning
+        case SMDSAbs_NbElementTypes: break;
       }
       if (vtkid >= 0)
-        {
-          //MESSAGE("VTK_EMPTY_CELL in " << vtkid);
-          this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL);
-        }
+      {
+        this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL);
+      }
       it++;
     }
 
   // remove exclusive (free) nodes
   if (removenodes)
+  {
+    it = s2->begin();
+    while (it != s2->end())
     {
-      it = s2->begin();
-      while (it != s2->end())
-        {
-          int IdToRemove = (*it)->GetID();
-          //MESSAGE( "SMDS: RM node " << IdToRemove);
-          if (IdToRemove >= 0)
-            {
-              myNodes[IdToRemove] = 0;
-              myInfo.myNbNodes--;
-            }
-          myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId());
-          removedNodes.push_back((*it));
-          if (const SMDS_MeshNode* vtkElem = dynamic_cast<const SMDS_MeshNode*>(*it))
-          {
-            ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition());
-            myNodePool->destroy((SMDS_MeshNode*) vtkElem);
-          }
-          else
-            delete (*it);
-          it++;
-        }
+      int IdToRemove = (*it)->GetID();
+      if (IdToRemove >= 0)
+      {
+        myNodes[IdToRemove] = 0;
+        myInfo.myNbNodes--;
+      }
+      myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId());
+      removedNodes.push_back((*it));
+      if (const SMDS_MeshNode* vtkElem = dynamic_cast<const SMDS_MeshNode*>(*it))
+      {
+        ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition());
+        myNodePool->destroy((SMDS_MeshNode*) vtkElem);
+      }
+      else
+        delete (*it);
+      it++;
     }
+  }
 
   delete s2;
   delete s1;
@@ -3425,11 +3432,12 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
     }
 
     // in meshes without descendants elements are always free
-     switch (aType) {
+    switch (aType) {
     case SMDSAbs_0DElement:
       myCells[elemId] = 0;
       myInfo.remove(elem);
       delete elem;
+      elem = 0;
       break;
     case SMDSAbs_Edge:
       myCells[elemId] = 0;
@@ -3458,6 +3466,9 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
 
     this->myGrid->GetCellTypesArray()->SetValue(vtkId, VTK_EMPTY_CELL);
     // --- to do: keep vtkid in a list of reusable cells
+
+    if ( elem )
+      ((SMDS_MeshElement*) elem)->init( -1, -1, -1 ); // avoid reuse
   }
 }
 
@@ -4685,7 +4696,7 @@ void SMDS_Mesh::updateNodeMinMax()
     myNodeMax=0;
     return;
   }
-  while (!myNodes[myNodeMin] && (myNodeMin<myNodes.size()))
+  while ( !myNodes[myNodeMin] && myNodeMin < (int)myNodes.size() )
     myNodeMin++;
   myNodeMax=myNodes.size()-1;
   while (!myNodes[myNodeMax] && (myNodeMin>=0))
@@ -4775,7 +4786,7 @@ void SMDS_Mesh::compactMesh()
 
 int SMDS_Mesh::fromVtkToSmds(int vtkid)
 {
-  if (vtkid >= 0 && vtkid < myCellIdVtkToSmds.size())
+  if (vtkid >= 0 && vtkid < (int)myCellIdVtkToSmds.size())
     return myCellIdVtkToSmds[vtkid];
   throw SALOME_Exception(LOCALIZED ("vtk id out of bounds"));
 }
index 7c728d6f96569de4fe510d87103148c0a9c631ab..d233a00a3390aed783a5260bd003386f9bd61720 100644 (file)
@@ -747,7 +747,7 @@ public:
   void incrementNodesCapacity(int nbNodes);
   void incrementCellsCapacity(int nbCells);
   void adjustStructure();
-  void dumpGrid(string ficdump="dumpGrid");
+  void dumpGrid(std::string ficdump="dumpGrid");
   static int chunkSize;
 
   //! low level modification: add, change or remove node or element
@@ -789,7 +789,7 @@ protected:
   {
     assert(ID >= 0);
     myElementIDFactory->adjustMaxId(ID);
-    if (ID >= myCells.size())
+    if (ID >= (int)myCells.size())
       myCells.resize(ID+SMDS_Mesh::chunkSize,0);
   }
 
@@ -838,6 +838,8 @@ protected:
   SMDS_MeshElementIDFactory *myElementIDFactory;
   SMDS_MeshInfo          myInfo;
 
+  //! any add, remove or change of node or cell
+  bool myModified;
   //! use a counter to keep track of modifications
   unsigned long myModifTime, myCompactTime;
 
@@ -848,9 +850,6 @@ protected:
   bool myHasConstructionFaces;
   bool myHasInverseElements;
 
-  //! any add, remove or change of node or cell
-  bool myModified;
-
   double xmin;
   double xmax;
   double ymin;
index e629a2f5b7a02a7e18fb5f5ba9c5889044ed34c0..8b7b2f63c5c3aede2bc935ca8696e93301065058 100644 (file)
@@ -278,7 +278,7 @@ const std::vector<int>& SMDS_MeshCell::reverseSmdsOrder(SMDSAbs_EntityType smdsT
       reverseInterlaces[ smdsType ][pos++] = 0;
       for ( int i = nbNodes / 2 - 1; i > 0 ; --i ) // 3,2,1
         reverseInterlaces[ smdsType ][pos++] = i;
-      for ( int i = nbNodes - 1; i >= nbNodes / 2; --i ) // 7,6,5,4
+      for ( int i = nbNodes - 1, nb = nbNodes / 2; i >= nb; --i ) // 7,6,5,4
         reverseInterlaces[ smdsType ][pos++] = i;
     }
   }
index f8eb2ddefc89ec53a556cf99007160617da6f918..5bf7398cac956df65479e8ccf8044d814cefb66c 100644 (file)
@@ -95,7 +95,7 @@ bool SMDS_MeshElementIDFactory::BindID(int ID, SMDS_MeshElement * elem)
 //=======================================================================
 SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID)
 {
-  if ((ID<1) || (ID>=myMesh->myCells.size()))
+  if ( ID<1 || ID >= (int) myMesh->myCells.size() )
     return NULL;
   const SMDS_MeshElement* elem = GetMesh()->FindElement(ID);
   return (SMDS_MeshElement*)(elem);
@@ -129,7 +129,7 @@ void SMDS_MeshElementIDFactory::ReleaseID(int ID, int vtkId)
   //MESSAGE("~~~~~~~~~~~~~~ SMDS_MeshElementIDFactory::ReleaseID smdsId vtkId " << ID << " " << vtkId);
   if (vtkId >= 0)
     {
-      assert(vtkId < myMesh->myCellIdVtkToSmds.size());
+      assert(vtkId < (int)myMesh->myCellIdVtkToSmds.size());
       myMesh->myCellIdVtkToSmds[vtkId] = -1;
       myMesh->setMyModified();
     }
@@ -149,7 +149,7 @@ void SMDS_MeshElementIDFactory::updateMinMax() const
 {
   myMin = INT_MAX;
   myMax = 0;
-  for (int i = 0; i < myMesh->myCells.size(); i++)
+  for (size_t i = 0; i < myMesh->myCells.size(); i++)
     {
       if (myMesh->myCells[i])
         {
index 5c22d7f9b0e62016ae87f8cf77cadfa625a6ed83..b0ccc82fa168708d467e3b630ee39aa5a7278911 100644 (file)
@@ -25,7 +25,6 @@
 #define SMDS_MeshInfo_HeaderFile
 
 #include <vector>
-using namespace std;
 
 #include "SMESH_SMDS.hxx"
 
@@ -192,7 +191,7 @@ inline SMDS_MeshInfo::SMDS_MeshInfo():
 
 inline SMDS_MeshInfo& // operator=
 SMDS_MeshInfo::operator=(const SMDS_MeshInfo& other)
-{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=(*other.myNb[i]);
+{ for ( size_t i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=(*other.myNb[i]);
   myNbPolygons     = other.myNbPolygons;
   myNbQuadPolygons = other.myNbQuadPolygons;
   myNbPolyhedrons  = other.myNbPolyhedrons;
@@ -201,7 +200,7 @@ SMDS_MeshInfo::operator=(const SMDS_MeshInfo& other)
 
 inline void // Clear
 SMDS_MeshInfo::Clear()
-{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
+{ for ( size_t i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
   myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0;
 }
 
@@ -293,7 +292,7 @@ SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
   int nb = 0;
   switch (type) {
   case SMDSAbs_All:
-    for ( int i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
+    for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
     nb += myNbPolygons + myNbQuadPolygons + myNbPolyhedrons;
     break;
   case SMDSAbs_Volume:
@@ -352,6 +351,7 @@ SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
   case SMDSEntity_Ball:             return myNbBalls;
   case SMDSEntity_Quad_Polygon:     return myNbQuadPolygons;
   case SMDSEntity_Quad_Polyhedra:
+  case SMDSEntity_Last:
     break;
   }
   return 0;
@@ -424,6 +424,7 @@ SMDS_MeshInfo::setNb(const SMDSAbs_EntityType geomType, const int nb)
   case SMDSEntity_Triangle:         myNbTriangles         = nb; break;
   case SMDSEntity_Quad_Polygon:     myNbQuadPolygons      = nb; break;
   case SMDSEntity_Quad_Polyhedra:
+  case SMDSEntity_Last:
     break;
   }
 }
index 3524480cca6644fcc349cd9888dbc19cfa1eea96..7b0f6a97c44676949947d38bd653bac670ee215c 100644 (file)
@@ -182,17 +182,14 @@ public:
       MESSAGE("SMDS_MeshNode_MyInvIterator problem Null element");
       throw SALOME_Exception("SMDS_MeshNode_MyInvIterator problem Null element");
     }
-    //MESSAGE("vtkId " << vtkId << " smdsId " << smdsId << " " << elem->GetType());
     iter++;
     return elem;
   }
 };
 
-SMDS_ElemIteratorPtr SMDS_MeshNode::
-GetInverseElementIterator(SMDSAbs_ElementType type) const
+SMDS_ElemIteratorPtr SMDS_MeshNode::GetInverseElementIterator(SMDSAbs_ElementType type) const
 {
   vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
-  //MESSAGE("myID " << myID << " ncells " << l.ncells);
   return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
 }
 
index f291b0bff1b150aa6f71d4cbc5b61da040fce562..d636b1d18ee8f8ff8c6b64d81786e9a97b7588a1 100644 (file)
@@ -150,7 +150,7 @@ class SMDS_PolygonalFaceOfNodes_MyIterator:public SMDS_NodeVectorElemIterator
 class _MyEdgeIterator : public SMDS_ElemIterator
 {
   vector< const SMDS_MeshElement* > myElems;
-  int myIndex;
+  size_t                            myIndex;
 public:
   _MyEdgeIterator(const SMDS_MeshFace* face):myIndex(0) {
     myElems.reserve( face->NbNodes() );
index 2dfa337db3a4b16ee7359143bf73f5bc64f5768b..22cab1ab8538a63df75d838b844e5604cea812d2 100644 (file)
@@ -101,7 +101,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbEdges() const
 {
   int nbEdges = 0;
 
-  for (int ifa = 0; ifa < myQuantities.size(); ifa++) {
+  for ( size_t ifa = 0; ifa < myQuantities.size(); ifa++) {
     nbEdges += myQuantities[ifa];
   }
   nbEdges /= 2;
@@ -124,7 +124,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbFaces() const
 //=======================================================================
 int SMDS_PolyhedralVolumeOfNodes::NbFaceNodes (const int face_ind) const
 {
-  if (face_ind < 1 || myQuantities.size() < face_ind)
+  if (face_ind < 1 || (int)myQuantities.size() < face_ind)
     return 0;
   return myQuantities[face_ind - 1];
 }
@@ -201,7 +201,7 @@ struct _MyIterator:public SMDS_NodeVectorElemIterator
 class _MySubIterator : public SMDS_ElemIterator
 {
   vector< const SMDS_MeshElement* > myElems;
-  int myIndex;
+  size_t                            myIndex;
 public:
   _MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
     SMDS_VolumeTool vTool(vol);
index f427dac9692b7c7ae9e0dcae55ac908d0855a8e6..a308239eb21d5f72037c57bb5588147e4e179a5c 100644 (file)
@@ -168,14 +168,14 @@ namespace {
 
   //=======================================================================
   //class : _MyInterlacedNodeIterator
-  //purpose  : 
+  //purpose  :
   //=======================================================================
 
   class _MyInterlacedNodeIterator:public SMDS_NodeIterator
   {
     const vector<const SMDS_MeshNode *>& mySet;
-    int myIndex;
-    const int * myInterlace;
+    size_t                               myIndex;
+    const int *                          myInterlace;
   public:
     _MyInterlacedNodeIterator(const vector<const SMDS_MeshNode *>& s,
                               const int * interlace):
@@ -228,7 +228,7 @@ SMDS_NodeIteratorPtr SMDS_QuadraticFaceOfNodes::interlacedNodesIterator() const
 class _MyEdgeIterator : public SMDS_ElemIterator
 {
   vector< const SMDS_MeshElement* > myElems;
-  int myIndex;
+  size_t                            myIndex;
 public:
   _MyEdgeIterator(const SMDS_QuadraticFaceOfNodes* face):myIndex(0) {
     myElems.reserve( face->NbNodes() );
index 2a356d5810647bb4e02d3b03695d1af6b85bfac7..0ab7e8c84e0592a5a0c288b771ad27c23a41bbd0 100644 (file)
@@ -215,7 +215,7 @@ bool SMDS_QuadraticVolumeOfNodes::IsMediumNode(const SMDS_MeshNode* node) const
   case 15: nbCorners = 6; break;
   default: nbCorners = 8;
   }
-  for ( int i = nbCorners; i<myNodes.size(); i++) {
+  for ( size_t i = nbCorners; i<myNodes.size(); i++) {
     if(myNodes[i]==node) return true;
   }
   return false;
@@ -318,7 +318,7 @@ public:
 class _MySubIterator : public SMDS_ElemIterator
 {
   vector< const SMDS_MeshElement* > myElems;
-  int myIndex;
+  size_t                            myIndex;
 public:
   _MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
     SMDS_VolumeTool vTool(vol);
index 5fe82a432a7cd65a17750e81df074b22c043cecf..52916ec724c12d491ed92982b26e50e30fae467b 100644 (file)
@@ -354,12 +354,12 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes,
 
 int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId)
 {
-  if((vtkCellId < 0) || (vtkCellId >= _cellIdToDownId.size()))
-    {
-      //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId="
-      //    << vtkCellId << " max="<< _cellIdToDownId.size());
-      return -1;
-    }
+  if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size()))
+  {
+    //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId="
+    //    << vtkCellId << " max="<< _cellIdToDownId.size());
+    return -1;
+  }
   return _cellIdToDownId[vtkCellId];
 }
 
@@ -371,12 +371,12 @@ void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId)
 
 void SMDS_UnstructuredGrid::CleanDownwardConnectivity()
 {
-  for (int i = 0; i < _downArray.size(); i++)
-    {
-      if (_downArray[i])
-        delete _downArray[i];
-      _downArray[i] = 0;
-    }
+  for (size_t i = 0; i < _downArray.size(); i++)
+  {
+    if (_downArray[i])
+      delete _downArray[i];
+    _downArray[i] = 0;
+  }
   _cellIdToDownId.clear();
 }
 
index 80d41a2636fa1fe0a20973d522c5fcbf61d0bc52..612e6e7f44ea6bb80c671c1f15302514eeb3a43f 100644 (file)
@@ -191,7 +191,7 @@ class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
 class _MySubIterator : public SMDS_ElemIterator
 {
   vector< const SMDS_MeshElement* > myElems;
-  int myIndex;
+  size_t myIndex;
 public:
   _MySubIterator(const SMDS_VolumeOfNodes* vol, SMDSAbs_ElementType type):myIndex(0) {
     SMDS_VolumeTool vTool(vol);
index c0c506d9cc13ba79e607cbf392d6f612bd1cd4e2..06755badfe00214f35f00414d12a7fe3ee49537e 100644 (file)
@@ -843,7 +843,7 @@ bool SMDS_VolumeTool::GetBaryCenter(double & X, double & Y, double & Z) const
   if ( !myVolume )
     return false;
 
-  for ( int i = 0; i < myVolumeNodes.size(); i++ ) {
+  for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) {
     X += myVolumeNodes[ i ]->X();
     Y += myVolumeNodes[ i ]->Y();
     Z += myVolumeNodes[ i ]->Z();
@@ -1390,7 +1390,7 @@ bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1,
 
   // find nodes indices
   int i1 = -1, i2 = -1, nbFound = 0;
-  for ( int i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ )
+  for ( size_t i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ )
   {
     if ( myVolumeNodes[ i ] == theNode1 )
       i1 = i, ++nbFound;
@@ -1418,7 +1418,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
   int minInd = min( theNode1Index, theNode2Index );
   int maxInd = max( theNode1Index, theNode2Index );
 
-  if ( minInd < 0 || maxInd > myVolumeNodes.size() - 1 || maxInd == minInd )
+  if ( minInd < 0 || maxInd > (int)myVolumeNodes.size() - 1 || maxInd == minInd )
     return false;
 
   VolumeType type = GetVolumeType();
@@ -1535,7 +1535,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
 int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const
 {
   if ( myVolume ) {
-    for ( int i = 0; i < myVolumeNodes.size(); i++ ) {
+    for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) {
       if ( myVolumeNodes[ i ] == theNode )
         return i;
     }
@@ -1596,8 +1596,8 @@ int SMDS_VolumeTool::GetAllExistingEdges(vector<const SMDS_MeshElement*> & edges
 {
   edges.clear();
   edges.reserve( myVolumeNodes.size() * 2 );
-  for ( int i = 0; i < myVolumeNodes.size()-1; ++i ) {
-    for ( int j = i + 1; j < myVolumeNodes.size(); ++j ) {
+  for ( size_t i = 0; i < myVolumeNodes.size()-1; ++i ) {
+    for ( size_t j = i + 1; j < myVolumeNodes.size(); ++j ) {
       if ( IsLinked( i, j )) {
         const SMDS_MeshElement* edge =
           SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] );
index 015edf75fd26b815f3649e7deffd8133f52c194f..efc0f786c4e78b0b5a6539e083af60568d330eb3 100644 (file)
@@ -95,7 +95,7 @@ void SMDS_VtkVolume::initPoly(const std::vector<vtkIdType>& nodeIds,
   SMDS_UnstructuredGrid* grid = mesh->getGrid();
   //double center[3];
   //this->gravityCenter(grid, &nodeIds[0], nodeIds.size(), &center[0]);
-  vector<vtkIdType> ptIds;
+  std::vector<vtkIdType> ptIds;
   vtkIdType nbFaces = nbNodesPerFace.size();
   int k = 0;
   for (int i = 0; i < nbFaces; i++)
@@ -165,7 +165,7 @@ bool SMDS_VtkVolume::vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes)
   const std::vector<int>& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( aVtkType ));
   if ( !interlace.empty() )
   {
-    ASSERT( interlace.size() == nbNodes );
+    ASSERT( (int)interlace.size() == nbNodes );
     std::vector<const SMDS_MeshNode*> initNodes( nodes, nodes+nbNodes );
     for ( size_t i = 0; i < interlace.size(); ++i )
       nodes[i] = initNodes[ interlace[i] ];
@@ -365,7 +365,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetFaceNode(const int face_ind, const int n
  */
 std::vector<int> SMDS_VtkVolume::GetQuantities() const
 {
-  vector<int> quantities;
+  std::vector<int> quantities;
   SMDS_Mesh *mesh = SMDS_Mesh::_meshList[myMeshId];
   vtkUnstructuredGrid* grid = mesh->getGrid();
   vtkIdType aVtkType = grid->GetCellType(this->myVtkID);
index caa6031f404cba316ac1d7653271020a00cb00a4..e09007076d86273ead8f3d88d8685b3bbb14200f 100644 (file)
@@ -60,7 +60,7 @@ void counters::stats()
 }
 
 chrono::chrono(int i) :
-  _ctr(i), _run(true)
+  _run(true), _ctr(i)
 {
   //MESSAGE("chrono::chrono " << _ctr << " " << _run);
   _start = clock();
index b7992de2f74473d3528e79b097a440dd69a918e6..56d41720d7988588403367d37329c6a2c44fcb77 100644 (file)
@@ -449,7 +449,7 @@ bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh*                   theM
   if ( n2 && ++nbNodes )
     theNodes.insert( make_pair( l, n2 ));
 
-  return theNodes.size() == nbNodes;
+  return (int)theNodes.size() == nbNodes;
 }
 
 //================================================================================
@@ -469,7 +469,7 @@ SMESH_Algo::GetCompatibleHypoFilter(const bool ignoreAuxiliary) const
     {
       SMESH_HypoFilter* filter = new SMESH_HypoFilter();
       filter->Init( filter->HasName( _compatibleHypothesis[0] ));
-      for ( int i = 1; i < _compatibleHypothesis.size(); ++i )
+      for ( size_t i = 1; i < _compatibleHypothesis.size(); ++i )
         filter->Or( filter->HasName( _compatibleHypothesis[ i ] ));
 
       SMESH_HypoFilter* filterNoAux = new SMESH_HypoFilter( filter );
index 6363dc469d4949411d6f380e7d869e937475893b..a362ed290bc272bef369bc1407e9535cfff4d04c 100644 (file)
@@ -215,7 +215,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
    *  have a name (type) listed in the algorithm. Hypothesis associated to
    *  father shape -are not- taken into account (see GetUsedHypothesis)
    */
-  const list <const SMESHDS_Hypothesis *> &
+  const std::list <const SMESHDS_Hypothesis *> &
   GetAppliedHypothesis(SMESH_Mesh &         aMesh,
                        const TopoDS_Shape & aShape,
                        const bool           ignoreAuxiliary=true) const;
index eb09db52b466e0a31ccce617cca4f21c0ae89f30..94a28a2792f530bbc25f2d7ef4b5deb3fd5079ba 100644 (file)
@@ -125,7 +125,7 @@ public:
     int                 _algoDim;
     bool                _isGlobalAlgo;
 
-    TAlgoStateError(): _algoDim(0),_algo(0),_name(SMESH_Hypothesis::HYP_OK) {}
+    TAlgoStateError(): _name(SMESH_Hypothesis::HYP_OK), _algo(0), _algoDim(0) {}
     void Set(TAlgoStateErrorName name, const SMESH_Algo* algo, bool isGlobal)
     { _name = name; _algo = algo; _algoDim = algo->GetDim(); _isGlobalAlgo = isGlobal; }
     void Set(TAlgoStateErrorName name, const int algoDim,      bool isGlobal)
index fcebe63d36e8f8b73987123254e26c77504f6a09..a5fd2f45702a5dc5743b2ffb43688a4cfa61debf 100644 (file)
@@ -131,19 +131,22 @@ void SMESH_HypoFilter::IsMoreLocalThanPredicate::findPreferable()
 {
   const int shapeID = _mesh.GetMeshDS()->ShapeToIndex( _shape );
   const TListOfListOfInt& listOfShapeIDList = _mesh.GetMeshOrder();
-  TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin();
+  TListOfListOfInt::const_iterator  listsIt = listOfShapeIDList.begin();
   for ( ; listsIt != listOfShapeIDList.end(); ++listsIt )
   {
-    const TListOfInt& idList  = *listsIt;
+    const TListOfInt& idList = *listsIt;
     TListOfInt::const_iterator idIt =
       std::find( idList.begin(), idList.end(), shapeID );
     if ( idIt != idList.end() && *idIt != idList.front() )
     {
-      for ( ; idIt != idList.end(); --idIt )
+      for ( --idIt; true; --idIt )
       {
         const TopoDS_Shape& shape = _mesh.GetMeshDS()->IndexToShape( *idIt );
         if ( !shape.IsNull())
           _preferableShapes.Add( shape );
+
+        if ( idIt == idList.begin() )
+          break;
       }
     }
   }
index 0c08a7ceed0f0dc4ed4e20bf3e68a33f0fc36dfb..3a21a0a318d5f25f316d3197d3e33ec516b529b3 100644 (file)
@@ -78,6 +78,7 @@ int SMESH_Hypothesis::GetDim() const
     case ALGO_1D: dim = 1; break;
     case ALGO_2D: dim = 2; break;
     case ALGO_3D: dim = 3; break;
+    case ALGO_0D: dim = 0; break;
     case PARAM_ALGO:
       dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
     }
@@ -159,7 +160,7 @@ void SMESH_Hypothesis::SetLibName(const char* theLibName)
 SMESH_Mesh* SMESH_Hypothesis::GetMeshByPersistentID(int id)
 {
   StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
-  map<int, SMESH_Mesh*>::iterator itm = itm = myStudyContext->mapMesh.begin();
+  map<int, SMESH_Mesh*>::iterator itm = myStudyContext->mapMesh.begin();
   for ( ; itm != myStudyContext->mapMesh.end(); itm++)
   {
     SMESH_Mesh* mesh = (*itm).second;
index 9e613c12156823e14482c27cd4571facc77768d1..ecc7888e7329341334607a3bbb45fdc22dd9355c 100644 (file)
@@ -536,6 +536,10 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
     MESSAGE("MEDToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces());
     MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes());
   }
+#ifdef _DEBUG_
+  SMESH_ComputeErrorPtr er = myReader.GetError();
+  if ( er && !er->IsOK() ) cout << er->myComment << endl;
+#endif
 
   // Reading groups (sub-meshes are out of scope of MED import functionality)
   list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
@@ -1349,6 +1353,8 @@ bool SMESH_Mesh::HasModificationsToDiscard() const
         hasNotComputed = true;
       if ( hasComputed && hasNotComputed)
         return true;
+
+    default:;
     }
   }
   if ( NbNodes() < 1 )
@@ -2010,7 +2016,7 @@ SMESH_Group* SMESH_Mesh::AddGroup (SMESHDS_GroupBase* groupDS) throw(SALOME_Exce
 
 bool SMESH_Mesh::SynchronizeGroups()
 {
-  int nbGroups = _mapGroup.size();
+  size_t nbGroups = _mapGroup.size();
   const set<SMESHDS_GroupBase*>& groups = _myMeshDS->GetGroups();
   set<SMESHDS_GroupBase*>::const_iterator gIt = groups.begin();
   for ( ; gIt != groups.end(); ++gIt )
index 2c2fc35e0625002af51119b0a739747ff49b1fdb..0f2f1ad710c39fa4159264fa4c5290fa8a0d5230 100644 (file)
@@ -1325,7 +1325,7 @@ int SMESH_MeshEditor::Reorient2DBy3D (TIDSortedElemSet & theFaces,
     if ( face->GetType() != SMDSAbs_Face )
       continue;
 
-    const int nbCornersNodes = face->NbCornerNodes();
+    const size_t nbCornersNodes = face->NbCornerNodes();
     faceNodes.assign( face->begin_nodes(), face->end_nodes() );
 
     checkedVolumes.clear();
@@ -1341,7 +1341,7 @@ int SMESH_MeshEditor::Reorient2DBy3D (TIDSortedElemSet & theFaces,
 
       // is volume adjacent?
       bool allNodesCommon = true;
-      for ( int iN = 1; iN < nbCornersNodes && allNodesCommon; ++iN )
+      for ( size_t iN = 1; iN < nbCornersNodes && allNodesCommon; ++iN )
         allNodesCommon = ( volume->GetNodeIndex( faceNodes[ iN ]) > -1 );
       if ( !allNodesCommon )
         continue;
@@ -1361,7 +1361,7 @@ int SMESH_MeshEditor::Reorient2DBy3D (TIDSortedElemSet & theFaces,
       for ( int i = 0; i < 2; ++i )
       {
         const SMDS_MeshNode* n = facetNodes[ i*iQ ];
-        for ( int iN = 0; iN < nbCornersNodes; ++iN )
+        for ( size_t iN = 0; iN < nbCornersNodes; ++iN )
           if ( faceNodes[ iN ] == n )
           {
             iNN[ i ] = iN;
@@ -1601,13 +1601,13 @@ void SMESH_MeshEditor::QuadTo4Tri (TIDSortedElemSet & theElems)
 
     // create 4 triangles
 
-    GetMeshDS()->RemoveFreeElement( quad, subMeshDS, /*fromGroups=*/false );
-    
     helper.SetIsQuadratic  ( nodes.size() > 4 );
     helper.SetIsBiQuadratic( nodes.size() == 9 );
     if ( helper.GetIsQuadratic() )
       helper.AddTLinks( static_cast< const SMDS_MeshFace*>( quad ));
 
+    GetMeshDS()->RemoveFreeElement( quad, subMeshDS, /*fromGroups=*/false );
+
     for ( int i = 0; i < 4; ++i )
     {
       SMDS_MeshElement* tria = helper.AddFace( nodes[ i ],
@@ -1925,7 +1925,7 @@ namespace
         if ( hasAdjacentSplits && method._nbSplits > 0 )
         {
           bool facetCreated = true;
-          for ( int iF = 0; facetCreated && iF < triaSplitsByFace.size(); ++iF )
+          for ( size_t iF = 0; facetCreated && iF < triaSplitsByFace.size(); ++iF )
           {
             list< TTriangleFacet >::const_iterator facet = triaSplitsByFace[iF].begin();
             for ( ; facetCreated && facet != triaSplitsByFace[iF].end(); ++facet )
@@ -2432,12 +2432,12 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems,
                                                  volNodes[ facet->_n3 ]));
           }
         }
-        for ( int i = 0; i < triangles.size(); ++i )
+        for ( size_t i = 0; i < triangles.size(); ++i )
         {
-          if ( !triangles[i] ) continue;
+          if ( !triangles[ i ]) continue;
           if ( fSubMesh )
-            fSubMesh->AddElement( triangles[i]);
-          newElems.Append( triangles[i] );
+            fSubMesh->AddElement( triangles[ i ]);
+          newElems.Append( triangles[ i ]);
         }
         ReplaceElemInGroups( face, triangles, GetMeshDS() );
         GetMeshDS()->RemoveFreeElement( face, fSubMesh, /*fromGroups=*/false );
@@ -2455,7 +2455,7 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems,
           GetMeshDS()->RemoveNode( volNodes[i] );
     }
   } // loop on volumes to split
-  
+
   myLastCreatedNodes = newNodes;
   myLastCreatedElems = newElems;
 }
@@ -2530,7 +2530,7 @@ void SMESH_MeshEditor::GetHexaFacetsToSplit( TIDSortedElemSet& theHexas,
   set<const SMDS_MeshNode*> facetNodes;
   const SMDS_MeshElement*   curHex;
 
-  const bool allHex = ( theHexas.size() == myMesh->NbHexas() );
+  const bool allHex = ((int) theHexas.size() == myMesh->NbHexas() );
 
   while ( startHex )
   {
@@ -2913,7 +2913,7 @@ void SMESH_MeshEditor::ReplaceElemInGroups (const SMDS_MeshElement*
     for ( ; grIt != groups.end(); grIt++ ) {
       SMESHDS_Group* group = dynamic_cast<SMESHDS_Group*>( *grIt );
       if ( group && group->SMDSGroup().Remove( elemToRm ) )
-        for ( int i = 0; i < elemToAdd.size(); ++i )
+        for ( size_t i = 0; i < elemToAdd.size(); ++i )
           group->SMDSGroup().Add( elemToAdd[ i ] );
     }
   }
@@ -2939,14 +2939,13 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
   SMESH_MesherHelper   helper( *GetMesh() );
 
   TIDSortedElemSet::iterator itElem;
-  for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) {
+  for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
+  {
     const SMDS_MeshElement* elem = *itElem;
-    if ( !elem || elem->GetType() != SMDSAbs_Face )
+    if ( !elem || elem->GetGeomType() != SMDSGeom_QUADRANGLE )
       continue;
-    bool isquad = elem->NbNodes()==4 || elem->NbNodes()==8;
-    if(!isquad) continue;
 
-    if(elem->NbNodes()==4) {
+    if ( elem->NbNodes() == 4 ) {
       // retrieve element nodes
       const SMDS_MeshNode* aNodes [4];
       SMDS_ElemIteratorPtr itN = elem->nodesIterator();
@@ -2969,10 +2968,10 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
       myLastCreatedElems.Append(newElem2);
       // put a new triangle on the same shape and add to the same groups
       if ( aShapeId )
-        {
-          aMesh->SetMeshElementOnShape( newElem1, aShapeId );
-          aMesh->SetMeshElementOnShape( newElem2, aShapeId );
-        }
+      {
+        aMesh->SetMeshElementOnShape( newElem1, aShapeId );
+        aMesh->SetMeshElementOnShape( newElem2, aShapeId );
+      }
       AddToSameGroups( newElem1, elem, aMesh );
       AddToSameGroups( newElem2, elem, aMesh );
       aMesh->RemoveElement( elem );
@@ -2980,8 +2979,8 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
 
     // Quadratic quadrangle
 
-    if( elem->NbNodes()==8 && elem->IsQuadratic() ) {
-
+    else if ( elem->NbNodes() >= 8 )
+    {
       // get surface elem is on
       int aShapeId = FindShape( elem );
       if ( aShapeId != helper.GetSubShapeID() ) {
@@ -2997,61 +2996,43 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
         }
       }
 
-      const SMDS_MeshNode* aNodes [8];
-      const SMDS_MeshNode* inFaceNode = 0;
+      const SMDS_MeshNode* aNodes [9]; aNodes[8] = 0;
       SMDS_ElemIteratorPtr itN = elem->nodesIterator();
-      int i = 0;
-      while ( itN->more() ) {
-        aNodes[ i++ ] = static_cast<const SMDS_MeshNode*>( itN->next() );
-        if ( !inFaceNode && helper.GetNodeUVneedInFaceNode() &&
-             aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE )
-        {
-          inFaceNode = aNodes[ i-1 ];
-        }
-      }
+      for ( int i = 0; itN->more(); ++i )
+        aNodes[ i ] = static_cast<const SMDS_MeshNode*>( itN->next() );
 
-      // find middle point for (0,1,2,3)
-      // and create a node in this point;
-      gp_XYZ p( 0,0,0 );
-      if ( surface.IsNull() ) {
-        for(i=0; i<4; i++)
-          p += gp_XYZ(aNodes[i]->X(), aNodes[i]->Y(), aNodes[i]->Z() );
-        p /= 4;
-      }
-      else {
-        TopoDS_Face geomFace = TopoDS::Face( helper.GetSubShape() );
-        gp_XY uv( 0,0 );
-        for(i=0; i<4; i++)
-          uv += helper.GetNodeUV( geomFace, aNodes[i], inFaceNode );
-        uv /= 4.;
-        p = surface->Value( uv.X(), uv.Y() ).XYZ();
+      const SMDS_MeshNode* centrNode = aNodes[8];
+      if ( centrNode == 0 )
+      {
+        centrNode = helper.GetCentralNode( aNodes[0], aNodes[1], aNodes[2], aNodes[3],
+                                           aNodes[4], aNodes[5], aNodes[6], aNodes[7],
+                                           surface.IsNull() );
+        myLastCreatedNodes.Append(centrNode);
       }
-      const SMDS_MeshNode* newN = aMesh->AddNode( p.X(), p.Y(), p.Z() );
-      myLastCreatedNodes.Append(newN);
 
       // create a new element
       const SMDS_MeshElement* newElem1 = 0;
       const SMDS_MeshElement* newElem2 = 0;
       if ( the13Diag ) {
         newElem1 = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0],
-                                  aNodes[6], aNodes[7], newN );
+                                  aNodes[6], aNodes[7], centrNode );
         newElem2 = aMesh->AddFace(aNodes[2], aNodes[0], aNodes[1],
-                                  newN,      aNodes[4], aNodes[5] );
+                                  centrNode, aNodes[4], aNodes[5] );
       }
       else {
         newElem1 = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1],
-                                  aNodes[7], aNodes[4], newN );
+                                  aNodes[7], aNodes[4], centrNode );
         newElem2 = aMesh->AddFace(aNodes[3], aNodes[1], aNodes[2],
-                                  newN,      aNodes[5], aNodes[6] );
+                                  centrNode, aNodes[5], aNodes[6] );
       }
       myLastCreatedElems.Append(newElem1);
       myLastCreatedElems.Append(newElem2);
       // put a new triangle on the same shape and add to the same groups
       if ( aShapeId )
-        {
-          aMesh->SetMeshElementOnShape( newElem1, aShapeId );
-          aMesh->SetMeshElementOnShape( newElem2, aShapeId );
-        }
+      {
+        aMesh->SetMeshElementOnShape( newElem1, aShapeId );
+        aMesh->SetMeshElementOnShape( newElem2, aShapeId );
+      }
       AddToSameGroups( newElem1, elem, aMesh );
       AddToSameGroups( newElem2, elem, aMesh );
       aMesh->RemoveElement( elem );
@@ -4006,7 +3987,7 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet &          theElems,
     Handle(Geom_Surface) surface;
     SMESHDS_SubMesh* faceSubMesh = 0;
     TopoDS_Face face;
-    double fToler2 = 0, f,l;
+    double fToler2 = 0;
     double u1 = 0, u2 = 0, v1 = 0, v2 = 0;
     bool isUPeriodic = false, isVPeriodic = false;
     if ( *fId )
@@ -4492,7 +4473,7 @@ namespace
 void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*               elem,
                                     const vector<TNodeOfNodeListMapItr> & newNodesItVec,
                                     list<const SMDS_MeshElement*>&        newElems,
-                                    const int                             nbSteps,
+                                    const size_t                          nbSteps,
                                     SMESH_SequenceOfElemPtr&              srcElements)
 {
   //MESSAGE("sweepElement " << nbSteps);
@@ -4620,7 +4601,7 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*               elem,
   }
 
   // make new elements
-  for (int iStep = 0; iStep < nbSteps; iStep++ )
+  for ( size_t iStep = 0; iStep < nbSteps; iStep++ )
   {
     // get next nodes
     for ( iNode = 0; iNode < nbNodes; iNode++ )
@@ -5853,7 +5834,7 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet     theElemSets[2],
   // source elements for each generated one
   SMESH_SequenceOfElemPtr srcElems, srcNodes;
 
-  SMESHDS_Mesh* aMesh = GetMeshDS();
+  //SMESHDS_Mesh* aMesh = GetMeshDS();
 
   setElemsFirst( theElemSets );
   const int nbSteps = theParams.NbSteps();
@@ -6244,21 +6225,19 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet     theElements[2],
       return EXTR_PATH_NOT_EDGE;
 
     TopTools_SequenceOfShape Edges;
-    double x1,x2,y1,y2,z1,z2;
     list< list<SMESH_MeshEditor_PathPoint> > LLPPs;
     int startNid = theN1->GetID();
-    for(int i = 1; i < aNodesList.size(); i++) {
-      x1 = aNodesList[i-1]->X();x2 = aNodesList[i]->X();
-      y1 = aNodesList[i-1]->Y();y2 = aNodesList[i]->Y();
-      z1 = aNodesList[i-1]->Z();z2 = aNodesList[i]->Z();
-      TopoDS_Edge e = BRepBuilderAPI_MakeEdge(gp_Pnt(x1,y1,z1),gp_Pnt(x2,y2,z2));
+    for ( size_t i = 1; i < aNodesList.size(); i++ )
+    {
+      gp_Pnt     p1 = SMESH_TNodeXYZ( aNodesList[i-1] );
+      gp_Pnt     p2 = SMESH_TNodeXYZ( aNodesList[i] );
+      TopoDS_Edge e = BRepBuilderAPI_MakeEdge( p1, p2 );
       list<SMESH_MeshEditor_PathPoint> LPP;
       aPrms.clear();
       MakeEdgePathPoints(aPrms, e, (aNodesList[i-1]->GetID()==startNid), LPP);
       LLPPs.push_back(LPP);
-      if( aNodesList[i-1]->GetID() == startNid ) startNid = aNodesList[i]->GetID();
-      else startNid = aNodesList[i-1]->GetID();
-
+      if ( aNodesList[i-1]->GetID() == startNid ) startNid = aNodesList[i  ]->GetID();
+      else                                        startNid = aNodesList[i-1]->GetID();
     }
 
     list< list<SMESH_MeshEditor_PathPoint> >::iterator itLLPP = LLPPs.begin();
@@ -6278,8 +6257,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet     theElements[2],
       PP2 = currList.front();
       gp_Dir D1 = PP1.Tangent();
       gp_Dir D2 = PP2.Tangent();
-      gp_Dir Dnew( gp_Vec( (D1.X()+D2.X())/2, (D1.Y()+D2.Y())/2,
-                           (D1.Z()+D2.Z())/2 ) );
+      gp_Dir Dnew( 0.5 * ( D1.XYZ() + D2.XYZ() ));
       PP1.SetTangent(Dnew);
       fullList.push_back(PP1);
       itPP++;
@@ -6292,7 +6270,8 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet     theElements[2],
     fullList.push_back(PP1);
 
   } // Sub-shape for the Pattern must be an Edge or Wire
-  else if( aS.ShapeType() == TopAbs_EDGE ) {
+  else if ( aS.ShapeType() == TopAbs_EDGE )
+  {
     aTrackEdge = TopoDS::Edge( aS );
     // the Edge must not be degenerated
     if ( SMESH_Algo::isDegenerated( aTrackEdge ) )
@@ -6636,7 +6615,7 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet                  theElemSets
           // if current elem is quadratic and current node is not medium
           // we have to check - may be it is needed to insert additional nodes
           list< const SMDS_MeshNode* > & listNewNodes = nIt->second;
-          if ( listNewNodes.size() == aNbTP-1 )
+          if ((int) listNewNodes.size() == aNbTP-1 )
           {
             vector<const SMDS_MeshNode*> aNodes(2*(aNbTP-1));
             gp_XYZ P(node->X(), node->Y(), node->Z());
@@ -6893,7 +6872,7 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems,
     if ( !elem ) continue;
 
     SMDSAbs_GeometryType geomType = elem->GetGeomType();
-    int                  nbNodes  = elem->NbNodes();
+    size_t               nbNodes  = elem->NbNodes();
     if ( geomType == SMDSGeom_NONE ) continue; // node
 
     nodes.resize( nbNodes );
@@ -6931,7 +6910,7 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems,
       const vector<int>&    i = needReverse ? iRev : iForw;
 
       // find transformed nodes
-      int iNode = 0;
+      size_t iNode = 0;
       SMDS_ElemIteratorPtr itN = elem->nodesIterator();
       while ( itN->more() ) {
         const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( itN->next() );
@@ -8528,7 +8507,7 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
   // sew the border to the side 2
   // ============================
 
-  int nbNodes[]  = { nSide[0].size(), nSide[1].size() };
+  int nbNodes[]  = { (int)nSide[0].size(), (int)nSide[1].size() };
   int maxNbNodes = Max( nbNodes[0], nbNodes[1] );
 
   bool toMergeConformal = ( nbNodes[0] == nbNodes[1] );
@@ -9001,8 +8980,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement*     theElemen
 
     // create new elements
     i1 = 0; i2 = 1;
-    for ( iSplit = 0; iSplit < nbSplits - 1; iSplit++ ) {
-      SMDS_MeshElement* newElem = 0;
+    for ( iSplit = 0; iSplit < nbSplits - 1; iSplit++ )
+    {
       if ( iSplit == iBestQuad )
         newElems.push_back( aMesh->AddFace (linkNodes[ i1++ ],
                                             linkNodes[ i2++ ],
@@ -11097,16 +11076,16 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems,
     return false;
 
   const double aTol = Precision::Confusion();
-  auto_ptr< BRepClass3d_SolidClassifier> bsc3d;
-  auto_ptr<_FaceClassifier>              aFaceClassifier;
+  SMESHUtils::Deleter< BRepClass3d_SolidClassifier> bsc3d;
+  SMESHUtils::Deleter<_FaceClassifier>              aFaceClassifier;
   if ( theShape.ShapeType() == TopAbs_SOLID )
   {
-    bsc3d.reset( new BRepClass3d_SolidClassifier(theShape));;
+    bsc3d._obj = new BRepClass3d_SolidClassifier( theShape );
     bsc3d->PerformInfinitePoint(aTol);
   }
   else if (theShape.ShapeType() == TopAbs_FACE )
   {
-    aFaceClassifier.reset( new _FaceClassifier(TopoDS::Face(theShape)));
+    aFaceClassifier._obj = new _FaceClassifier( TopoDS::Face( theShape ));
   }
 
   // iterates on indicated elements and get elements by back references from their nodes
@@ -11129,7 +11108,7 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems,
       {
         const SMDS_MeshElement* curElem = backElemItr->next();
         if ( curElem && theElems.find(curElem) == theElems.end() &&
-             ( bsc3d.get() ?
+             ( bsc3d ?
                isInside( curElem, *bsc3d, aTol ) :
                isInside( curElem, *aFaceClassifier, aTol )))
           anAffected.insert( curElem );
@@ -11221,83 +11200,84 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
 
   // Check if the domains do not share an element
   for (int idom = 0; idom < nbDomains-1; idom++)
-    {
-//       MESSAGE("... Check of domain #" << idom);
-      const TIDSortedElemSet& domain = theElems[idom];
-      TIDSortedElemSet::const_iterator elemItr = domain.begin();
-      for (; elemItr != domain.end(); ++elemItr)
+  {
+    //       MESSAGE("... Check of domain #" << idom);
+    const TIDSortedElemSet& domain = theElems[idom];
+    TIDSortedElemSet::const_iterator elemItr = domain.begin();
+    for (; elemItr != domain.end(); ++elemItr)
+    {
+      const SMDS_MeshElement* anElem = *elemItr;
+      int idombisdeb = idom + 1 ;
+      // check if the element belongs to a domain further in the list
+      for ( size_t idombis = idombisdeb; idombis < theElems.size(); idombis++ )
+      {
+        const TIDSortedElemSet& domainbis = theElems[idombis];
+        if ( domainbis.count( anElem ))
         {
-          const SMDS_MeshElement* anElem = *elemItr;
-          int idombisdeb = idom + 1 ;
-          for (int idombis = idombisdeb; idombis < theElems.size(); idombis++) // check if the element belongs to a domain further in the list
-          {
-            const TIDSortedElemSet& domainbis = theElems[idombis];
-            if ( domainbis.count(anElem) )
-            {
-              MESSAGE(".... Domain #" << idom);
-              MESSAGE(".... Domain #" << idombis);
-              throw SALOME_Exception("The domains are not disjoint.");
-              return false ;
-            }
-          }
+          MESSAGE(".... Domain #" << idom);
+          MESSAGE(".... Domain #" << idombis);
+          throw SALOME_Exception("The domains are not disjoint.");
+          return false ;
         }
+      }
     }
+  }
 
   for (int idom = 0; idom < nbDomains; idom++)
-    {
+  {
 
-      // --- build a map (face to duplicate --> volume to modify)
-      //     with all the faces shared by 2 domains (group of elements)
-      //     and corresponding volume of this domain, for each shared face.
-      //     a volume has a face shared by 2 domains if it has a neighbor which is not in his domain.
+    // --- build a map (face to duplicate --> volume to modify)
+    //     with all the faces shared by 2 domains (group of elements)
+    //     and corresponding volume of this domain, for each shared face.
+    //     a volume has a face shared by 2 domains if it has a neighbor which is not in his domain.
 
-      MESSAGE("... Neighbors of domain #" << idom);
-      const TIDSortedElemSet& domain = theElems[idom];
-      TIDSortedElemSet::const_iterator elemItr = domain.begin();
-      for (; elemItr != domain.end(); ++elemItr)
+    MESSAGE("... Neighbors of domain #" << idom);
+    const TIDSortedElemSet& domain = theElems[idom];
+    TIDSortedElemSet::const_iterator elemItr = domain.begin();
+    for (; elemItr != domain.end(); ++elemItr)
+    {
+      const SMDS_MeshElement* anElem = *elemItr;
+      if (!anElem)
+        continue;
+      int vtkId = anElem->getVtkId();
+      //MESSAGE("  vtkId " << vtkId << " smdsId " << anElem->GetID());
+      int neighborsVtkIds[NBMAXNEIGHBORS];
+      int downIds[NBMAXNEIGHBORS];
+      unsigned char downTypes[NBMAXNEIGHBORS];
+      int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
+      for (int n = 0; n < nbNeighbors; n++)
+      {
+        int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]);
+        const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
+        if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared
         {
-          const SMDS_MeshElement* anElem = *elemItr;
-          if (!anElem)
-            continue;
-          int vtkId = anElem->getVtkId();
-          //MESSAGE("  vtkId " << vtkId << " smdsId " << anElem->GetID());
-          int neighborsVtkIds[NBMAXNEIGHBORS];
-          int downIds[NBMAXNEIGHBORS];
-          unsigned char downTypes[NBMAXNEIGHBORS];
-          int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
-          for (int n = 0; n < nbNeighbors; n++)
+          bool ok = false;
+          for ( size_t idombis = 0; idombis < theElems.size() && !ok; idombis++) // check if the neighbor belongs to another domain of the list
+          {
+            // MESSAGE("Domain " << idombis);
+            const TIDSortedElemSet& domainbis = theElems[idombis];
+            if ( domainbis.count(elem)) ok = true ; // neighbor is in a correct domain : face is kept
+          }
+          if ( ok || onAllBoundaries ) // the characteristics of the face is stored
+          {
+            DownIdType face(downIds[n], downTypes[n]);
+            if (!faceDomains[face].count(idom))
             {
-              int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]);
-              const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
-              if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared
-                {
-                  bool ok = false ;
-                  for (int idombis = 0; idombis < theElems.size() && !ok; idombis++) // check if the neighbor belongs to another domain of the list
-                  {
-                    // MESSAGE("Domain " << idombis);
-                    const TIDSortedElemSet& domainbis = theElems[idombis];
-                    if ( domainbis.count(elem)) ok = true ; // neighbor is in a correct domain : face is kept
-                  }
-                  if ( ok || onAllBoundaries ) // the characteristics of the face is stored
-                  {
-                    DownIdType face(downIds[n], downTypes[n]);
-                    if (!faceDomains[face].count(idom))
-                      {
-                        faceDomains[face][idom] = vtkId; // volume associated to face in this domain
-                        celldom[vtkId] = idom;
-                        //MESSAGE("       cell with a border " << vtkId << " domain " << idom);
-                      }
-                    if ( !ok )
-                    {
-                      theRestDomElems.insert( elem );
-                      faceDomains[face][iRestDom] = neighborsVtkIds[n];
-                      celldom[neighborsVtkIds[n]] = iRestDom;
-                    }
-                  }
-                }
+              faceDomains[face][idom] = vtkId; // volume associated to face in this domain
+              celldom[vtkId] = idom;
+              //MESSAGE("       cell with a border " << vtkId << " domain " << idom);
+            }
+            if ( !ok )
+            {
+              theRestDomElems.insert( elem );
+              faceDomains[face][iRestDom] = neighborsVtkIds[n];
+              celldom[neighborsVtkIds[n]] = iRestDom;
             }
+          }
         }
+      }
     }
+  }
 
   //MESSAGE("Number of shared faces " << faceDomains.size());
   std::map<DownIdType, std::map<int, int>, DownIdCompare>::iterator itface;
@@ -11307,48 +11287,48 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
   //     which has only a node or an edge on the border (not a shared face)
 
   for (int idomain = idom0; idomain < nbDomains; idomain++)
+  {
+    //MESSAGE("Domain " << idomain);
+    const TIDSortedElemSet& domain = (idomain == iRestDom) ? theRestDomElems : theElems[idomain];
+    itface = faceDomains.begin();
+    for (; itface != faceDomains.end(); ++itface)
     {
-      //MESSAGE("Domain " << idomain);
-      const TIDSortedElemSet& domain = (idomain == iRestDom) ? theRestDomElems : theElems[idomain];
-      itface = faceDomains.begin();
-      for (; itface != faceDomains.end(); ++itface)
+      const std::map<int, int>& domvol = itface->second;
+      if (!domvol.count(idomain))
+        continue;
+      DownIdType face = itface->first;
+      //MESSAGE(" --- face " << face.cellId);
+      std::set<int> oldNodes;
+      oldNodes.clear();
+      grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
+      std::set<int>::iterator itn = oldNodes.begin();
+      for (; itn != oldNodes.end(); ++itn)
+      {
+        int oldId = *itn;
+        //MESSAGE("     node " << oldId);
+        vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
+        for (int i=0; i<l.ncells; i++)
         {
-          const std::map<int, int>& domvol = itface->second;
-          if (!domvol.count(idomain))
+          int vtkId = l.cells[i];
+          const SMDS_MeshElement* anElem = GetMeshDS()->FindElement(GetMeshDS()->fromVtkToSmds(vtkId));
+          if (!domain.count(anElem))
             continue;
-          DownIdType face = itface->first;
-          //MESSAGE(" --- face " << face.cellId);
-          std::set<int> oldNodes;
-          oldNodes.clear();
-          grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
-          std::set<int>::iterator itn = oldNodes.begin();
-          for (; itn != oldNodes.end(); ++itn)
-            {
-              int oldId = *itn;
-              //MESSAGE("     node " << oldId);
-              vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
-              for (int i=0; i<l.ncells; i++)
-                {
-                  int vtkId = l.cells[i];
-                  const SMDS_MeshElement* anElem = GetMeshDS()->FindElement(GetMeshDS()->fromVtkToSmds(vtkId));
-                  if (!domain.count(anElem))
-                    continue;
-                  int vtkType = grid->GetCellType(vtkId);
-                  int downId = grid->CellIdToDownId(vtkId);
-                  if (downId < 0)
-                    {
-                      MESSAGE("doubleNodesOnGroupBoundaries: internal algorithm problem");
-                      continue; // not OK at this stage of the algorithm:
-                                //no cells created after BuildDownWardConnectivity
-                    }
-                  DownIdType aCell(downId, vtkType);
-                  cellDomains[aCell][idomain] = vtkId;
-                  celldom[vtkId] = idomain;
-                  //MESSAGE("       cell " << vtkId << " domain " << idomain);
-                }
-            }
+          int vtkType = grid->GetCellType(vtkId);
+          int downId = grid->CellIdToDownId(vtkId);
+          if (downId < 0)
+          {
+            MESSAGE("doubleNodesOnGroupBoundaries: internal algorithm problem");
+            continue; // not OK at this stage of the algorithm:
+            //no cells created after BuildDownWardConnectivity
+          }
+          DownIdType aCell(downId, vtkType);
+          cellDomains[aCell][idomain] = vtkId;
+          celldom[vtkId] = idomain;
+          //MESSAGE("       cell " << vtkId << " domain " << idomain);
         }
+      }
     }
+  }
 
   // --- explore the shared faces domain by domain, to duplicate the nodes in a coherent way
   //     for each shared face, get the nodes
@@ -11364,185 +11344,185 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
 
   MESSAGE(".. Duplication of the nodes");
   for (int idomain = idom0; idomain < nbDomains; idomain++)
+  {
+    itface = faceDomains.begin();
+    for (; itface != faceDomains.end(); ++itface)
     {
-      itface = faceDomains.begin();
-      for (; itface != faceDomains.end(); ++itface)
+      const std::map<int, int>& domvol = itface->second;
+      if (!domvol.count(idomain))
+        continue;
+      DownIdType face = itface->first;
+      //MESSAGE(" --- face " << face.cellId);
+      std::set<int> oldNodes;
+      oldNodes.clear();
+      grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
+      std::set<int>::iterator itn = oldNodes.begin();
+      for (; itn != oldNodes.end(); ++itn)
+      {
+        int oldId = *itn;
+        if (nodeDomains[oldId].empty())
         {
-          const std::map<int, int>& domvol = itface->second;
-          if (!domvol.count(idomain))
-            continue;
-          DownIdType face = itface->first;
-          //MESSAGE(" --- face " << face.cellId);
-          std::set<int> oldNodes;
-          oldNodes.clear();
-          grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
-          std::set<int>::iterator itn = oldNodes.begin();
-          for (; itn != oldNodes.end(); ++itn)
+          nodeDomains[oldId][idomain] = oldId; // keep the old node in the first domain
+          //MESSAGE("-+-+-b     oldNode " << oldId << " domain " << idomain);
+        }
+        std::map<int, int>::const_iterator itdom = domvol.begin();
+        for (; itdom != domvol.end(); ++itdom)
+        {
+          int idom = itdom->first;
+          //MESSAGE("         domain " << idom);
+          if (!nodeDomains[oldId].count(idom)) // --- node to clone
+          {
+            if (nodeDomains[oldId].size() >= 2) // a multiple node
             {
-              int oldId = *itn;
-              if (nodeDomains[oldId].empty())
-                {
-                  nodeDomains[oldId][idomain] = oldId; // keep the old node in the first domain
-                  //MESSAGE("-+-+-b     oldNode " << oldId << " domain " << idomain);
-                }
-              std::map<int, int>::const_iterator itdom = domvol.begin();
-              for (; itdom != domvol.end(); ++itdom)
-                {
-                  int idom = itdom->first;
-                  //MESSAGE("         domain " << idom);
-                  if (!nodeDomains[oldId].count(idom)) // --- node to clone
-                    {
-                      if (nodeDomains[oldId].size() >= 2) // a multiple node
-                        {
-                          vector<int> orderedDoms;
-                          //MESSAGE("multiple node " << oldId);
-                          if (mutipleNodes.count(oldId))
-                            orderedDoms = mutipleNodes[oldId];
-                          else
-                            {
-                              map<int,int>::iterator it = nodeDomains[oldId].begin();
-                              for (; it != nodeDomains[oldId].end(); ++it)
-                                orderedDoms.push_back(it->first);
-                            }
-                          orderedDoms.push_back(idom); // TODO order ==> push_front or back
-                          //stringstream txt;
-                          //for (int i=0; i<orderedDoms.size(); i++)
-                          //  txt << orderedDoms[i] << " ";
-                          //MESSAGE("orderedDoms " << txt.str());
-                          mutipleNodes[oldId] = orderedDoms;
-                        }
-                      double *coords = grid->GetPoint(oldId);
-                      SMDS_MeshNode *newNode = meshDS->AddNode(coords[0], coords[1], coords[2]);
-                      copyPosition( meshDS->FindNodeVtk( oldId ), newNode );
-                      int newId = newNode->getVtkId();
-                      nodeDomains[oldId][idom] = newId; // cloned node for other domains
-                      //MESSAGE("-+-+-c     oldNode " << oldId << " domain " << idomain << " newNode " << newId << " domain " << idom << " size=" <<nodeDomains[oldId].size());
-                    }
-                }
+              vector<int> orderedDoms;
+              //MESSAGE("multiple node " << oldId);
+              if (mutipleNodes.count(oldId))
+                orderedDoms = mutipleNodes[oldId];
+              else
+              {
+                map<int,int>::iterator it = nodeDomains[oldId].begin();
+                for (; it != nodeDomains[oldId].end(); ++it)
+                  orderedDoms.push_back(it->first);
+              }
+              orderedDoms.push_back(idom); // TODO order ==> push_front or back
+              //stringstream txt;
+              //for (int i=0; i<orderedDoms.size(); i++)
+              //  txt << orderedDoms[i] << " ";
+              //MESSAGE("orderedDoms " << txt.str());
+              mutipleNodes[oldId] = orderedDoms;
             }
+            double *coords = grid->GetPoint(oldId);
+            SMDS_MeshNode *newNode = meshDS->AddNode(coords[0], coords[1], coords[2]);
+            copyPosition( meshDS->FindNodeVtk( oldId ), newNode );
+            int newId = newNode->getVtkId();
+            nodeDomains[oldId][idom] = newId; // cloned node for other domains
+            //MESSAGE("-+-+-c     oldNode " << oldId << " domain " << idomain << " newNode " << newId << " domain " << idom << " size=" <<nodeDomains[oldId].size());
+          }
         }
+      }
     }
+  }
 
   MESSAGE(".. Creation of elements");
   for (int idomain = idom0; idomain < nbDomains; idomain++)
+  {
+    itface = faceDomains.begin();
+    for (; itface != faceDomains.end(); ++itface)
     {
-      itface = faceDomains.begin();
-      for (; itface != faceDomains.end(); ++itface)
+      std::map<int, int> domvol = itface->second;
+      if (!domvol.count(idomain))
+        continue;
+      DownIdType face = itface->first;
+      //MESSAGE(" --- face " << face.cellId);
+      std::set<int> oldNodes;
+      oldNodes.clear();
+      grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
+      int nbMultipleNodes = 0;
+      std::set<int>::iterator itn = oldNodes.begin();
+      for (; itn != oldNodes.end(); ++itn)
+      {
+        int oldId = *itn;
+        if (mutipleNodes.count(oldId))
+          nbMultipleNodes++;
+      }
+      if (nbMultipleNodes > 1) // check if an edge of the face is shared between 3 or more domains
+      {
+        //MESSAGE("multiple Nodes detected on a shared face");
+        int downId = itface->first.cellId;
+        unsigned char cellType = itface->first.cellType;
+        // --- shared edge or shared face ?
+        if ((cellType == VTK_LINE) || (cellType == VTK_QUADRATIC_EDGE)) // shared edge (between two faces)
         {
-          std::map<int, int> domvol = itface->second;
-          if (!domvol.count(idomain))
-            continue;
-          DownIdType face = itface->first;
-          //MESSAGE(" --- face " << face.cellId);
-          std::set<int> oldNodes;
-          oldNodes.clear();
-          grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
-          int nbMultipleNodes = 0;
-          std::set<int>::iterator itn = oldNodes.begin();
-          for (; itn != oldNodes.end(); ++itn)
-            {
-              int oldId = *itn;
-              if (mutipleNodes.count(oldId))
-                nbMultipleNodes++;
-            }
-          if (nbMultipleNodes > 1) // check if an edge of the face is shared between 3 or more domains
+          int nodes[3];
+          int nbNodes = grid->getDownArray(cellType)->getNodes(downId, nodes);
+          for (int i=0; i< nbNodes; i=i+nbNodes-1) // i=0 , i=nbNodes-1
+            if (mutipleNodes.count(nodes[i]))
+              if (!mutipleNodesToFace.count(nodes[i]))
+                mutipleNodesToFace[nodes[i]] = mutipleNodes[nodes[i]];
+        }
+        else // shared face (between two volumes)
+        {
+          int nbEdges = grid->getDownArray(cellType)->getNumberOfDownCells(downId);
+          const int* downEdgeIds = grid->getDownArray(cellType)->getDownCells(downId);
+          const unsigned char* edgeType = grid->getDownArray(cellType)->getDownTypes(downId);
+          for (int ie =0; ie < nbEdges; ie++)
+          {
+            int nodes[3];
+            int nbNodes = grid->getDownArray(edgeType[ie])->getNodes(downEdgeIds[ie], nodes);
+            if ( mutipleNodes.count(nodes[0]) && mutipleNodes.count( nodes[ nbNodes-1 ]))
             {
-              //MESSAGE("multiple Nodes detected on a shared face");
-              int downId = itface->first.cellId;
-              unsigned char cellType = itface->first.cellType;
-              // --- shared edge or shared face ?
-              if ((cellType == VTK_LINE) || (cellType == VTK_QUADRATIC_EDGE)) // shared edge (between two faces)
-                {
-                  int nodes[3];
-                  int nbNodes = grid->getDownArray(cellType)->getNodes(downId, nodes);
-                  for (int i=0; i< nbNodes; i=i+nbNodes-1) // i=0 , i=nbNodes-1
-                    if (mutipleNodes.count(nodes[i]))
-                      if (!mutipleNodesToFace.count(nodes[i]))
-                        mutipleNodesToFace[nodes[i]] = mutipleNodes[nodes[i]];
-                }
-              else // shared face (between two volumes)
+              vector<int> vn0 = mutipleNodes[nodes[0]];
+              vector<int> vn1 = mutipleNodes[nodes[nbNodes - 1]];
+              vector<int> doms;
+              for ( size_t i0 = 0; i0 < vn0.size(); i0++ )
+                for ( size_t i1 = 0; i1 < vn1.size(); i1++ )
+                  if ( vn0[i0] == vn1[i1] )
+                    doms.push_back( vn0[ i0 ]);
+              if ( doms.size() > 2 )
+              {
+                //MESSAGE(" detect edgesMultiDomains " << nodes[0] << " " << nodes[nbNodes - 1]);
+                double *coords = grid->GetPoint(nodes[0]);
+                gp_Pnt p0(coords[0], coords[1], coords[2]);
+                coords = grid->GetPoint(nodes[nbNodes - 1]);
+                gp_Pnt p1(coords[0], coords[1], coords[2]);
+                gp_Pnt gref;
+                int vtkVolIds[1000];  // an edge can belong to a lot of volumes
+                map<int, SMDS_VtkVolume*> domvol; // domain --> a volume with the edge
+                map<int, double> angleDom; // oriented angles between planes defined by edge and volume centers
+                int nbvol = grid->GetParentVolumes(vtkVolIds, downEdgeIds[ie], edgeType[ie]);
+                for ( size_t id = 0; id < doms.size(); id++ )
                 {
-                  int nbEdges = grid->getDownArray(cellType)->getNumberOfDownCells(downId);
-                  const int* downEdgeIds = grid->getDownArray(cellType)->getDownCells(downId);
-                  const unsigned char* edgeType = grid->getDownArray(cellType)->getDownTypes(downId);
-                  for (int ie =0; ie < nbEdges; ie++)
+                  int idom = doms[id];
+                  const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom];
+                  for ( int ivol = 0; ivol < nbvol; ivol++ )
+                  {
+                    int smdsId = meshDS->fromVtkToSmds(vtkVolIds[ivol]);
+                    SMDS_MeshElement* elem = (SMDS_MeshElement*)meshDS->FindElement(smdsId);
+                    if (domain.count(elem))
                     {
-                      int nodes[3];
-                      int nbNodes = grid->getDownArray(edgeType[ie])->getNodes(downEdgeIds[ie], nodes);
-                      if (mutipleNodes.count(nodes[0]) && mutipleNodes.count(nodes[nbNodes-1]))
-                        {
-                          vector<int> vn0 = mutipleNodes[nodes[0]];
-                          vector<int> vn1 = mutipleNodes[nodes[nbNodes - 1]];
-                          vector<int> doms;
-                          for (int i0 = 0; i0 < vn0.size(); i0++)
-                            for (int i1 = 0; i1 < vn1.size(); i1++)
-                              if (vn0[i0] == vn1[i1])
-                                doms.push_back(vn0[i0]);
-                          if (doms.size() >2)
-                            {
-                              //MESSAGE(" detect edgesMultiDomains " << nodes[0] << " " << nodes[nbNodes - 1]);
-                              double *coords = grid->GetPoint(nodes[0]);
-                              gp_Pnt p0(coords[0], coords[1], coords[2]);
-                              coords = grid->GetPoint(nodes[nbNodes - 1]);
-                              gp_Pnt p1(coords[0], coords[1], coords[2]);
-                              gp_Pnt gref;
-                              int vtkVolIds[1000];  // an edge can belong to a lot of volumes
-                              map<int, SMDS_VtkVolume*> domvol; // domain --> a volume with the edge
-                              map<int, double> angleDom; // oriented angles between planes defined by edge and volume centers
-                              int nbvol = grid->GetParentVolumes(vtkVolIds, downEdgeIds[ie], edgeType[ie]);
-                              for (int id=0; id < doms.size(); id++)
-                                {
-                                  int idom = doms[id];
-                                  const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom];
-                                  for (int ivol=0; ivol<nbvol; ivol++)
-                                    {
-                                      int smdsId = meshDS->fromVtkToSmds(vtkVolIds[ivol]);
-                                      SMDS_MeshElement* elem = (SMDS_MeshElement*)meshDS->FindElement(smdsId);
-                                      if (domain.count(elem))
-                                        {
-                                          SMDS_VtkVolume* svol = dynamic_cast<SMDS_VtkVolume*>(elem);
-                                          domvol[idom] = svol;
-                                          //MESSAGE("  domain " << idom << " volume " << elem->GetID());
-                                          double values[3];
-                                          vtkIdType npts = 0;
-                                          vtkIdType* pts = 0;
-                                          grid->GetCellPoints(vtkVolIds[ivol], npts, pts);
-                                          SMDS_VtkVolume::gravityCenter(grid, pts, npts, values);
-                                          if (id ==0)
-                                            {
-                                              gref.SetXYZ(gp_XYZ(values[0], values[1], values[2]));
-                                              angleDom[idom] = 0;
-                                            }
-                                          else
-                                            {
-                                              gp_Pnt g(values[0], values[1], values[2]);
-                                              angleDom[idom] = OrientedAngle(p0, p1, gref, g); // -pi<angle<+pi
-                                              //MESSAGE("  angle=" << angleDom[idom]);
-                                            }
-                                          break;
-                                        }
-                                    }
-                                }
-                              map<double, int> sortedDom; // sort domains by angle
-                              for (map<int, double>::iterator ia = angleDom.begin(); ia != angleDom.end(); ++ia)
-                                sortedDom[ia->second] = ia->first;
-                              vector<int> vnodes;
-                              vector<int> vdom;
-                              for (map<double, int>::iterator ib = sortedDom.begin(); ib != sortedDom.end(); ++ib)
-                                {
-                                  vdom.push_back(ib->second);
-                                  //MESSAGE("  ordered domain " << ib->second << "  angle " << ib->first);
-                                }
-                              for (int ino = 0; ino < nbNodes; ino++)
-                                vnodes.push_back(nodes[ino]);
-                              edgesMultiDomains[vnodes] = vdom; // nodes vector --> ordered domains
-                            }
-                        }
+                      SMDS_VtkVolume* svol = dynamic_cast<SMDS_VtkVolume*>(elem);
+                      domvol[idom] = svol;
+                      //MESSAGE("  domain " << idom << " volume " << elem->GetID());
+                      double values[3];
+                      vtkIdType npts = 0;
+                      vtkIdType* pts = 0;
+                      grid->GetCellPoints(vtkVolIds[ivol], npts, pts);
+                      SMDS_VtkVolume::gravityCenter(grid, pts, npts, values);
+                      if (id ==0)
+                      {
+                        gref.SetXYZ(gp_XYZ(values[0], values[1], values[2]));
+                        angleDom[idom] = 0;
+                      }
+                      else
+                      {
+                        gp_Pnt g(values[0], values[1], values[2]);
+                        angleDom[idom] = OrientedAngle(p0, p1, gref, g); // -pi<angle<+pi
+                        //MESSAGE("  angle=" << angleDom[idom]);
+                      }
+                      break;
                     }
+                  }
                 }
+                map<double, int> sortedDom; // sort domains by angle
+                for (map<int, double>::iterator ia = angleDom.begin(); ia != angleDom.end(); ++ia)
+                  sortedDom[ia->second] = ia->first;
+                vector<int> vnodes;
+                vector<int> vdom;
+                for (map<double, int>::iterator ib = sortedDom.begin(); ib != sortedDom.end(); ++ib)
+                {
+                  vdom.push_back(ib->second);
+                  //MESSAGE("  ordered domain " << ib->second << "  angle " << ib->first);
+                }
+                for (int ino = 0; ino < nbNodes; ino++)
+                  vnodes.push_back(nodes[ino]);
+                edgesMultiDomains[vnodes] = vdom; // nodes vector --> ordered domains
+              }
             }
+          }
         }
+      }
     }
+  }
 
   // --- iterate on shared faces (volumes to modify, face to extrude)
   //     get node id's of the face (id SMDS = id VTK)
@@ -11556,50 +11536,50 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
 
   MESSAGE(".. Creation of elements: simple junction");
   if (createJointElems)
-    {
-      int idg;
-      string joints2DName = "joints2D";
-      mapOfJunctionGroups[joints2DName] = this->myMesh->AddGroup(SMDSAbs_Face, joints2DName.c_str(), idg);
-      SMESHDS_Group *joints2DGrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[joints2DName]->GetGroupDS());
-      string joints3DName = "joints3D";
-      mapOfJunctionGroups[joints3DName] = this->myMesh->AddGroup(SMDSAbs_Volume, joints3DName.c_str(), idg);
-      SMESHDS_Group *joints3DGrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[joints3DName]->GetGroupDS());
-
-      itface = faceDomains.begin();
-      for (; itface != faceDomains.end(); ++itface)
-        {
-          DownIdType face = itface->first;
-          std::set<int> oldNodes;
-          std::set<int>::iterator itn;
-          oldNodes.clear();
-          grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
-
-          std::map<int, int> domvol = itface->second;
-          std::map<int, int>::iterator itdom = domvol.begin();
-          int dom1 = itdom->first;
-          int vtkVolId = itdom->second;
-          itdom++;
-          int dom2 = itdom->first;
-          SMDS_MeshCell *vol = grid->extrudeVolumeFromFace(vtkVolId, dom1, dom2, oldNodes, nodeDomains,
-                                                             nodeQuadDomains);
-          stringstream grpname;
-          grpname << "j_";
-          if (dom1 < dom2)
-            grpname << dom1 << "_" << dom2;
-          else
-            grpname << dom2 << "_" << dom1;
-          string namegrp = grpname.str();
-          if (!mapOfJunctionGroups.count(namegrp))
-            mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(vol->GetType(), namegrp.c_str(), idg);
-          SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
-          if (sgrp)
-            sgrp->Add(vol->GetID());
-          if (vol->GetType() == SMDSAbs_Volume)
-            joints3DGrp->Add(vol->GetID());
-          else if (vol->GetType() == SMDSAbs_Face)
-            joints2DGrp->Add(vol->GetID());
-        }
+  {
+    int idg;
+    string joints2DName = "joints2D";
+    mapOfJunctionGroups[joints2DName] = this->myMesh->AddGroup(SMDSAbs_Face, joints2DName.c_str(), idg);
+    SMESHDS_Group *joints2DGrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[joints2DName]->GetGroupDS());
+    string joints3DName = "joints3D";
+    mapOfJunctionGroups[joints3DName] = this->myMesh->AddGroup(SMDSAbs_Volume, joints3DName.c_str(), idg);
+    SMESHDS_Group *joints3DGrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[joints3DName]->GetGroupDS());
+
+    itface = faceDomains.begin();
+    for (; itface != faceDomains.end(); ++itface)
+    {
+      DownIdType face = itface->first;
+      std::set<int> oldNodes;
+      std::set<int>::iterator itn;
+      oldNodes.clear();
+      grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
+
+      std::map<int, int> domvol = itface->second;
+      std::map<int, int>::iterator itdom = domvol.begin();
+      int dom1 = itdom->first;
+      int vtkVolId = itdom->second;
+      itdom++;
+      int dom2 = itdom->first;
+      SMDS_MeshCell *vol = grid->extrudeVolumeFromFace(vtkVolId, dom1, dom2, oldNodes, nodeDomains,
+                                                       nodeQuadDomains);
+      stringstream grpname;
+      grpname << "j_";
+      if (dom1 < dom2)
+        grpname << dom1 << "_" << dom2;
+      else
+        grpname << dom2 << "_" << dom1;
+      string namegrp = grpname.str();
+      if (!mapOfJunctionGroups.count(namegrp))
+        mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(vol->GetType(), namegrp.c_str(), idg);
+      SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
+      if (sgrp)
+        sgrp->Add(vol->GetID());
+      if (vol->GetType() == SMDSAbs_Volume)
+        joints3DGrp->Add(vol->GetID());
+      else if (vol->GetType() == SMDSAbs_Face)
+        joints2DGrp->Add(vol->GetID());
     }
+  }
 
   // --- create volumes on multiple domain intersection if requested
   //     iterate on mutipleNodesToFace
@@ -11607,66 +11587,66 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
 
   MESSAGE(".. Creation of elements: multiple junction");
   if (createJointElems)
+  {
+    // --- iterate on mutipleNodesToFace
+
+    std::map<int, std::vector<int> >::iterator itn =  mutipleNodesToFace.begin();
+    for (; itn != mutipleNodesToFace.end(); ++itn)
     {
-      // --- iterate on mutipleNodesToFace
+      int node = itn->first;
+      vector<int> orderDom = itn->second;
+      vector<vtkIdType> orderedNodes;
+      for ( size_t idom = 0; idom < orderDom.size(); idom++ )
+        orderedNodes.push_back( nodeDomains[ node ][ orderDom[ idom ]]);
+      SMDS_MeshFace* face = this->GetMeshDS()->AddFaceFromVtkIds(orderedNodes);
 
-      std::map<int, std::vector<int> >::iterator itn =  mutipleNodesToFace.begin();
-      for (; itn != mutipleNodesToFace.end(); ++itn)
-        {
-          int node = itn->first;
-          vector<int> orderDom = itn->second;
-          vector<vtkIdType> orderedNodes;
-          for (int idom = 0; idom <orderDom.size(); idom++)
-            orderedNodes.push_back( nodeDomains[node][orderDom[idom]] );
-            SMDS_MeshFace* face = this->GetMeshDS()->AddFaceFromVtkIds(orderedNodes);
-
-            stringstream grpname;
-            grpname << "m2j_";
-            grpname << 0 << "_" << 0;
-            int idg;
-            string namegrp = grpname.str();
-            if (!mapOfJunctionGroups.count(namegrp))
-              mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Face, namegrp.c_str(), idg);
-            SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
-            if (sgrp)
-              sgrp->Add(face->GetID());
-        }
-
-      // --- iterate on edgesMultiDomains
-
-      std::map<std::vector<int>, std::vector<int> >::iterator ite = edgesMultiDomains.begin();
-      for (; ite != edgesMultiDomains.end(); ++ite)
-        {
-          vector<int> nodes = ite->first;
-          vector<int> orderDom = ite->second;
-          vector<vtkIdType> orderedNodes;
-          if (nodes.size() == 2)
-            {
-              //MESSAGE(" use edgesMultiDomains " << nodes[0] << " " << nodes[1]);
-              for (int ino=0; ino < nodes.size(); ino++)
-                if (orderDom.size() == 3)
-                  for (int idom = 0; idom <orderDom.size(); idom++)
-                    orderedNodes.push_back( nodeDomains[nodes[ino]][orderDom[idom]] );
-                else
-                  for (int idom = orderDom.size()-1; idom >=0; idom--)
-                    orderedNodes.push_back( nodeDomains[nodes[ino]][orderDom[idom]] );
-              SMDS_MeshVolume* vol = this->GetMeshDS()->AddVolumeFromVtkIds(orderedNodes);
-
-              int idg;
-              string namegrp = "jointsMultiples";
-              if (!mapOfJunctionGroups.count(namegrp))
-                mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg);
-              SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
-              if (sgrp)
-                sgrp->Add(vol->GetID());
-            }
+      stringstream grpname;
+      grpname << "m2j_";
+      grpname << 0 << "_" << 0;
+      int idg;
+      string namegrp = grpname.str();
+      if (!mapOfJunctionGroups.count(namegrp))
+        mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Face, namegrp.c_str(), idg);
+      SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
+      if (sgrp)
+        sgrp->Add(face->GetID());
+    }
+
+    // --- iterate on edgesMultiDomains
+
+    std::map<std::vector<int>, std::vector<int> >::iterator ite = edgesMultiDomains.begin();
+    for (; ite != edgesMultiDomains.end(); ++ite)
+    {
+      vector<int> nodes = ite->first;
+      vector<int> orderDom = ite->second;
+      vector<vtkIdType> orderedNodes;
+      if (nodes.size() == 2)
+      {
+        //MESSAGE(" use edgesMultiDomains " << nodes[0] << " " << nodes[1]);
+        for ( size_t ino = 0; ino < nodes.size(); ino++ )
+          if ( orderDom.size() == 3 )
+            for ( size_t idom = 0; idom < orderDom.size(); idom++ )
+              orderedNodes.push_back( nodeDomains[ nodes[ ino ]][ orderDom[ idom ]]);
           else
-            {
-              //INFOS("Quadratic multiple joints not implemented");
-              // TODO quadratic nodes
-            }
-        }
+            for (int idom = orderDom.size()-1; idom >=0; idom--)
+              orderedNodes.push_back( nodeDomains[ nodes[ ino ]][ orderDom[ idom ]]);
+        SMDS_MeshVolume* vol = this->GetMeshDS()->AddVolumeFromVtkIds(orderedNodes);
+
+        int idg;
+        string namegrp = "jointsMultiples";
+        if (!mapOfJunctionGroups.count(namegrp))
+          mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg);
+        SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
+        if (sgrp)
+          sgrp->Add(vol->GetID());
+      }
+      else
+      {
+        //INFOS("Quadratic multiple joints not implemented");
+        // TODO quadratic nodes
+      }
     }
+  }
 
   // --- list the explicit faces and edges of the mesh that need to be modified,
   //     i.e. faces and edges built with one or more duplicated nodes.
@@ -11680,36 +11660,36 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
 
   MESSAGE(".. Modification of elements");
   for (int idomain = idom0; idomain < nbDomains; idomain++)
+  {
+    std::map<int, std::map<int, int> >::const_iterator itnod = nodeDomains.begin();
+    for (; itnod != nodeDomains.end(); ++itnod)
     {
-      std::map<int, std::map<int, int> >::const_iterator itnod = nodeDomains.begin();
-      for (; itnod != nodeDomains.end(); ++itnod)
-        {
-          int oldId = itnod->first;
-          //MESSAGE("     node " << oldId);
-          vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
-          for (int i = 0; i < l.ncells; i++)
+      int oldId = itnod->first;
+      //MESSAGE("     node " << oldId);
+      vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
+      for (int i = 0; i < l.ncells; i++)
+      {
+        int vtkId = l.cells[i];
+        int vtkType = grid->GetCellType(vtkId);
+        int downId = grid->CellIdToDownId(vtkId);
+        if (downId < 0)
+          continue; // new cells: not to be modified
+        DownIdType aCell(downId, vtkType);
+        int volParents[1000];
+        int nbvol = grid->GetParentVolumes(volParents, vtkId);
+        for (int j = 0; j < nbvol; j++)
+          if (celldom.count(volParents[j]) && (celldom[volParents[j]] == idomain))
+            if (!feDom.count(vtkId))
             {
-              int vtkId = l.cells[i];
-              int vtkType = grid->GetCellType(vtkId);
-              int downId = grid->CellIdToDownId(vtkId);
-              if (downId < 0)
-                continue; // new cells: not to be modified
-              DownIdType aCell(downId, vtkType);
-              int volParents[1000];
-              int nbvol = grid->GetParentVolumes(volParents, vtkId);
-              for (int j = 0; j < nbvol; j++)
-                if (celldom.count(volParents[j]) && (celldom[volParents[j]] == idomain))
-                  if (!feDom.count(vtkId))
-                    {
-                      feDom[vtkId] = idomain;
-                      faceOrEdgeDom[aCell] = emptyMap;
-                      faceOrEdgeDom[aCell][idomain] = vtkId; // affect face or edge to the first domain only
-                      //MESSAGE("affect cell " << this->GetMeshDS()->fromVtkToSmds(vtkId) << " domain " << idomain
-                      //        << " type " << vtkType << " downId " << downId);
-                    }
+              feDom[vtkId] = idomain;
+              faceOrEdgeDom[aCell] = emptyMap;
+              faceOrEdgeDom[aCell][idomain] = vtkId; // affect face or edge to the first domain only
+              //MESSAGE("affect cell " << this->GetMeshDS()->fromVtkToSmds(vtkId) << " domain " << idomain
+              //        << " type " << vtkType << " downId " << downId);
             }
-        }
+      }
     }
+  }
 
   // --- iterate on shared faces (volumes to modify, face to extrude)
   //     get node id's of the face
@@ -11717,40 +11697,40 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
 
   std::map<DownIdType, std::map<int,int>, DownIdCompare>* maps[3] = {&faceDomains, &cellDomains, &faceOrEdgeDom};
   for (int m=0; m<3; m++)
-    {
-      std::map<DownIdType, std::map<int,int>, DownIdCompare>* amap = maps[m];
-      itface = (*amap).begin();
-      for (; itface != (*amap).end(); ++itface)
+  {
+    std::map<DownIdType, std::map<int,int>, DownIdCompare>* amap = maps[m];
+    itface = (*amap).begin();
+    for (; itface != (*amap).end(); ++itface)
+    {
+      DownIdType face = itface->first;
+      std::set<int> oldNodes;
+      std::set<int>::iterator itn;
+      oldNodes.clear();
+      grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
+      //MESSAGE("examine cell, downId " << face.cellId << " type " << int(face.cellType));
+      std::map<int, int> localClonedNodeIds;
+
+      std::map<int, int> domvol = itface->second;
+      std::map<int, int>::iterator itdom = domvol.begin();
+      for (; itdom != domvol.end(); ++itdom)
+      {
+        int idom = itdom->first;
+        int vtkVolId = itdom->second;
+        //MESSAGE("modify nodes of cell " << this->GetMeshDS()->fromVtkToSmds(vtkVolId) << " domain " << idom);
+        localClonedNodeIds.clear();
+        for (itn = oldNodes.begin(); itn != oldNodes.end(); ++itn)
         {
-          DownIdType face = itface->first;
-          std::set<int> oldNodes;
-          std::set<int>::iterator itn;
-          oldNodes.clear();
-          grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
-          //MESSAGE("examine cell, downId " << face.cellId << " type " << int(face.cellType));
-          std::map<int, int> localClonedNodeIds;
-
-          std::map<int, int> domvol = itface->second;
-          std::map<int, int>::iterator itdom = domvol.begin();
-          for (; itdom != domvol.end(); ++itdom)
-            {
-              int idom = itdom->first;
-              int vtkVolId = itdom->second;
-              //MESSAGE("modify nodes of cell " << this->GetMeshDS()->fromVtkToSmds(vtkVolId) << " domain " << idom);
-              localClonedNodeIds.clear();
-              for (itn = oldNodes.begin(); itn != oldNodes.end(); ++itn)
-                {
-                  int oldId = *itn;
-                  if (nodeDomains[oldId].count(idom))
-                    {
-                      localClonedNodeIds[oldId] = nodeDomains[oldId][idom];
-                      //MESSAGE("     node " << oldId << " --> " << localClonedNodeIds[oldId]);
-                    }
-                }
-              meshDS->ModifyCellNodes(vtkVolId, localClonedNodeIds);
-            }
+          int oldId = *itn;
+          if (nodeDomains[oldId].count(idom))
+          {
+            localClonedNodeIds[oldId] = nodeDomains[oldId][idom];
+            //MESSAGE("     node " << oldId << " --> " << localClonedNodeIds[oldId]);
+          }
         }
+        meshDS->ModifyCellNodes(vtkVolId, localClonedNodeIds);
+      }
     }
+  }
 
   // Remove empty groups (issue 0022812)
   std::map<std::string, SMESH_Group*>::iterator name_group = mapOfJunctionGroups.begin();
@@ -11797,137 +11777,137 @@ bool SMESH_MeshEditor::CreateFlatElementsOnFacesGroups(const std::vector<TIDSort
   std::map<std::string, SMESH_Group*> mapOfJunctionGroups;
   mapOfJunctionGroups.clear();
 
-  for (int idom = 0; idom < theElems.size(); idom++)
+  for ( size_t idom = 0; idom < theElems.size(); idom++ )
+  {
+    const TIDSortedElemSet&           domain = theElems[idom];
+    TIDSortedElemSet::const_iterator elemItr = domain.begin();
+    for ( ; elemItr != domain.end(); ++elemItr )
     {
-      const TIDSortedElemSet& domain = theElems[idom];
-      TIDSortedElemSet::const_iterator elemItr = domain.begin();
-      for (; elemItr != domain.end(); ++elemItr)
-        {
-          SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr;
-          SMDS_MeshFace* aFace = dynamic_cast<SMDS_MeshFace*> (anElem);
-          if (!aFace)
-            continue;
-          // MESSAGE("aFace=" << aFace->GetID());
-          bool isQuad = aFace->IsQuadratic();
-          vector<const SMDS_MeshNode*> ln0, ln1, ln2, ln3, ln4;
-
-          // --- clone the nodes, create intermediate nodes for non medium nodes of a quad face
-
-          SMDS_ElemIteratorPtr nodeIt = aFace->nodesIterator();
-          while (nodeIt->more())
-            {
-              const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*> (nodeIt->next());
-              bool isMedium = isQuad && (aFace->IsMediumNode(node));
-              if (isMedium)
-                ln2.push_back(node);
-              else
-                ln0.push_back(node);
+      SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr;
+      SMDS_MeshFace* aFace = dynamic_cast<SMDS_MeshFace*> (anElem);
+      if (!aFace)
+        continue;
+      // MESSAGE("aFace=" << aFace->GetID());
+      bool isQuad = aFace->IsQuadratic();
+      vector<const SMDS_MeshNode*> ln0, ln1, ln2, ln3, ln4;
 
-              const SMDS_MeshNode* clone = 0;
-              if (!clonedNodes.count(node))
-                {
-                  clone = meshDS->AddNode(node->X(), node->Y(), node->Z());
-                  copyPosition( node, clone );
-                  clonedNodes[node] = clone;
-                }
-              else
-                clone = clonedNodes[node];
+      // --- clone the nodes, create intermediate nodes for non medium nodes of a quad face
 
-              if (isMedium)
-                ln3.push_back(clone);
-              else
-                ln1.push_back(clone);
+      SMDS_ElemIteratorPtr nodeIt = aFace->nodesIterator();
+      while (nodeIt->more())
+      {
+        const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*> (nodeIt->next());
+        bool isMedium = isQuad && (aFace->IsMediumNode(node));
+        if (isMedium)
+          ln2.push_back(node);
+        else
+          ln0.push_back(node);
 
-              const SMDS_MeshNode* inter = 0;
-              if (isQuad && (!isMedium))
-                {
-                  if (!intermediateNodes.count(node))
-                    {
-                      inter = meshDS->AddNode(node->X(), node->Y(), node->Z());
-                      copyPosition( node, inter );
-                      intermediateNodes[node] = inter;
-                    }
-                  else
-                    inter = intermediateNodes[node];
-                  ln4.push_back(inter);
-                }
-            }
+        const SMDS_MeshNode* clone = 0;
+        if (!clonedNodes.count(node))
+        {
+          clone = meshDS->AddNode(node->X(), node->Y(), node->Z());
+          copyPosition( node, clone );
+          clonedNodes[node] = clone;
+        }
+        else
+          clone = clonedNodes[node];
 
-          // --- extrude the face
+        if (isMedium)
+          ln3.push_back(clone);
+        else
+          ln1.push_back(clone);
 
-          vector<const SMDS_MeshNode*> ln;
-          SMDS_MeshVolume* vol = 0;
-          vtkIdType aType = aFace->GetVtkType();
-          switch (aType)
+        const SMDS_MeshNode* inter = 0;
+        if (isQuad && (!isMedium))
+        {
+          if (!intermediateNodes.count(node))
           {
-            case VTK_TRIANGLE:
-              vol = meshDS->AddVolume(ln0[2], ln0[1], ln0[0], ln1[2], ln1[1], ln1[0]);
-              // MESSAGE("vol prism " << vol->GetID());
-              ln.push_back(ln1[0]);
-              ln.push_back(ln1[1]);
-              ln.push_back(ln1[2]);
-              break;
-            case VTK_QUAD:
-              vol = meshDS->AddVolume(ln0[3], ln0[2], ln0[1], ln0[0], ln1[3], ln1[2], ln1[1], ln1[0]);
-              // MESSAGE("vol hexa " << vol->GetID());
-              ln.push_back(ln1[0]);
-              ln.push_back(ln1[1]);
-              ln.push_back(ln1[2]);
-              ln.push_back(ln1[3]);
-              break;
-            case VTK_QUADRATIC_TRIANGLE:
-              vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln0[0], ln0[1], ln0[2], ln3[0], ln3[1], ln3[2],
-                                      ln2[0], ln2[1], ln2[2], ln4[0], ln4[1], ln4[2]);
-              // MESSAGE("vol quad prism " << vol->GetID());
-              ln.push_back(ln1[0]);
-              ln.push_back(ln1[1]);
-              ln.push_back(ln1[2]);
-              ln.push_back(ln3[0]);
-              ln.push_back(ln3[1]);
-              ln.push_back(ln3[2]);
-              break;
-            case VTK_QUADRATIC_QUAD:
-//              vol = meshDS->AddVolume(ln0[0], ln0[1], ln0[2], ln0[3], ln1[0], ln1[1], ln1[2], ln1[3],
-//                                      ln2[0], ln2[1], ln2[2], ln2[3], ln3[0], ln3[1], ln3[2], ln3[3],
-//                                      ln4[0], ln4[1], ln4[2], ln4[3]);
-              vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln1[3], ln0[0], ln0[1], ln0[2], ln0[3],
-                                      ln3[0], ln3[1], ln3[2], ln3[3], ln2[0], ln2[1], ln2[2], ln2[3],
-                                      ln4[0], ln4[1], ln4[2], ln4[3]);
-              // MESSAGE("vol quad hexa " << vol->GetID());
-              ln.push_back(ln1[0]);
-              ln.push_back(ln1[1]);
-              ln.push_back(ln1[2]);
-              ln.push_back(ln1[3]);
-              ln.push_back(ln3[0]);
-              ln.push_back(ln3[1]);
-              ln.push_back(ln3[2]);
-              ln.push_back(ln3[3]);
-              break;
-            case VTK_POLYGON:
-              break;
-            default:
-              break;
+            inter = meshDS->AddNode(node->X(), node->Y(), node->Z());
+            copyPosition( node, inter );
+            intermediateNodes[node] = inter;
           }
+          else
+            inter = intermediateNodes[node];
+          ln4.push_back(inter);
+        }
+      }
 
-          if (vol)
-            {
-              stringstream grpname;
-              grpname << "jf_";
-              grpname << idom;
-              int idg;
-              string namegrp = grpname.str();
-              if (!mapOfJunctionGroups.count(namegrp))
-                mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg);
-              SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
-              if (sgrp)
-                sgrp->Add(vol->GetID());
-            }
+      // --- extrude the face
+
+      vector<const SMDS_MeshNode*> ln;
+      SMDS_MeshVolume* vol = 0;
+      vtkIdType aType = aFace->GetVtkType();
+      switch (aType)
+      {
+      case VTK_TRIANGLE:
+        vol = meshDS->AddVolume(ln0[2], ln0[1], ln0[0], ln1[2], ln1[1], ln1[0]);
+        // MESSAGE("vol prism " << vol->GetID());
+        ln.push_back(ln1[0]);
+        ln.push_back(ln1[1]);
+        ln.push_back(ln1[2]);
+        break;
+      case VTK_QUAD:
+        vol = meshDS->AddVolume(ln0[3], ln0[2], ln0[1], ln0[0], ln1[3], ln1[2], ln1[1], ln1[0]);
+        // MESSAGE("vol hexa " << vol->GetID());
+        ln.push_back(ln1[0]);
+        ln.push_back(ln1[1]);
+        ln.push_back(ln1[2]);
+        ln.push_back(ln1[3]);
+        break;
+      case VTK_QUADRATIC_TRIANGLE:
+        vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln0[0], ln0[1], ln0[2], ln3[0], ln3[1], ln3[2],
+                                ln2[0], ln2[1], ln2[2], ln4[0], ln4[1], ln4[2]);
+        // MESSAGE("vol quad prism " << vol->GetID());
+        ln.push_back(ln1[0]);
+        ln.push_back(ln1[1]);
+        ln.push_back(ln1[2]);
+        ln.push_back(ln3[0]);
+        ln.push_back(ln3[1]);
+        ln.push_back(ln3[2]);
+        break;
+      case VTK_QUADRATIC_QUAD:
+        //              vol = meshDS->AddVolume(ln0[0], ln0[1], ln0[2], ln0[3], ln1[0], ln1[1], ln1[2], ln1[3],
+        //                                      ln2[0], ln2[1], ln2[2], ln2[3], ln3[0], ln3[1], ln3[2], ln3[3],
+        //                                      ln4[0], ln4[1], ln4[2], ln4[3]);
+        vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln1[3], ln0[0], ln0[1], ln0[2], ln0[3],
+                                ln3[0], ln3[1], ln3[2], ln3[3], ln2[0], ln2[1], ln2[2], ln2[3],
+                                ln4[0], ln4[1], ln4[2], ln4[3]);
+        // MESSAGE("vol quad hexa " << vol->GetID());
+        ln.push_back(ln1[0]);
+        ln.push_back(ln1[1]);
+        ln.push_back(ln1[2]);
+        ln.push_back(ln1[3]);
+        ln.push_back(ln3[0]);
+        ln.push_back(ln3[1]);
+        ln.push_back(ln3[2]);
+        ln.push_back(ln3[3]);
+        break;
+      case VTK_POLYGON:
+        break;
+      default:
+        break;
+      }
 
-          // --- modify the face
+      if (vol)
+      {
+        stringstream grpname;
+        grpname << "jf_";
+        grpname << idom;
+        int idg;
+        string namegrp = grpname.str();
+        if (!mapOfJunctionGroups.count(namegrp))
+          mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg);
+        SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
+        if (sgrp)
+          sgrp->Add(vol->GetID());
+      }
 
-          aFace->ChangeNodes(&ln[0], ln.size());
-        }
+      // --- modify the face
+
+      aFace->ChangeNodes(&ln[0], ln.size());
     }
+  }
   return true;
 }
 
@@ -11937,11 +11917,11 @@ bool SMESH_MeshEditor::CreateFlatElementsOnFacesGroups(const std::vector<TIDSort
  *  groups of faces to remove inside the object, (idem edges).
  *  Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
  */
-void SMESH_MeshEditor::CreateHoleSkin(double radius,
-                                      const TopoDS_Shape& theShape,
-                                      SMESH_NodeSearcher* theNodeSearcher,
-                                      const char* groupName,
-                                      std::vector<double>&   nodesCoords,
+void SMESH_MeshEditor::CreateHoleSkin(double                          radius,
+                                      const TopoDS_Shape&             theShape,
+                                      SMESH_NodeSearcher*             theNodeSearcher,
+                                      const char*                     groupName,
+                                      std::vector<double>&            nodesCoords,
                                       std::vector<std::vector<int> >& listOfListOfNodes)
 {
   MESSAGE("--------------------------------");
@@ -11959,28 +11939,28 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   SMESHDS_GroupBase* groupDS = 0;
   SMESH_Mesh::GroupIteratorPtr groupIt = this->myMesh->GetGroups();
   while ( groupIt->more() )
-    {
+  {
+    groupDS = 0;
+    SMESH_Group * group = groupIt->next();
+    if ( !group ) continue;
+    groupDS = group->GetGroupDS();
+    if ( !groupDS || groupDS->IsEmpty() ) continue;
+    std::string grpName = group->GetName();
+    //MESSAGE("grpName=" << grpName);
+    if (grpName == groupName)
+      break;
+    else
       groupDS = 0;
-      SMESH_Group * group = groupIt->next();
-      if ( !group ) continue;
-      groupDS = group->GetGroupDS();
-      if ( !groupDS || groupDS->IsEmpty() ) continue;
-      std::string grpName = group->GetName();
-      //MESSAGE("grpName=" << grpName);
-      if (grpName == groupName)
-        break;
-      else
-        groupDS = 0;
-    }
+  }
 
   bool isNodeGroup = false;
   bool isNodeCoords = false;
   if (groupDS)
-    {
-      if (groupDS->GetType() != SMDSAbs_Node)
-        return;
-      isNodeGroup = true;     // a group of nodes exists and it is in this mesh
-    }
+  {
+    if (groupDS->GetType() != SMDSAbs_Node)
+      return;
+    isNodeGroup = true;     // a group of nodes exists and it is in this mesh
+  }
 
   if (nodesCoords.size() > 0)
     isNodeCoords = true; // a list o nodes given by their coordinates
@@ -11993,10 +11973,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   grpvName += "_vol";
   SMESH_Group *grp = this->myMesh->AddGroup(SMDSAbs_Volume, grpvName.c_str(), idg);
   if (!grp)
-    {
-      MESSAGE("group not created " << grpvName);
-      return;
-    }
+  {
+    MESSAGE("group not created " << grpvName);
+    return;
+  }
   SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(grp->GetGroupDS());
 
   int idgs; // --- group of SMDS faces on the skin
@@ -12004,10 +11984,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   grpsName += "_skin";
   SMESH_Group *grps = this->myMesh->AddGroup(SMDSAbs_Face, grpsName.c_str(), idgs);
   if (!grps)
-    {
-      MESSAGE("group not created " << grpsName);
-      return;
-    }
+  {
+    MESSAGE("group not created " << grpsName);
+    return;
+  }
   SMESHDS_Group *sgrps = dynamic_cast<SMESHDS_Group*>(grps->GetGroupDS());
 
   int idgi; // --- group of SMDS faces internal (several shapes)
@@ -12015,10 +11995,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   grpiName += "_internalFaces";
   SMESH_Group *grpi = this->myMesh->AddGroup(SMDSAbs_Face, grpiName.c_str(), idgi);
   if (!grpi)
-    {
-      MESSAGE("group not created " << grpiName);
-      return;
-    }
+  {
+    MESSAGE("group not created " << grpiName);
+    return;
+  }
   SMESHDS_Group *sgrpi = dynamic_cast<SMESHDS_Group*>(grpi->GetGroupDS());
 
   int idgei; // --- group of SMDS faces internal (several shapes)
@@ -12026,10 +12006,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   grpeiName += "_internalEdges";
   SMESH_Group *grpei = this->myMesh->AddGroup(SMDSAbs_Edge, grpeiName.c_str(), idgei);
   if (!grpei)
-    {
-      MESSAGE("group not created " << grpeiName);
-      return;
-    }
+  {
+    MESSAGE("group not created " << grpeiName);
+    return;
+  }
   SMESHDS_Group *sgrpei = dynamic_cast<SMESHDS_Group*>(grpei->GetGroupDS());
 
   // --- build downward connectivity
@@ -12047,157 +12027,157 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   gpnts.clear();
 
   if (isNodeGroup) // --- a group of nodes is provided : find all the volumes using one or more of this nodes
+  {
+    MESSAGE("group of nodes provided");
+    SMDS_ElemIteratorPtr elemIt = groupDS->GetElements();
+    while ( elemIt->more() )
     {
-      MESSAGE("group of nodes provided");
-      SMDS_ElemIteratorPtr elemIt = groupDS->GetElements();
-      while ( elemIt->more() )
-        {
-          const SMDS_MeshElement* elem = elemIt->next();
-          if (!elem)
-            continue;
-          const SMDS_MeshNode* node = dynamic_cast<const SMDS_MeshNode*>(elem);
-          if (!node)
-            continue;
-          SMDS_MeshElement* vol = 0;
-          SMDS_ElemIteratorPtr volItr = node->GetInverseElementIterator(SMDSAbs_Volume);
-          while (volItr->more())
-            {
-              vol = (SMDS_MeshElement*)volItr->next();
-              setOfInsideVol.insert(vol->getVtkId());
-              sgrp->Add(vol->GetID());
-            }
-        }
+      const SMDS_MeshElement* elem = elemIt->next();
+      if (!elem)
+        continue;
+      const SMDS_MeshNode* node = dynamic_cast<const SMDS_MeshNode*>(elem);
+      if (!node)
+        continue;
+      SMDS_MeshElement* vol = 0;
+      SMDS_ElemIteratorPtr volItr = node->GetInverseElementIterator(SMDSAbs_Volume);
+      while (volItr->more())
+      {
+        vol = (SMDS_MeshElement*)volItr->next();
+        setOfInsideVol.insert(vol->getVtkId());
+        sgrp->Add(vol->GetID());
+      }
     }
+  }
   else if (isNodeCoords)
+  {
+    MESSAGE("list of nodes coordinates provided");
+    size_t i = 0;
+    int k = 0;
+    while ( i < nodesCoords.size()-2 )
     {
-      MESSAGE("list of nodes coordinates provided");
-      int i = 0;
-      int k = 0;
-      while (i < nodesCoords.size()-2)
-        {
-          double x = nodesCoords[i++];
-          double y = nodesCoords[i++];
-          double z = nodesCoords[i++];
-          gp_Pnt p = gp_Pnt(x, y ,z);
-          gpnts.push_back(p);
-          MESSAGE("TopoDS_Vertex " << k << " " << p.X() << " " << p.Y() << " " << p.Z());
-          k++;
-        }
+      double x = nodesCoords[i++];
+      double y = nodesCoords[i++];
+      double z = nodesCoords[i++];
+      gp_Pnt p = gp_Pnt(x, y ,z);
+      gpnts.push_back(p);
+      MESSAGE("TopoDS_Vertex " << k << " " << p.X() << " " << p.Y() << " " << p.Z());
+      k++;
     }
+  }
   else // --- no group, no coordinates : use the vertices of the geom shape provided, and radius
-    {
-      MESSAGE("no group of nodes provided, using vertices from geom shape, and radius");
-      TopTools_IndexedMapOfShape vertexMap;
-      TopExp::MapShapes( theShape, TopAbs_VERTEX, vertexMap );
-      gp_Pnt p = gp_Pnt(0,0,0);
-      if (vertexMap.Extent() < 1)
-        return;
+  {
+    MESSAGE("no group of nodes provided, using vertices from geom shape, and radius");
+    TopTools_IndexedMapOfShape vertexMap;
+    TopExp::MapShapes( theShape, TopAbs_VERTEX, vertexMap );
+    gp_Pnt p = gp_Pnt(0,0,0);
+    if (vertexMap.Extent() < 1)
+      return;
 
-      for ( int i = 1; i <= vertexMap.Extent(); ++i )
-        {
-          const TopoDS_Vertex& vertex = TopoDS::Vertex( vertexMap( i ));
-          p = BRep_Tool::Pnt(vertex);
-          gpnts.push_back(p);
-          MESSAGE("TopoDS_Vertex " << i << " " << p.X() << " " << p.Y() << " " << p.Z());
-        }
+    for ( int i = 1; i <= vertexMap.Extent(); ++i )
+    {
+      const TopoDS_Vertex& vertex = TopoDS::Vertex( vertexMap( i ));
+      p = BRep_Tool::Pnt(vertex);
+      gpnts.push_back(p);
+      MESSAGE("TopoDS_Vertex " << i << " " << p.X() << " " << p.Y() << " " << p.Z());
     }
+  }
 
   if (gpnts.size() > 0)
-    {
-      int nodeId = 0;
-      const SMDS_MeshNode* startNode = theNodeSearcher->FindClosestTo(gpnts[0]);
-      if (startNode)
-        nodeId = startNode->GetID();
-      MESSAGE("nodeId " << nodeId);
+  {
+    int nodeId = 0;
+    const SMDS_MeshNode* startNode = theNodeSearcher->FindClosestTo(gpnts[0]);
+    if (startNode)
+      nodeId = startNode->GetID();
+    MESSAGE("nodeId " << nodeId);
 
-      double radius2 = radius*radius;
-      MESSAGE("radius2 " << radius2);
+    double radius2 = radius*radius;
+    MESSAGE("radius2 " << radius2);
 
-      // --- volumes on start node
+    // --- volumes on start node
 
-      setOfVolToCheck.clear();
-      SMDS_MeshElement* startVol = 0;
-      SMDS_ElemIteratorPtr volItr = startNode->GetInverseElementIterator(SMDSAbs_Volume);
-      while (volItr->more())
-        {
-          startVol = (SMDS_MeshElement*)volItr->next();
-          setOfVolToCheck.insert(startVol->getVtkId());
-        }
-      if (setOfVolToCheck.empty())
-        {
-          MESSAGE("No volumes found");
-          return;
-        }
+    setOfVolToCheck.clear();
+    SMDS_MeshElement* startVol = 0;
+    SMDS_ElemIteratorPtr volItr = startNode->GetInverseElementIterator(SMDSAbs_Volume);
+    while (volItr->more())
+    {
+      startVol = (SMDS_MeshElement*)volItr->next();
+      setOfVolToCheck.insert(startVol->getVtkId());
+    }
+    if (setOfVolToCheck.empty())
+    {
+      MESSAGE("No volumes found");
+      return;
+    }
 
-      // --- starting with central volumes then their neighbors, check if they are inside
-      //     or outside the domain, until no more new neighbor volume is inside.
-      //     Fill the group of inside volumes
+    // --- starting with central volumes then their neighbors, check if they are inside
+    //     or outside the domain, until no more new neighbor volume is inside.
+    //     Fill the group of inside volumes
 
-      std::map<int, double> mapOfNodeDistance2;
-      mapOfNodeDistance2.clear();
-      std::set<int> setOfOutsideVol;
-      while (!setOfVolToCheck.empty())
+    std::map<int, double> mapOfNodeDistance2;
+    mapOfNodeDistance2.clear();
+    std::set<int> setOfOutsideVol;
+    while (!setOfVolToCheck.empty())
+    {
+      std::set<int>::iterator it = setOfVolToCheck.begin();
+      int vtkId = *it;
+      MESSAGE("volume to check,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+      bool volInside = false;
+      vtkIdType npts = 0;
+      vtkIdType* pts = 0;
+      grid->GetCellPoints(vtkId, npts, pts);
+      for (int i=0; i<npts; i++)
+      {
+        double distance2 = 0;
+        if (mapOfNodeDistance2.count(pts[i]))
         {
-          std::set<int>::iterator it = setOfVolToCheck.begin();
-          int vtkId = *it;
-          MESSAGE("volume to check,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
-          bool volInside = false;
-          vtkIdType npts = 0;
-          vtkIdType* pts = 0;
-          grid->GetCellPoints(vtkId, npts, pts);
-          for (int i=0; i<npts; i++)
+          distance2 = mapOfNodeDistance2[pts[i]];
+          MESSAGE("point " << pts[i] << " distance2 " << distance2);
+        }
+        else
+        {
+          double *coords = grid->GetPoint(pts[i]);
+          gp_Pnt aPoint = gp_Pnt(coords[0], coords[1], coords[2]);
+          distance2 = 1.E40;
+          for ( size_t j = 0; j < gpnts.size(); j++ )
+          {
+            double d2 = aPoint.SquareDistance( gpnts[ j ]);
+            if (d2 < distance2)
             {
-              double distance2 = 0;
-              if (mapOfNodeDistance2.count(pts[i]))
-                {
-                  distance2 = mapOfNodeDistance2[pts[i]];
-                  MESSAGE("point " << pts[i] << " distance2 " << distance2);
-                }
-              else
-                {
-                  double *coords = grid->GetPoint(pts[i]);
-                  gp_Pnt aPoint = gp_Pnt(coords[0], coords[1], coords[2]);
-                  distance2 = 1.E40;
-                  for (int j=0; j<gpnts.size(); j++)
-                    {
-                      double d2 = aPoint.SquareDistance(gpnts[j]);
-                      if (d2 < distance2)
-                        {
-                          distance2 = d2;
-                          if (distance2 < radius2)
-                            break;
-                        }
-                    }
-                  mapOfNodeDistance2[pts[i]] = distance2;
-                  MESSAGE("  point "  << pts[i]  << " distance2 " << distance2 << " coords " << coords[0] << " " << coords[1] << " " <<  coords[2]);
-                }
+              distance2 = d2;
               if (distance2 < radius2)
-                {
-                  volInside = true; // one or more nodes inside the domain
-                  sgrp->Add(meshDS->fromVtkToSmds(vtkId));
-                  break;
-                }
-            }
-          if (volInside)
-            {
-              setOfInsideVol.insert(vtkId);
-              MESSAGE("  volume inside,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
-              int neighborsVtkIds[NBMAXNEIGHBORS];
-              int downIds[NBMAXNEIGHBORS];
-              unsigned char downTypes[NBMAXNEIGHBORS];
-              int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
-              for (int n = 0; n < nbNeighbors; n++)
-                if (!setOfInsideVol.count(neighborsVtkIds[n]) ||setOfOutsideVol.count(neighborsVtkIds[n]))
-                  setOfVolToCheck.insert(neighborsVtkIds[n]);
-            }
-          else
-            {
-              setOfOutsideVol.insert(vtkId);
-              MESSAGE("  volume outside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+                break;
             }
-          setOfVolToCheck.erase(vtkId);
+          }
+          mapOfNodeDistance2[pts[i]] = distance2;
+          MESSAGE("  point "  << pts[i]  << " distance2 " << distance2 << " coords " << coords[0] << " " << coords[1] << " " <<  coords[2]);
         }
+        if (distance2 < radius2)
+        {
+          volInside = true; // one or more nodes inside the domain
+          sgrp->Add(meshDS->fromVtkToSmds(vtkId));
+          break;
+        }
+      }
+      if (volInside)
+      {
+        setOfInsideVol.insert(vtkId);
+        MESSAGE("  volume inside,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+        int neighborsVtkIds[NBMAXNEIGHBORS];
+        int downIds[NBMAXNEIGHBORS];
+        unsigned char downTypes[NBMAXNEIGHBORS];
+        int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
+        for (int n = 0; n < nbNeighbors; n++)
+          if (!setOfInsideVol.count(neighborsVtkIds[n]) ||setOfOutsideVol.count(neighborsVtkIds[n]))
+            setOfVolToCheck.insert(neighborsVtkIds[n]);
+      }
+      else
+      {
+        setOfOutsideVol.insert(vtkId);
+        MESSAGE("  volume outside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+      }
+      setOfVolToCheck.erase(vtkId);
     }
+  }
 
   // --- for outside hexahedrons, check if they have more than one neighbor volume inside
   //     If yes, add the volume to the inside set
@@ -12205,52 +12185,52 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   bool addedInside = true;
   std::set<int> setOfVolToReCheck;
   while (addedInside)
+  {
+    MESSAGE(" --------------------------- re check");
+    addedInside = false;
+    std::set<int>::iterator itv = setOfInsideVol.begin();
+    for (; itv != setOfInsideVol.end(); ++itv)
     {
-      MESSAGE(" --------------------------- re check");
-      addedInside = false;
-      std::set<int>::iterator itv = setOfInsideVol.begin();
-      for (; itv != setOfInsideVol.end(); ++itv)
-        {
-          int vtkId = *itv;
-          int neighborsVtkIds[NBMAXNEIGHBORS];
-          int downIds[NBMAXNEIGHBORS];
-          unsigned char downTypes[NBMAXNEIGHBORS];
-          int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
-          for (int n = 0; n < nbNeighbors; n++)
-            if (!setOfInsideVol.count(neighborsVtkIds[n]))
-              setOfVolToReCheck.insert(neighborsVtkIds[n]);
-        }
-      setOfVolToCheck = setOfVolToReCheck;
-      setOfVolToReCheck.clear();
-      while  (!setOfVolToCheck.empty())
+      int vtkId = *itv;
+      int neighborsVtkIds[NBMAXNEIGHBORS];
+      int downIds[NBMAXNEIGHBORS];
+      unsigned char downTypes[NBMAXNEIGHBORS];
+      int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
+      for (int n = 0; n < nbNeighbors; n++)
+        if (!setOfInsideVol.count(neighborsVtkIds[n]))
+          setOfVolToReCheck.insert(neighborsVtkIds[n]);
+    }
+    setOfVolToCheck = setOfVolToReCheck;
+    setOfVolToReCheck.clear();
+    while  (!setOfVolToCheck.empty())
+    {
+      std::set<int>::iterator it = setOfVolToCheck.begin();
+      int vtkId = *it;
+      if (grid->GetCellType(vtkId) == VTK_HEXAHEDRON)
+      {
+        MESSAGE("volume to recheck,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+        int countInside = 0;
+        int neighborsVtkIds[NBMAXNEIGHBORS];
+        int downIds[NBMAXNEIGHBORS];
+        unsigned char downTypes[NBMAXNEIGHBORS];
+        int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
+        for (int n = 0; n < nbNeighbors; n++)
+          if (setOfInsideVol.count(neighborsVtkIds[n]))
+            countInside++;
+        MESSAGE("countInside " << countInside);
+        if (countInside > 1)
         {
-          std::set<int>::iterator it = setOfVolToCheck.begin();
-          int vtkId = *it;
-          if (grid->GetCellType(vtkId) == VTK_HEXAHEDRON)
-            {
-              MESSAGE("volume to recheck,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
-              int countInside = 0;
-              int neighborsVtkIds[NBMAXNEIGHBORS];
-              int downIds[NBMAXNEIGHBORS];
-              unsigned char downTypes[NBMAXNEIGHBORS];
-              int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
-              for (int n = 0; n < nbNeighbors; n++)
-                if (setOfInsideVol.count(neighborsVtkIds[n]))
-                  countInside++;
-              MESSAGE("countInside " << countInside);
-              if (countInside > 1)
-                {
-                  MESSAGE("  volume inside,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
-                  setOfInsideVol.insert(vtkId);
-                  sgrp->Add(meshDS->fromVtkToSmds(vtkId));
-                  addedInside = true;
-                }
-              else
-                setOfVolToReCheck.insert(vtkId);
-            }
-          setOfVolToCheck.erase(vtkId);
+          MESSAGE("  volume inside,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+          setOfInsideVol.insert(vtkId);
+          sgrp->Add(meshDS->fromVtkToSmds(vtkId));
+          addedInside = true;
         }
+        else
+          setOfVolToReCheck.insert(vtkId);
+      }
+      setOfVolToCheck.erase(vtkId);
     }
+  }
 
   // --- map of Downward faces at the boundary, inside the global volume
   //     map of Downward faces on the skin of the global volume (equivalent to SMDS faces on the skin)
@@ -12261,50 +12241,50 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
   std::map<DownIdType, int, DownIdCompare> skinFaces;     // faces on the skin of the global volume --> corresponding cell
   std::set<int>::iterator it = setOfInsideVol.begin();
   for (; it != setOfInsideVol.end(); ++it)
-    {
-      int vtkId = *it;
-      //MESSAGE("  vtkId " << vtkId  << " smdsId " << meshDS->fromVtkToSmds(vtkId));
-      int neighborsVtkIds[NBMAXNEIGHBORS];
-      int downIds[NBMAXNEIGHBORS];
-      unsigned char downTypes[NBMAXNEIGHBORS];
-      int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId, true);
-      for (int n = 0; n < nbNeighbors; n++)
+  {
+    int vtkId = *it;
+    //MESSAGE("  vtkId " << vtkId  << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+    int neighborsVtkIds[NBMAXNEIGHBORS];
+    int downIds[NBMAXNEIGHBORS];
+    unsigned char downTypes[NBMAXNEIGHBORS];
+    int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId, true);
+    for (int n = 0; n < nbNeighbors; n++)
+    {
+      int neighborDim = SMDS_Downward::getCellDimension(grid->GetCellType(neighborsVtkIds[n]));
+      if (neighborDim == 3)
+      {
+        if (! setOfInsideVol.count(neighborsVtkIds[n])) // neighbor volume is not inside : face is boundary
         {
-          int neighborDim = SMDS_Downward::getCellDimension(grid->GetCellType(neighborsVtkIds[n]));
-          if (neighborDim == 3)
-            {
-              if (! setOfInsideVol.count(neighborsVtkIds[n])) // neighbor volume is not inside : face is boundary
-                {
-                  DownIdType face(downIds[n], downTypes[n]);
-                  boundaryFaces[face] = vtkId;
-                }
-              // if the face between to volumes is in the mesh, get it (internal face between shapes)
-              int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]);
-              if (vtkFaceId >= 0)
-                {
-                  sgrpi->Add(meshDS->fromVtkToSmds(vtkFaceId));
-                  // find also the smds edges on this face
-                  int nbEdges = grid->getDownArray(downTypes[n])->getNumberOfDownCells(downIds[n]);
-                  const int* dEdges = grid->getDownArray(downTypes[n])->getDownCells(downIds[n]);
-                  const unsigned char* dTypes = grid->getDownArray(downTypes[n])->getDownTypes(downIds[n]);
-                  for (int i = 0; i < nbEdges; i++)
-                    {
-                      int vtkEdgeId = grid->getDownArray(dTypes[i])->getVtkCellId(dEdges[i]);
-                      if (vtkEdgeId >= 0)
-                        sgrpei->Add(meshDS->fromVtkToSmds(vtkEdgeId));
-                    }
-                }
-            }
-          else if (neighborDim == 2) // skin of the volume
-            {
-              DownIdType face(downIds[n], downTypes[n]);
-              skinFaces[face] = vtkId;
-              int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]);
-              if (vtkFaceId >= 0)
-                sgrps->Add(meshDS->fromVtkToSmds(vtkFaceId));
-            }
+          DownIdType face(downIds[n], downTypes[n]);
+          boundaryFaces[face] = vtkId;
         }
+        // if the face between to volumes is in the mesh, get it (internal face between shapes)
+        int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]);
+        if (vtkFaceId >= 0)
+        {
+          sgrpi->Add(meshDS->fromVtkToSmds(vtkFaceId));
+          // find also the smds edges on this face
+          int nbEdges = grid->getDownArray(downTypes[n])->getNumberOfDownCells(downIds[n]);
+          const int* dEdges = grid->getDownArray(downTypes[n])->getDownCells(downIds[n]);
+          const unsigned char* dTypes = grid->getDownArray(downTypes[n])->getDownTypes(downIds[n]);
+          for (int i = 0; i < nbEdges; i++)
+          {
+            int vtkEdgeId = grid->getDownArray(dTypes[i])->getVtkCellId(dEdges[i]);
+            if (vtkEdgeId >= 0)
+              sgrpei->Add(meshDS->fromVtkToSmds(vtkEdgeId));
+          }
+        }
+      }
+      else if (neighborDim == 2) // skin of the volume
+      {
+        DownIdType face(downIds[n], downTypes[n]);
+        skinFaces[face] = vtkId;
+        int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]);
+        if (vtkFaceId >= 0)
+          sgrps->Add(meshDS->fromVtkToSmds(vtkFaceId));
+      }
     }
+  }
 
   // --- identify the edges constituting the wire of each subshape on the skin
   //     define polylines with the nodes of edges, equivalent to wires
@@ -12317,17 +12297,17 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
 
   SMDS_ElemIteratorPtr itelem = sgrps->GetElements();
   while (itelem->more())
+  {
+    const SMDS_MeshElement *elem = itelem->next();
+    int shapeId = elem->getshapeId();
+    int vtkId = elem->getVtkId();
+    if (!shapeIdToVtkIdSet.count(shapeId))
     {
-      const SMDS_MeshElement *elem = itelem->next();
-      int shapeId = elem->getshapeId();
-      int vtkId = elem->getVtkId();
-      if (!shapeIdToVtkIdSet.count(shapeId))
-        {
-          shapeIdToVtkIdSet[shapeId] = emptySet;
-          shapeIds.insert(shapeId);
-        }
-      shapeIdToVtkIdSet[shapeId].insert(vtkId);
+      shapeIdToVtkIdSet[shapeId] = emptySet;
+      shapeIds.insert(shapeId);
     }
+    shapeIdToVtkIdSet[shapeId].insert(vtkId);
+  }
 
   std::map<int, std::set<DownIdType, DownIdCompare> > shapeIdToEdges; // shapeId --> set of downward edges
   std::set<DownIdType, DownIdCompare> emptyEdges;
@@ -12335,125 +12315,125 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
 
   std::map<int, std::set<int> >::iterator itShape =  shapeIdToVtkIdSet.begin();
   for (; itShape != shapeIdToVtkIdSet.end(); ++itShape)
-    {
-      int shapeId = itShape->first;
-      MESSAGE(" --- Shape ID --- "<< shapeId);
-      shapeIdToEdges[shapeId] = emptyEdges;
+  {
+    int shapeId = itShape->first;
+    MESSAGE(" --- Shape ID --- "<< shapeId);
+    shapeIdToEdges[shapeId] = emptyEdges;
 
-      std::vector<int> nodesEdges;
+    std::vector<int> nodesEdges;
 
-      std::set<int>::iterator its = itShape->second.begin();
-      for (; its != itShape->second.end(); ++its)
+    std::set<int>::iterator its = itShape->second.begin();
+    for (; its != itShape->second.end(); ++its)
+    {
+      int vtkId = *its;
+      MESSAGE("     " << vtkId);
+      int neighborsVtkIds[NBMAXNEIGHBORS];
+      int downIds[NBMAXNEIGHBORS];
+      unsigned char downTypes[NBMAXNEIGHBORS];
+      int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
+      for (int n = 0; n < nbNeighbors; n++)
+      {
+        if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here
+          continue;
+        int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]);
+        const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
+        if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group
         {
-          int vtkId = *its;
-          MESSAGE("     " << vtkId);
-          int neighborsVtkIds[NBMAXNEIGHBORS];
-          int downIds[NBMAXNEIGHBORS];
-          unsigned char downTypes[NBMAXNEIGHBORS];
-          int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
-          for (int n = 0; n < nbNeighbors; n++)
-            {
-              if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here
-                continue;
-              int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]);
-              const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
-              if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group
-                {
-                  DownIdType edge(downIds[n], downTypes[n]);
-                  if (!shapeIdToEdges[shapeId].count(edge))
-                    {
-                      shapeIdToEdges[shapeId].insert(edge);
-                      int vtkNodeId[3];
-                      int nbNodes = grid->getDownArray(downTypes[n])->getNodes(downIds[n],vtkNodeId);
-                      nodesEdges.push_back(vtkNodeId[0]);
-                      nodesEdges.push_back(vtkNodeId[nbNodes-1]);
-                      MESSAGE("       --- nodes " << vtkNodeId[0]+1 << " " << vtkNodeId[nbNodes-1]+1);
-                    }
-                }
-            }
+          DownIdType edge(downIds[n], downTypes[n]);
+          if (!shapeIdToEdges[shapeId].count(edge))
+          {
+            shapeIdToEdges[shapeId].insert(edge);
+            int vtkNodeId[3];
+            int nbNodes = grid->getDownArray(downTypes[n])->getNodes(downIds[n],vtkNodeId);
+            nodesEdges.push_back(vtkNodeId[0]);
+            nodesEdges.push_back(vtkNodeId[nbNodes-1]);
+            MESSAGE("       --- nodes " << vtkNodeId[0]+1 << " " << vtkNodeId[nbNodes-1]+1);
+          }
         }
+      }
+    }
 
-      std::list<int> order;
-      order.clear();
-      if (nodesEdges.size() > 0)
+    std::list<int> order;
+    order.clear();
+    if (nodesEdges.size() > 0)
+    {
+      order.push_back(nodesEdges[0]); MESSAGE("       --- back " << order.back()+1); // SMDS id = VTK id + 1;
+      nodesEdges[0] = -1;
+      order.push_back(nodesEdges[1]); MESSAGE("       --- back " << order.back()+1);
+      nodesEdges[1] = -1; // do not reuse this edge
+      bool found = true;
+      while (found)
+      {
+        int nodeTofind = order.back(); // try first to push back
+        int i = 0;
+        for ( i = 0; i < (int)nodesEdges.size(); i++ )
+          if (nodesEdges[i] == nodeTofind)
+            break;
+        if ( i == (int) nodesEdges.size() )
+          found = false; // no follower found on back
+        else
         {
-          order.push_back(nodesEdges[0]); MESSAGE("       --- back " << order.back()+1); // SMDS id = VTK id + 1;
-          nodesEdges[0] = -1;
-          order.push_back(nodesEdges[1]); MESSAGE("       --- back " << order.back()+1);
-          nodesEdges[1] = -1; // do not reuse this edge
-          bool found = true;
-          while (found)
+          if (i%2) // odd ==> use the previous one
+            if (nodesEdges[i-1] < 0)
+              found = false;
+            else
             {
-              int nodeTofind = order.back(); // try first to push back
-              int i = 0;
-              for (i = 0; i<nodesEdges.size(); i++)
-                if (nodesEdges[i] == nodeTofind)
-                  break;
-              if (i == nodesEdges.size())
-                found = false; // no follower found on back
-              else
-                {
-                  if (i%2) // odd ==> use the previous one
-                    if (nodesEdges[i-1] < 0)
-                      found = false;
-                    else
-                      {
-                        order.push_back(nodesEdges[i-1]); MESSAGE("       --- back " << order.back()+1);
-                        nodesEdges[i-1] = -1;
-                      }
-                  else // even ==> use the next one
-                    if (nodesEdges[i+1] < 0)
-                      found = false;
-                    else
-                      {
-                        order.push_back(nodesEdges[i+1]); MESSAGE("       --- back " << order.back()+1);
-                        nodesEdges[i+1] = -1;
-                      }
-                }
-              if (found)
-                continue;
-              // try to push front
-              found = true;
-              nodeTofind = order.front(); // try to push front
-              for (i = 0; i<nodesEdges.size(); i++)
-                if (nodesEdges[i] == nodeTofind)
-                  break;
-              if (i == nodesEdges.size())
-                {
-                  found = false; // no predecessor found on front
-                  continue;
-                }
-              if (i%2) // odd ==> use the previous one
-                if (nodesEdges[i-1] < 0)
-                  found = false;
-                else
-                  {
-                    order.push_front(nodesEdges[i-1]); MESSAGE("       --- front " << order.front()+1);
-                    nodesEdges[i-1] = -1;
-                  }
-              else // even ==> use the next one
-                if (nodesEdges[i+1] < 0)
-                  found = false;
-                else
-                  {
-                    order.push_front(nodesEdges[i+1]); MESSAGE("       --- front " << order.front()+1);
-                    nodesEdges[i+1] = -1;
-                  }
+              order.push_back(nodesEdges[i-1]); MESSAGE("       --- back " << order.back()+1);
+              nodesEdges[i-1] = -1;
+            }
+          else // even ==> use the next one
+            if (nodesEdges[i+1] < 0)
+              found = false;
+            else
+            {
+              order.push_back(nodesEdges[i+1]); MESSAGE("       --- back " << order.back()+1);
+              nodesEdges[i+1] = -1;
             }
         }
-
-
-      std::vector<int> nodes;
-      nodes.push_back(shapeId);
-      std::list<int>::iterator itl = order.begin();
-      for (; itl != order.end(); itl++)
+        if (found)
+          continue;
+        // try to push front
+        found = true;
+        nodeTofind = order.front(); // try to push front
+        for ( i = 0;  i < (int)nodesEdges.size(); i++ )
+          if ( nodesEdges[i] == nodeTofind )
+            break;
+        if ( i == (int)nodesEdges.size() )
         {
-          nodes.push_back((*itl) + 1); // SMDS id = VTK id + 1;
-          MESSAGE("              ordered node " << nodes[nodes.size()-1]);
+          found = false; // no predecessor found on front
+          continue;
         }
-      listOfListOfNodes.push_back(nodes);
+        if (i%2) // odd ==> use the previous one
+          if (nodesEdges[i-1] < 0)
+            found = false;
+          else
+          {
+            order.push_front(nodesEdges[i-1]); MESSAGE("       --- front " << order.front()+1);
+            nodesEdges[i-1] = -1;
+          }
+        else // even ==> use the next one
+          if (nodesEdges[i+1] < 0)
+            found = false;
+          else
+          {
+            order.push_front(nodesEdges[i+1]); MESSAGE("       --- front " << order.front()+1);
+            nodesEdges[i+1] = -1;
+          }
+      }
     }
 
+
+    std::vector<int> nodes;
+    nodes.push_back(shapeId);
+    std::list<int>::iterator itl = order.begin();
+    for (; itl != order.end(); itl++)
+    {
+      nodes.push_back((*itl) + 1); // SMDS id = VTK id + 1;
+      MESSAGE("              ordered node " << nodes[nodes.size()-1]);
+    }
+    listOfListOfNodes.push_back(nodes);
+  }
+
   //     partition geom faces with blocFissure
   //     mesh blocFissure and geom faces of the skin (external wires given, triangle algo to choose)
   //     mesh volume around blocFissure (skin triangles and quadrangle given, tetra algo to choose)
@@ -12627,10 +12607,10 @@ int SMESH_MeshEditor::MakeBoundaryMesh(const TIDSortedElemSet& elements,
         if ( missType == SMDSAbs_Edge ) // boundary edges
         {
           nodes.resize( 2+iQuad );
-          for ( int i = 0; i < nbFaceNodes; i += 1+iQuad)
+          for ( size_t i = 0; i < nbFaceNodes; i += 1+iQuad )
           {
-            for ( int j = 0; j < nodes.size(); ++j )
-              nodes[j] = nn[ i+j ];
+            for ( size_t j = 0; j < nodes.size(); ++j )
+              nodes[ j ] = nn[ i+j ];
             if ( const SMDS_MeshElement* edge =
                  aMesh->FindElement( nodes, SMDSAbs_Edge, /*noMedium=*/false ))
               presentBndElems.push_back( edge );
@@ -12717,14 +12697,14 @@ int SMESH_MeshEditor::MakeBoundaryMesh(const TIDSortedElemSet& elements,
         ++nbAddedBnd;
       }
     else
-      for ( int i = 0; i < missingBndElems.size(); ++i )
+      for ( size_t i = 0; i < missingBndElems.size(); ++i )
       {
-        TConnectivity& nodes = missingBndElems[i];
+        TConnectivity& nodes = missingBndElems[ i ];
         if ( aroundElements && tgtEditor.GetMeshDS()->FindElement( nodes,
                                                                    missType,
                                                                    /*noMedium=*/false))
           continue;
-        SMDS_MeshElement* newElem = 
+        SMDS_MeshElement* newElem =
           tgtEditor.AddElement( nodes, elemKind.SetPoly( nodes.size()/(iQuad+1) > 4 ));
         nbAddedBnd += bool( newElem );
 
@@ -12761,18 +12741,18 @@ int SMESH_MeshEditor::MakeBoundaryMesh(const TIDSortedElemSet& elements,
     // 3. Copy present boundary elements
     // ----------------------------------
     if ( toCopyExistingBoundary )
-      for ( int i = 0 ; i < presentBndElems.size(); ++i )
+      for ( size_t i = 0 ; i < presentBndElems.size(); ++i )
       {
         const SMDS_MeshElement* e = presentBndElems[i];
         tgtNodes.resize( e->NbNodes() );
-        for ( inode = 0; inode < nodes.size(); ++inode )
+        for ( inode = 0; inode < tgtNodes.size(); ++inode )
           tgtNodes[inode] = getNodeWithSameID( tgtMeshDS, e->GetNode(inode) );
         presentEditor->AddElement( tgtNodes, elemToCopy.Init( e ));
       }
     else // store present elements to add them to a group
-      for ( int i = 0 ; i < presentBndElems.size(); ++i )
+      for ( size_t i = 0 ; i < presentBndElems.size(); ++i )
       {
-        presentEditor->myLastCreatedElems.Append( presentBndElems[i] );
+        presentEditor->myLastCreatedElems.Append( presentBndElems[ i ]);
       }
 
   } // loop on given elements
index 13bf425ab52c4e64225e600fe7261134d4893268..f9695c9a1729841a71475d07139bdeb358072757 100644 (file)
@@ -93,11 +93,11 @@ public:
     SMESH_EXPORT ElemFeatures& Init( double diameter )
     { myType = SMDSAbs_Ball; myBallDiameter = diameter; return *this; }
 
-    SMESH_EXPORT ElemFeatures& Init( vector<int>& quanities, bool isQuad=false )
+    SMESH_EXPORT ElemFeatures& Init( std::vector<int>& quanities, bool isQuad=false )
     { myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad;
       myPolyhedQuantities.swap( quanities ); return *this; }
 
-    SMESH_EXPORT ElemFeatures& Init( const vector<int>& quanities, bool isQuad=false )
+    SMESH_EXPORT ElemFeatures& Init( const std::vector<int>& quanities, bool isQuad=false )
     { myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad;
       myPolyhedQuantities = quanities; return *this; }
 
@@ -730,7 +730,7 @@ public:
   void sweepElement(const SMDS_MeshElement*                    elem,
                     const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
                     std::list<const SMDS_MeshElement*>&        newElems,
-                    const int                                  nbSteps,
+                    const size_t                               nbSteps,
                     SMESH_SequenceOfElemPtr&                   srcElements);
 
   /*!
@@ -777,8 +777,8 @@ public:
                                    const bool                             theHasRefPoint,
                                    const gp_Pnt&                          theRefPoint,
                                    const bool                             theMakeGroups);
-  void LinearAngleVariation(const int     NbSteps,
-                            list<double>& theAngles);
+  void LinearAngleVariation(const int          NbSteps,
+                            std::list<double>& theAngles);
 
   bool doubleNodes( SMESHDS_Mesh*           theMeshDS,
                     const TIDSortedElemSet& theElems,
index 3ceea9fa34ca191c0b8aed017df5ff22f2b41a06..3703a7215de3c4d0e89733d5da826d9c539f0615 100644 (file)
@@ -139,7 +139,7 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
   SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge );
 
 
-  int nbOldLinks = myTLinkNodeMap.size();
+  //int nbOldLinks = myTLinkNodeMap.size();
 
   if ( !myMesh->HasShapeToMesh() )
   {
@@ -2070,7 +2070,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector<const SMDS_Mes
   {
     vector<const SMDS_MeshNode*> newNodes( nodes.size() * 2 );
     newNodes = nodes;
-    for ( int i = 0; i < nodes.size(); ++i )
+    for ( size_t i = 0; i < nodes.size(); ++i )
     {
       const SMDS_MeshNode* n1 = nodes[i];
       const SMDS_MeshNode* n2 = nodes[(i+1)%nodes.size()];
@@ -2393,7 +2393,7 @@ SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>
   {
     vector<const SMDS_MeshNode*> newNodes;
     vector<int> newQuantities;
-    for ( int iFace=0, iN=0; iFace < quantities.size(); ++iFace)
+    for ( size_t iFace = 0, iN = 0; iFace < quantities.size(); ++iFace )
     {
       int nbNodesInFace = quantities[iFace];
       newQuantities.push_back(0);
@@ -2402,10 +2402,10 @@ SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>
         const SMDS_MeshNode* n1 = nodes[ iN + i ];
         newNodes.push_back( n1 );
         newQuantities.back()++;
-        
+
         const SMDS_MeshNode* n2 = nodes[ iN + ( i+1==nbNodesInFace ? 0 : i+1 )];
-//         if ( n1->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE &&
-//              n2->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE )
+        // if ( n1->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE &&
+        //      n2->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE )
         {
           const SMDS_MeshNode* n12 = GetMediumNode( n1, n2, force3d, TopAbs_SOLID );
           newNodes.push_back( n12 );
@@ -2606,8 +2606,8 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap &            theParam2
   }
 
   // nb rows of nodes
-  int prevNbRows     = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here
-  int expectedNbRows = faceSubMesh->NbElements() / ( theParam2ColumnMap.size()-1 ); // to be added
+  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
   // theBaseEdge up via mesh faces on theFace
@@ -2620,10 +2620,10 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap &            theParam2
   {
     vector<const SMDS_MeshNode*>& nCol1 = par_nVec_1->second;
     vector<const SMDS_MeshNode*>& nCol2 = par_nVec_2->second;
-    nCol1.resize( prevNbRows + expectedNbRows );
-    nCol2.resize( prevNbRows + expectedNbRows );
+    nCol1.resize( prevNbRows + expectNbRows );
+    nCol2.resize( prevNbRows + expectNbRows );
 
-    int i1, i2, foundNbRows = 0;
+    int i1, i2; size_t foundNbRows = 0;
     const SMDS_MeshNode *n1 = nCol1[ prevNbRows-1 ];
     const SMDS_MeshNode *n2 = nCol2[ prevNbRows-1 ];
     // find face sharing node n1 and n2 and belonging to faceSubMesh
@@ -2635,7 +2635,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap &            theParam2
         int nbNodes = face->NbCornerNodes();
         if ( nbNodes != 4 )
           return false;
-        if ( foundNbRows + 1 > expectedNbRows )
+        if ( foundNbRows + 1 > expectNbRows )
           return false;
         n1 = face->GetNode( (i2+2) % 4 ); // opposite corner of quadrangle face
         n2 = face->GetNode( (i1+2) % 4 );
@@ -2645,12 +2645,12 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap &            theParam2
       }
       avoidSet.insert( face );
     }
-    if ( foundNbRows != expectedNbRows )
+    if ((size_t) foundNbRows != expectNbRows )
       return false;
     avoidSet.clear();
   }
   return ( theParam2ColumnMap.size() > 1 &&
-           theParam2ColumnMap.begin()->second.size() == prevNbRows + expectedNbRows );
+           theParam2ColumnMap.begin()->second.size() == prevNbRows + expectNbRows );
 }
 
 namespace
@@ -3553,11 +3553,11 @@ namespace { // Structures used by FixQuadraticElements()
     int NbVolumes() const { return !_volumes[0] ? 0 : !_volumes[1] ? 1 : 2; }
 
     void AddSelfToLinks() const {
-      for ( int i = 0; i < _sides.size(); ++i )
+      for ( size_t i = 0; i < _sides.size(); ++i )
         _sides[i]->_faces.push_back( this );
     }
     int LinkIndex( const QLink* side ) const {
-      for (int i=0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i;
+      for (size_t i = 0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i;
       return -1;
     }
     bool GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& err) const;
@@ -3589,7 +3589,7 @@ namespace { // Structures used by FixQuadraticElements()
                               const SMDS_MeshNode* nodeToContain) const;
 
     const SMDS_MeshNode* GetNodeInFace() const {
-      for ( int iL = 0; iL < _sides.size(); ++iL )
+      for ( size_t iL = 0; iL < _sides.size(); ++iL )
         if ( _sides[iL]->MediumPos() == SMDS_TOP_FACE ) return _sides[iL]->_mediumNode;
       return 0;
     }
@@ -3642,7 +3642,7 @@ namespace { // Structures used by FixQuadraticElements()
     _sides = links;
     _sideIsAdded[0]=_sideIsAdded[1]=_sideIsAdded[2]=_sideIsAdded[3]=false;
     _normal.SetCoord(0,0,0);
-    for ( int i = 1; i < _sides.size(); ++i ) {
+    for ( size_t i = 1; i < _sides.size(); ++i ) {
       const QLink *l1 = _sides[i-1], *l2 = _sides[i];
       insert( l1->node1() ); insert( l1->node2() );
       // compute normal
@@ -3676,7 +3676,7 @@ namespace { // Structures used by FixQuadraticElements()
 
   bool QFace::GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& error) const
   {
-    if ( iSide >= _sides.size() ) // wrong argument iSide
+    if ( iSide >= (int)_sides.size() ) // wrong argument iSide
       return false;
     if ( _sideIsAdded[ iSide ]) // already in chain
       return true;
@@ -3687,7 +3687,7 @@ namespace { // Structures used by FixQuadraticElements()
       list< const QFace* > faces( 1, this );
       while ( !faces.empty() ) {
         const QFace* face = faces.front();
-        for ( int i = 0; i < face->_sides.size(); ++i ) {
+        for ( size_t i = 0; i < face->_sides.size(); ++i ) {
           if ( !face->_sideIsAdded[i] && face->_sides[i] ) {
             face->_sideIsAdded[i] = true;
             // find a face side in the chain
@@ -3770,7 +3770,7 @@ namespace { // Structures used by FixQuadraticElements()
     typedef list< pair< const QFace*, TLinkInSet > > TFaceLinkList;
     TFaceLinkList adjacentFaces;
 
-    for ( int iL = 0; iL < _sides.size(); ++iL )
+    for ( size_t iL = 0; iL < _sides.size(); ++iL )
     {
       if ( avoidLink._qlink == _sides[iL] )
         continue;
@@ -3823,10 +3823,10 @@ namespace { // Structures used by FixQuadraticElements()
                                    const TChainLink&    avoidLink,
                                    const SMDS_MeshNode* nodeToContain) const
   {
-    for ( int i = 0; i < _sides.size(); ++i )
+    for ( size_t i = 0; i < _sides.size(); ++i )
       if ( avoidLink._qlink != _sides[i] &&
            (_sides[i]->node1() == nodeToContain || _sides[i]->node2() == nodeToContain ))
-        return links.find( _sides[ i ]);
+        return links.find( _sides[i] );
     return links.end();
   }
 
@@ -3877,7 +3877,7 @@ namespace { // Structures used by FixQuadraticElements()
     if ( !theStep )
       return thePrevLen; // propagation limit reached
 
-    int iL; // index of theLink
+    size_t iL; // index of theLink
     for ( iL = 0; iL < _sides.size(); ++iL )
       if ( theLink._qlink == _sides[ iL ])
         break;
@@ -4017,7 +4017,7 @@ namespace { // Structures used by FixQuadraticElements()
     int iFaceCont = -1, nbBoundary = 0, iBoundary[2]={-1,-1};
     if ( _faces[0]->IsBoundary() )
       iBoundary[ nbBoundary++ ] = 0;
-    for ( int iF = 1; iFaceCont < 0 && iF < _faces.size(); ++iF )
+    for ( size_t iF = 1; iFaceCont < 0 && iF < _faces.size(); ++iF )
     {
       // look for a face bounding none of volumes bound by _faces[0]
       bool sameVol = false;
@@ -4059,12 +4059,13 @@ namespace { // Structures used by FixQuadraticElements()
 
   const QFace* QLink::GetContinuesFace( const QFace* face ) const
   {
-    for ( int i = 0; i < _faces.size(); ++i ) {
-      if ( _faces[i] == face ) {
-        int iF = i < 2 ? 1-i : 5-i;
-        return iF < _faces.size() ? _faces[iF] : 0;
+    if ( _faces.size() <= 4 )
+      for ( size_t i = 0; i < _faces.size(); ++i ) {
+        if ( _faces[i] == face ) {
+          int iF = i < 2 ? 1-i : 5-i;
+          return iF < (int)_faces.size() ? _faces[iF] : 0;
+        }
       }
-    }
     return 0;
   }
   //================================================================================
@@ -4075,7 +4076,7 @@ namespace { // Structures used by FixQuadraticElements()
 
   bool QLink::OnBoundary() const
   {
-    for ( int i = 0; i < _faces.size(); ++i )
+    for ( size_t i = 0; i < _faces.size(); ++i )
       if (_faces[i] && _faces[i]->IsBoundary()) return true;
     return false;
   }
@@ -4144,7 +4145,7 @@ namespace { // Structures used by FixQuadraticElements()
       for ( ; bnd != bndEnd; ++bnd )
       {
         const QLink* bndLink = *bnd;
-        for ( int i = 0; i < bndLink->_faces.size(); ++i ) // loop on faces of bndLink
+        for ( size_t i = 0; i < bndLink->_faces.size(); ++i ) // loop on faces of bndLink
         {
           const QFace* face = bndLink->_faces[i]; // quadrange lateral face of a prism
           if ( !face ) continue;
@@ -4211,7 +4212,7 @@ namespace { // Structures used by FixQuadraticElements()
   {
     // put links in the set and evalute number of result chains by number of boundary links
     TLinkSet linkSet;
-    int nbBndLinks = 0;
+    size_t nbBndLinks = 0;
     for ( TChain::iterator lnk = allLinks.begin(); lnk != allLinks.end(); ++lnk ) {
       linkSet.insert( *lnk );
       nbBndLinks += lnk->IsBoundary();
@@ -4260,7 +4261,7 @@ namespace { // Structures used by FixQuadraticElements()
 
       TLinkInSet botLink = startLink; // current horizontal link to go up from
       corner = startCorner; // current corner the botLink ends at
-      int iRow = 0;
+      size_t iRow = 0;
       while ( botLink != linksEnd ) // loop on rows
       {
         // add botLink to the columnChain
@@ -4357,7 +4358,7 @@ namespace { // Structures used by FixQuadraticElements()
     // In the linkSet, there must remain the last links of rowChains; add them
     if ( linkSet.size() != rowChains.size() )
       return _BAD_SET_SIZE;
-    for ( int iRow = 0; iRow < rowChains.size(); ++iRow ) {
+    for ( size_t iRow = 0; iRow < rowChains.size(); ++iRow ) {
       // find the link (startLink) ending at startCorner
       corner = 0;
       for ( startLink = linkSet.begin(); startLink != linksEnd; ++startLink ) {
@@ -4449,6 +4450,7 @@ namespace { // Structures used by FixQuadraticElements()
           {
             continue;
           }
+        default:;
         }
         // get nodes shared by faces that may be distorted
         SMDS_NodeIteratorPtr nodeIt;
@@ -4562,6 +4564,7 @@ namespace { // Structures used by FixQuadraticElements()
           {
             concaveFaces.push_back( face );
           }
+        default:;
         }
       }
       if ( concaveFaces.empty() )
@@ -4627,7 +4630,7 @@ namespace { // Structures used by FixQuadraticElements()
           while ( volIt->more() )
           {
             const SMDS_MeshElement* vol = volIt->next();
-            int nbN = vol->NbCornerNodes();
+            size_t                  nbN = vol->NbCornerNodes();
             if ( ( nbN != 4 && nbN != 5 )  ||
                  !solidSM->Contains( vol ) ||
                  !checkedVols.insert( vol ).second )
@@ -4957,7 +4960,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
         else {
           continue;
         }
-        for ( int iC = 0; iC < chains.size(); ++iC )
+        for ( size_t iC = 0; iC < chains.size(); ++iC )
         {
           TChain& chain = chains[iC];
           if ( chain.empty() ) continue;
index eae5aee77376184e0c0b280ba077ec7d2b506e7a..1fe3af02f7c91675cfadbe257201ef60cd3f9ece 100644 (file)
@@ -792,7 +792,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
           double u = epos->GetUParameter();
           paramNodeMap.insert( make_pair( u, node ));
         }
-        if ( paramNodeMap.size() != eSubMesh->NbNodes() ) {
+        if ((int) paramNodeMap.size() != eSubMesh->NbNodes() ) {
           // wrong U on edge, project
           Extrema_ExtPC proj;
           BRepAdaptor_Curve aCurve( edge );
@@ -818,7 +818,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
           }
 
           //rnv : To fix the bug IPAL21999 Pattern Mapping - New - collapse of pattern mesh
-          if ( paramNodeMap.size() != eSubMesh->NbNodes() - nbMeduimNodes )
+          if ((int) paramNodeMap.size() != eSubMesh->NbNodes() - nbMeduimNodes )
             return setErrorCode(ERR_UNEXPECTED);
         }
 
@@ -1206,7 +1206,7 @@ struct TIsoNode {
   TIsoNode* myNext[4]; // order: (iDir=0,isForward=0), (1,0), (0,1), (1,1)
   TIsoNode* myBndNodes[4];     // order: (iDir=0,i=0), (1,0), (0,1), (1,1)
   TIsoNode(double initU, double initV):
-    myInitUV( initU, initV ), myUV( 1e100, 1e100 ), myIsMovable(true)
+    myIsMovable(true), myInitUV( initU, initV ), myUV( 1e100, 1e100 )
   { myNext[0] = myNext[1] = myNext[2] = myNext[3] = 0; }
   bool IsUVComputed() const
   { return myUV.X() != 1e100; }
@@ -2425,7 +2425,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face&   theFace,
   int nbVertices = loadVE( eList, myShapeIDMap );
   myShapeIDMap.Add( face );
 
-  if ( myShapeIDToPointsMap.size() != myShapeIDMap.Extent() ) {
+  if ((int) myShapeIDToPointsMap.size() != myShapeIDMap.Extent() ) {
     MESSAGE( myShapeIDToPointsMap.size() <<" != " << myShapeIDMap.Extent());
     return setErrorCode( ERR_APPLF_INTERNAL_EEROR );
   }
@@ -2501,7 +2501,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face&   theFace,
     while ( wlIt != wireList.end() )
     {
       list< TopoDS_Edge >& wire = (*wlIt);
-      int nbEdges = wire.size();
+      size_t nbEdges = wire.size();
       wlIt++;
       if ( wlIt != wireList.end() && (*wlIt).size() != nbEdges ) // a unique size wire
       {
@@ -2528,7 +2528,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face&   theFace,
     wlIt = wireList.begin();
     while ( wlIt != wireList.end() )
     {
-      int nbSameSize = 0, nbEdges = (*wlIt).size();
+      size_t nbSameSize = 0, nbEdges = (*wlIt).size();
       list< list< TopoDS_Edge > >::iterator wlIt2 = wlIt;
       wlIt2++;
       while ( wlIt2 != wireList.end() && (*wlIt2).size() == nbEdges ) { // a same size wire
@@ -2867,7 +2867,7 @@ bool SMESH_Pattern::Apply (SMESH_Mesh*          theMesh,
 
   // compute UV and XYZ of points on edges
 
-  for ( int i = 0; i < myOrderedNodes.size(); ++i, ++iSub )
+  for ( size_t i = 0; i < myOrderedNodes.size(); ++i, ++iSub )
   {
     gp_XY& uv1 = keyUV[ i ];
     gp_XY& uv2 = ( i+1 < keyUV.size() ) ? keyUV[ i+1 ] : keyUV[ 0 ];
@@ -3104,7 +3104,7 @@ bool SMESH_Pattern::Apply (std::set<const SMDS_MeshVolume*> & theVolumes,
 
   // to find point index
   map< TPoint*, int > pointIndex;
-  for ( int i = 0; i < myPoints.size(); i++ )
+  for ( size_t i = 0; i < myPoints.size(); i++ )
     pointIndex.insert( make_pair( & myPoints[ i ], i ));
 
   int ind1 = 0; // lowest point index for an element
@@ -4014,7 +4014,7 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh,
     for ( ; i_node != myXYZIdToNodeMap.end(); i_node++ ) {
       nodesVector[ i_node->first ] = i_node->second;
     }
-    for ( int i = 0; i < myXYZ.size(); ++i ) {
+    for ( size_t i = 0; i < myXYZ.size(); ++i ) {
       if ( !nodesVector[ i ] && isDefined( myXYZ[ i ] ) )
         nodesVector[ i ] = aMeshDS->AddNode (myXYZ[ i ].X(),
                                              myXYZ[ i ].Y(),
@@ -4184,7 +4184,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh*                            theMes
     groups.resize( theElements.size() );
     const set<SMESHDS_GroupBase*>& allGroups = aMeshDS->GetGroups();
     set<SMESHDS_GroupBase*>::const_iterator grIt;
-    for ( int i = 0; i < theElements.size(); i++ )
+    for ( size_t i = 0; i < theElements.size(); i++ )
     {
       shapeIDs[ i ] = editor.FindShape( theElements[ i ] );
       for ( grIt = allGroups.begin(); grIt != allGroups.end(); grIt++ ) {
@@ -4226,7 +4226,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh*                            theMes
     TElemDef::const_iterator id = elemNodeInd.begin();
     int nbNodes;
     for ( nbNodes = 0; id != elemNodeInd.end(); id++ ) {
-      if ( *id < theNodesVector.size() )
+      if ( *id < (int) theNodesVector.size() )
         nodes[ nbNodes++ ] = theNodesVector[ *id ];
       else
         nodes[ nbNodes++ ] = myXYZIdToNodeMap[ *id ];
@@ -4325,7 +4325,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh*                            theMes
   }
   if ( onMeshElements ) {
     list< int > elemIDs;
-    for ( int i = 0; i < theElements.size(); i++ )
+    for ( size_t i = 0; i < theElements.size(); i++ )
     {
       subMesh = theMesh->GetSubMeshContaining( shapeIDs[ i ] );
       if ( subMesh )
@@ -4354,7 +4354,7 @@ bool SMESH_Pattern::isReversed(const SMDS_MeshNode* theFirstNode,
   gp_Pnt P[2];
   list<int>::const_iterator id = theIdsList.begin();
   for ( int i = 0; i < 2; ++i, ++id ) {
-    if ( *id < myXYZ.size() )
+    if ( *id < (int) myXYZ.size() )
       P[ i ] = myXYZ[ *id ];
     else {
       map< int, const SMDS_MeshNode*>::const_iterator i_n;
@@ -4790,7 +4790,7 @@ bool SMESH_Pattern::setShapeToMesh(const TopoDS_Shape& theShape)
   // check nb of vertices
   TopTools_IndexedMapOfShape vMap;
   TopExp::MapShapes( theShape, TopAbs_VERTEX, vMap );
-  if ( vMap.Extent() + nbNodeOnSeamEdge != myKeyPointIDs.size() ) {
+  if ( vMap.Extent() + nbNodeOnSeamEdge != (int)myKeyPointIDs.size() ) {
     MESSAGE( myKeyPointIDs.size() + nbNodeOnSeamEdge << " != " << vMap.Extent() );
     return setErrorCode( ERR_APPL_BAD_NB_VERTICES );
   }
index 9e4ebe91369b9bc1734c596db905e5b12fe5ba6d..5271a6c17ad879c35d5e4e2fed65968714275936 100644 (file)
@@ -45,7 +45,7 @@ SMESH_ProxyMesh::SMESH_ProxyMesh():_mesh(0)
  */
 //================================================================================
 
-SMESH_ProxyMesh::SMESH_ProxyMesh(vector<SMESH_ProxyMesh::Ptr>& components):
+SMESH_ProxyMesh::SMESH_ProxyMesh(std::vector<SMESH_ProxyMesh::Ptr>& components):
   _mesh(0)
 {
   if ( components.empty() ) return;
@@ -68,8 +68,8 @@ SMESH_ProxyMesh::SMESH_ProxyMesh(vector<SMESH_ProxyMesh::Ptr>& components):
       if ( _subMeshes[j] )
       {
         // unite 2 sub-meshes
-        set< const SMDS_MeshElement * > elems( _subMeshes[j]->_elements.begin(),
-                                               _subMeshes[j]->_elements.end());
+        std::set< const SMDS_MeshElement * > elems( _subMeshes[j]->_elements.begin(),
+                                                    _subMeshes[j]->_elements.end());
         elems.insert( m->_subMeshes[j]->_elements.begin(),
                       m->_subMeshes[j]->_elements.end());
         _subMeshes[j]->_elements.assign( elems.begin(), elems.end() );
@@ -103,7 +103,7 @@ SMESH_ProxyMesh::~SMESH_ProxyMesh()
     delete _subMeshes[i];
   _subMeshes.clear();
 
-  set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.begin();
+  std::set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.begin();
   for ( ; i != _elemsInMesh.end(); ++i )
     GetMeshDS()->RemoveFreeElement( *i, 0 );
   _elemsInMesh.clear();
@@ -130,7 +130,7 @@ const SMESHDS_SubMesh* SMESH_ProxyMesh::GetSubMesh(const TopoDS_Shape& shape) co
 {
   const SMESHDS_SubMesh* sm = 0;
 
-  int i = shapeIndex(shape);
+  size_t i = shapeIndex(shape);
   if ( i < _subMeshes.size() )
     sm = _subMeshes[i];
   if ( !sm )
@@ -148,7 +148,7 @@ const SMESHDS_SubMesh* SMESH_ProxyMesh::GetSubMesh(const TopoDS_Shape& shape) co
 const SMESH_ProxyMesh::SubMesh*
 SMESH_ProxyMesh::GetProxySubMesh(const TopoDS_Shape& shape) const
 {
-  int i = shapeIndex(shape);
+  size_t i = shapeIndex(shape);
   return i < _subMeshes.size() ? _subMeshes[i] : 0;
 }
 
@@ -203,12 +203,12 @@ namespace
 
   class TFilteringIterator : public SMDS_ElemIterator
   {
-    SMDS_ElemIteratorPtr        _iter;
-    const SMDS_MeshElement *    _curElem;
-    vector< SMDSAbs_EntityType> _okTypes;
+    SMDS_ElemIteratorPtr             _iter;
+    const SMDS_MeshElement *         _curElem;
+    std::vector< SMDSAbs_EntityType> _okTypes;
   public:
-    TFilteringIterator( const vector< SMDSAbs_EntityType>& okTypes,
-                        const SMDS_ElemIteratorPtr&        elemIterator)
+    TFilteringIterator( const std::vector< SMDSAbs_EntityType>& okTypes,
+                        const SMDS_ElemIteratorPtr&             elemIterator)
       :_iter(elemIterator), _curElem(0), _okTypes(okTypes)
     {
       next();
@@ -282,11 +282,11 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetFaces() const
   // ... else elements filtered using allowedTypes are additionally returned
   SMDS_ElemIteratorPtr facesIter = GetMeshDS()->elementsIterator(SMDSAbs_Face);
   SMDS_ElemIteratorPtr filterIter( new TFilteringIterator( _allowedTypes, facesIter ));
-  vector< SMDS_ElemIteratorPtr > iters(2);
+  std::vector< SMDS_ElemIteratorPtr > iters(2);
   iters[0] = proxyIter;
   iters[1] = filterIter;
     
-  typedef vector< SMDS_ElemIteratorPtr > TElemIterVector;
+  typedef std::vector< SMDS_ElemIteratorPtr >                                 TElemIterVector;
   typedef SMDS_IteratorOnIterators<const SMDS_MeshElement *, TElemIterVector> TItersIter;
   return SMDS_ElemIteratorPtr( new TItersIter( iters ));
 }
@@ -431,7 +431,7 @@ void SMESH_ProxyMesh::removeTmpElement( const SMDS_MeshElement* elem )
 {
   if ( elem && elem->GetID() > 0 )
   {
-    set< const SMDS_MeshElement* >::iterator i =  _elemsInMesh.find( elem );
+    std::set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( elem );
     if ( i != _elemsInMesh.end() )
     {
       GetMeshDS()->RemoveFreeElement( elem, 0 );
@@ -468,7 +468,7 @@ void SMESH_ProxyMesh::setNode2Node(const SMDS_MeshNode* srcNode,
   SubMesh* sm = const_cast<SubMesh*>( subMesh );
   if ( !subMesh->_n2n )
     sm->_n2n = new TN2NMap;
-  sm->_n2n->insert( make_pair( srcNode, proxyNode ));
+  sm->_n2n->insert( std::make_pair( srcNode, proxyNode ));
 }
 
 //================================================================================
index be6345c937f7697ebf36eb3284fc3be398e69f03..38a44570802e1d6ee81e7a912518f4ff68123752 100644 (file)
@@ -438,7 +438,8 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn()
   }
   break;
   case TopAbs_COMPSOLID: insertDependence( _subShape, TopAbs_SOLID ); break;
-  case TopAbs_SOLID:     insertDependence( _subShape, TopAbs_FACE ); break;
+  case TopAbs_SOLID:     insertDependence( _subShape, TopAbs_FACE );
+  { /*internal EDGE*/    insertDependence( _subShape, TopAbs_EDGE, TopAbs_WIRE ); break; }
   case TopAbs_SHELL:     insertDependence( _subShape, TopAbs_FACE ); break;
   case TopAbs_FACE:      insertDependence( _subShape, TopAbs_EDGE ); break;
   case TopAbs_WIRE:      insertDependence( _subShape, TopAbs_EDGE ); break;
@@ -457,14 +458,17 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn()
 
 namespace
 {
-  int dependsOnMapKey( const SMESH_subMesh* sm )
+  int dependsOnMapKey( TopAbs_ShapeEnum type, int shapeID )
   {
-    int type = sm->GetSubShape().ShapeType();
-    int ordType = 9 - type;               // 2 = Vertex, 8 = CompSolid
-    int cle = sm->GetId();
+    int ordType = 9 - int(type);               // 2 = Vertex, 8 = CompSolid
+    int     cle = shapeID;
     cle += 10000000 * ordType;    // sort map by ordType then index
     return cle;
   }
+  int dependsOnMapKey( const SMESH_subMesh* sm )
+  {
+    return dependsOnMapKey( sm->GetSubShape().ShapeType(), sm->GetId() );
+  }
 }
 
 //=============================================================================
@@ -474,9 +478,10 @@ namespace
 //=============================================================================
 
 void SMESH_subMesh::insertDependence(const TopoDS_Shape aShape,
-                                     TopAbs_ShapeEnum   aSubType)
+                                     TopAbs_ShapeEnum   aSubType,
+                                     TopAbs_ShapeEnum   avoidType)
 {
-  TopExp_Explorer sub( aShape, aSubType );
+  TopExp_Explorer sub( aShape, aSubType, avoidType );
   for ( ; sub.More(); sub.Next() )
   {
     SMESH_subMesh *aSubMesh = _father->GetSubMesh( sub.Current() );
@@ -503,6 +508,17 @@ bool SMESH_subMesh::DependsOn( const SMESH_subMesh* other ) const
   return other ? _mapDepend.count( dependsOnMapKey( other )) : false;
 }
 
+//================================================================================
+/*!
+ * \brief Return \c true if \a this sub-mesh depends on a \a shape
+ */
+//================================================================================
+
+bool SMESH_subMesh::DependsOn( const int shapeID ) const
+{
+  return DependsOn( _father->GetSubMeshContaining( shapeID ));
+}
+
 //=============================================================================
 /*!
  * Return a shape of \a this sub-mesh
@@ -1093,8 +1109,6 @@ bool SMESH_subMesh::IsConform(const SMESH_Algo* theAlgo)
        !theAlgo->OnlyUnaryInput() ) // all adjacent shapes will be meshed by this algo?
     return true;
 
-  SMESH_Gen* gen =_father->GetGen();
-
   // only local algo is to be checked
   //if ( gen->IsGlobalHypothesis( theAlgo, *_father ))
   if ( _subShape.ShapeType() == _father->GetMeshDS()->ShapeToMesh().ShapeType() )
@@ -2465,7 +2479,7 @@ namespace {
   {
     _Iterator(SMDS_Iterator<SMESH_subMesh*>* subIt,
               SMESH_subMesh*                 prepend,
-              SMESH_subMesh*                 append): myIt(subIt),myAppend(append)
+              SMESH_subMesh*                 append): myAppend(append), myIt(subIt)
     {
       myCur = prepend ? prepend : myIt->more() ? myIt->next() : append;
       if ( myCur == append ) append = 0;
@@ -2570,7 +2584,7 @@ void SMESH_subMesh::ClearAncestors()
 bool SMESH_subMesh::FindIntersection(const SMESH_subMesh*            theOther,
                                      std::set<const SMESH_subMesh*>& theSetOfCommon ) const
 {
-  int oldNb = theSetOfCommon.size();
+  size_t oldNb = theSetOfCommon.size();
 
   // check main submeshes
   const map <int, SMESH_subMesh*>::const_iterator otherEnd = theOther->_mapDepend.end();
index 249784c081196746c632c475cf01e1e9ebf0a650..8f9f83c2c7980fb6da7e67200215ba33e22b0155 100644 (file)
@@ -81,6 +81,7 @@ class SMESH_EXPORT SMESH_subMesh
 
   const std::map < int, SMESH_subMesh * >& DependsOn();
   bool DependsOn( const SMESH_subMesh* other ) const;
+  bool DependsOn( const int shapeID ) const;
   /*!
    * \brief Return iterator on the sub-meshes this one depends on. By default
    *        most simple sub-meshes go first.
@@ -280,7 +281,9 @@ public:
 
 protected:
   // ==================================================================
-  void insertDependence(const TopoDS_Shape aShape, TopAbs_ShapeEnum aSubType );
+  void insertDependence(const TopoDS_Shape aShape,
+                        TopAbs_ShapeEnum   aSubType,
+                        TopAbs_ShapeEnum   avoidType=TopAbs_SHAPE);
 
   void removeSubMeshElementsAndNodes();
   void updateDependantsState(const compute_event theEvent);
index f360512c63f1b2de891fb1f2fd785bd14b9247c5..a1cee8e4e3a9cdb31030114d1c614a763dc69546 100644 (file)
@@ -61,6 +61,7 @@ static int MYDEBUG = 0;
 
 namespace
 {
+  using std::runtime_error;
 
   //=======================================================================
   //function : FindNode
@@ -90,7 +91,7 @@ namespace
     const SMESH::double_array& aCoords = theSeq[theId].coords;
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(3*aNbElems != aCoords.length())
+    if(3*aNbElems != (CORBA::Long) aCoords.length())
       EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()");
     for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
       SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId],
@@ -112,7 +113,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if (2*aNbElems != anIndexes.length())
+    if (2*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()");
     CORBA::Long anIndexId = 0;
     for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
@@ -135,9 +136,9 @@ namespace
     const SMESH::double_array& aDiameter = theSeq[theId].coords;
     const SMESH::long_array& anIndexes   = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems   = theSeq[theId].number;
-    if (2*aNbElems != anIndexes.length() )
+    if (2*aNbElems != (CORBA::Long) anIndexes.length() )
       EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != anIndexes.length()");
-    if (aNbElems != aDiameter.length())
+    if (aNbElems != (CORBA::Long) aDiameter.length())
       EXCEPTION(runtime_error,"AddEdgeWithID - aNbElems != aDiameter.length()");
     CORBA::Long anIndexId = 0;
     for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
@@ -160,7 +161,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(3*aNbElems != anIndexes.length())
+    if(3*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
       SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
@@ -181,7 +182,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(4*aNbElems != anIndexes.length())
+    if(4*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
       SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
@@ -203,7 +204,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(5*aNbElems != anIndexes.length())
+    if(5*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
       SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
@@ -280,7 +281,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(5*aNbElems != anIndexes.length())
+    if(5*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -303,7 +304,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(6*aNbElems != anIndexes.length())
+    if(6*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -327,7 +328,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(7*aNbElems != anIndexes.length())
+    if(7*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddPrismsWithID - 7*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -352,7 +353,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(9*aNbElems != anIndexes.length())
+    if(9*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddHexasWithID - 9*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -378,7 +379,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(13*aNbElems != anIndexes.length())
+    if(13*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddHexPrismWithID - 13*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=13){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -443,7 +444,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(4*aNbElems != anIndexes.length())
+    if(4*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadEdgeWithID - 4*aNbElems != aCoords.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
       SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
@@ -465,7 +466,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(7*aNbElems != anIndexes.length())
+    if(7*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadTriasWithID - 7*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
       SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
@@ -490,7 +491,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(9*aNbElems != anIndexes.length())
+    if(9*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadQuadsWithID - 9*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
       SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
@@ -516,7 +517,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(10*aNbElems != anIndexes.length())
+    if(10*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddBiQuadQuadsWithID - 10*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=10){
       SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
@@ -543,7 +544,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(8*aNbElems != anIndexes.length())
+    if(8*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddBiQuadTriasWithID - 8*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=8){
       SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
@@ -569,7 +570,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(11*aNbElems != anIndexes.length())
+    if(11*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadTetrasWithID - 11*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=11){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -598,7 +599,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(14*aNbElems != anIndexes.length())
+    if(14*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadPiramidsWithID - 14*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=14){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -630,7 +631,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(16*aNbElems != anIndexes.length())
+    if(16*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadPentasWithID - 16*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=16){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -664,7 +665,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(21*aNbElems != anIndexes.length())
+    if(21*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddQuadHexasWithID - 21*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=21){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -702,7 +703,7 @@ namespace
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
-    if(28*aNbElems != anIndexes.length())
+    if(28*aNbElems != (CORBA::Long) anIndexes.length())
       EXCEPTION(runtime_error,"AddTriQuadHexasWithID - 28*aNbElems != anIndexes.length()");
     for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=28){
       SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
@@ -972,7 +973,7 @@ SMESH_Client::Update(bool theIsClear)
             int nbNodes = anIndexes[i++];
             // nodes
             //ASSERT( nbNodes < 9 );
-            vector<const SMDS_MeshNode*> aNodes( nbNodes );
+            std::vector<const SMDS_MeshNode*> aNodes( nbNodes );
             for ( int iNode = 0; iNode < nbNodes; iNode++ )
               aNodes[ iNode ] = FindNode( mySMDSMesh, anIndexes[i++] );
             // change
index a9c378fd621ac033dcfdee2f95a71461ecbee1c8..ef2f2de4a5c5e1c76b7900f9c6cc40f9d19093bb 100644 (file)
@@ -32,6 +32,8 @@
 
 using namespace std;
 
+Quantity_Color SMESHDS_GroupBase::myDefaultColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB );
+
 //=============================================================================
 /*!
  *  
@@ -44,7 +46,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int                 theID,
        myID(theID), myMesh(theMesh), myType(theType), myStoreName(""),
        myCurIndex(0), myCurID(-1)
 {
-  myColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB );
+  myColor = myDefaultColor;
 }
 
 //=============================================================================
index 959498e82c59138abaa5c122c146ef6c044b69a8..305ecb8c08a2ec6d0713f6f3a3d77001ccdc56b7 100644 (file)
@@ -85,6 +85,9 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
 
   int GetColorGroup() const;
   
+  static void SetDefaultColor (const Quantity_Color& theColor)
+  { myDefaultColor = theColor;}
+
  protected:
   const SMDS_MeshElement* findInMesh (const int theID) const;
   void resetIterator();
@@ -105,6 +108,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
   int                  myCurIndex;
   int                  myCurID;
   SMDS_ElemIteratorPtr myIterator;
+
+  static Quantity_Color myDefaultColor;
 };
 
 #endif
index a66f4482fe5a0f7c4523187dd12c57e5fa7c0815..072fcdac72fff2244320c5c19e49750c45e7c897 100644 (file)
@@ -894,16 +894,7 @@ void SMESHDS_Mesh::RemoveNode(const SMDS_MeshNode * n)
 {
   if ( n->NbInverseElements() == 0 && !(hasConstructionEdges() || hasConstructionFaces()))
   {
-    SMESHDS_SubMesh* subMesh = MeshElements( n->getshapeId() );
-    SMESHDS_SubMeshIteratorPtr subIt;
-    if ( !subMesh )
-      subIt = SubMeshes();
-    for ( ; !subMesh && subIt->more(); ) {
-      subMesh = const_cast< SMESHDS_SubMesh* >( subIt->next() );
-      if ( subMesh->IsComplexSubmesh() || !subMesh->Contains( n ))
-        subMesh = 0;
-    }
-    RemoveFreeNode( n, subMesh, true);
+    RemoveFreeNode( n, 0, true );
     return;
   }
 
index 04a0021fc0fc2ef501ec1209d7c075c485fe3e8f..1e7dd6ab39c81a6925d7b1c4336c059b2b22559e 100644 (file)
@@ -89,7 +89,7 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME)
         MESSAGE("add element in subshape already belonging to that subshape "
                 << ME->GetID() << " " << oldShapeId << " " << idInSubShape);
         // check if ok: do nothing if ok
-        if (idInSubShape >= myElements.size())
+        if (idInSubShape >= (int)myElements.size())
         {
           throw SALOME_Exception(LOCALIZED("out of bounds"));
         }
@@ -117,18 +117,27 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
 {
   if (!ME)
   {
-    MESSAGE("-----------------> Remove Null Element " << isElemDeleted);
     return false;
   }
   if (!IsComplexSubmesh())
   {
-    if ( ME->getshapeId() != myIndex )
+    if ( ME->getshapeId() != myIndex ) // elem not in a pool can loose it's data already
+    {
+      if ( isElemDeleted )
+        for ( size_t i = 0; i < myElements.size(); ++i )
+          if ( myElements[i] == ME )
+          {
+            myElements[i] = 0;
+            ++myUnusedIdElements;
+            return true;
+          }
       return false;
+    }
     int idInSubShape = ME->getIdInShape();
     SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME);
     elem->setShapeId(0);
     elem->setIdInShape(-1);
-    if ((idInSubShape >= 0) && (idInSubShape < myElements.size()))
+    if ((idInSubShape >= 0) && (idInSubShape < (int) myElements.size()))
     {
       myElements[idInSubShape] = 0; // this vector entry is no more used
       if ( ++myUnusedIdElements == (int) myElements.size() )
@@ -140,7 +149,6 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
     }
     return false;
   }
-  MESSAGE("Try to remove an element from a complex submesh ");
   return false;
 }
 
@@ -160,7 +168,7 @@ void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N)
       if ( shapeId != myIndex )
         throw SALOME_Exception
           (LOCALIZED("a node being in sub-mesh is added to another sub-mesh"));
-      if ( idInSubShape >= myNodes.size() || myNodes[ idInSubShape ] != N )
+      if ( idInSubShape >= (int)myNodes.size() || myNodes[ idInSubShape ] != N )
         throw SALOME_Exception
           (LOCALIZED("a node with wrong idInSubShape is re-added to the same sub-mesh"));
       return; // already in
@@ -182,12 +190,22 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted)
   if (!IsComplexSubmesh())
   {
     if ( N->getshapeId() != myIndex )
+    {
+      if ( isNodeDeleted )
+        for ( size_t i = 0; i < myNodes.size(); ++i )
+          if ( myNodes[i] == N )
+          {
+            myNodes[i] = 0;
+            ++myUnusedIdNodes;
+            return true;
+          }
       return false;
+    }
     int idInSubShape = N->getIdInShape();
     SMDS_MeshNode* node = (SMDS_MeshNode*) (N);
     node->setShapeId(0);
     node->setIdInShape(-1);
-    if ((idInSubShape >= 0) && (idInSubShape < myNodes.size()))
+    if ((idInSubShape >= 0) && (idInSubShape < (int) myNodes.size()))
     {
       myNodes[idInSubShape] = 0; // this vector entry is no more used
       if ( ++myUnusedIdNodes == (int) myNodes.size() )
@@ -199,13 +217,12 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted)
     }
     return false;
   }
-  MESSAGE("Try to remove a node from a complex submesh");
   return false;
 }
 
 //=======================================================================
 //function : NbElements
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 int SMESHDS_SubMesh::NbElements() const
@@ -284,7 +301,7 @@ template<typename VALUE> class MyIterator : public SMDS_Iterator<VALUE>
 {
  public:
   MyIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
-    : mySubIt( theSubMeshes.begin() ), mySubEnd( theSubMeshes.end() ), myMore(false)
+    : myMore(false), mySubIt( theSubMeshes.begin() ), mySubEnd( theSubMeshes.end() )
     {}
   bool more()
   {
@@ -388,14 +405,14 @@ bool SMESHDS_SubMesh::Contains(const SMDS_MeshElement * ME) const
   if (ME->GetType() == SMDSAbs_Node)
   {
     int idInShape = ME->getIdInShape();
-    if ((idInShape >= 0) && (idInShape < myNodes.size()))
+    if ((idInShape >= 0) && (idInShape < (int) myNodes.size()))
       if (myNodes[idInShape] == ME)
         return true;
   }
   else
   {
     int idInShape = ME->getIdInShape();
-    if ((idInShape >= 0) && (idInShape < myElements.size()))
+    if ((idInShape >= 0) && (idInShape < (int) myElements.size()))
       if (myElements[idInShape] == ME)
         return true;
   }
@@ -539,3 +556,23 @@ void SMESHDS_SubMesh::compactList()
     myUnusedIdNodes = 0;
   }
 }
+
+//=======================================================================
+//function : GetElement
+//purpose  : Return an element by its IdInShape
+//=======================================================================
+
+const SMDS_MeshElement* SMESHDS_SubMesh::GetElement( size_t idInShape ) const
+{
+  return ( !IsComplexSubmesh() && idInShape < myElements.size() ) ? myElements[idInShape] : 0;
+}
+
+//=======================================================================
+//function : GetElement
+//purpose  : Return a node by its IdInShape
+//=======================================================================
+
+const SMDS_MeshNode* SMESHDS_SubMesh::GetNode( size_t idInShape ) const
+{
+  return ( !IsComplexSubmesh() && idInShape < myNodes.size() ) ? myNodes[idInShape] : 0;
+}
index c70857c6028dbb30952e6fa6671643a764a11e23..4eab3aa4470bf87057ffea6c53fee0d8a83f106b 100644 (file)
@@ -52,6 +52,8 @@ class SMESHDS_EXPORT SMESHDS_SubMesh
   virtual bool RemoveElement(const SMDS_MeshElement * ME, bool isElemDeleted); // ret true if ME was in
   virtual void AddNode(const SMDS_MeshNode * ME);
   virtual bool RemoveNode(const SMDS_MeshNode * ME, bool isNodeDeleted);       // ret true if ME was in
+  virtual const SMDS_MeshElement* GetElement( size_t idInShape ) const;
+  virtual const SMDS_MeshNode*    GetNode   ( size_t idInShape ) const;
 
   // if IsComplexSubmesh()
   void AddSubMesh( const SMESHDS_SubMesh* theSubMesh );
index eebb4247036e5425d75b8518494f5c9e9d75e9bc..289bde732ebf3f726de79134289c60d1dd568169 100644 (file)
@@ -54,7 +54,7 @@ public:
     }
     else
     {
-      if ( myVec.size() <= id )
+      if ( (int)myVec.size() <= id )
         myVec.resize( id+1, (SUBMESH*) NULL );
       myVec[ id ] = sm;
     }
@@ -68,7 +68,7 @@ public:
     }
     else
     {
-      return (SUBMESH*) ( id >= myVec.size() ? NULL : myVec[ id ]);
+      return (SUBMESH*) ( id >= (int)myVec.size() ? NULL : myVec[ id ]);
     }
   }
   void DeleteAll()
index 9398fe6499b4cf733f348e2475bf4c772e432975..94e1b6fb4b9bda88878adab1a185c3d20d2cda05 100644 (file)
@@ -39,7 +39,7 @@
  #define SMESHFILTERSSELECTION_EXPORT
 #endif
 
-namespace SMESH{
+namespace SMESH {
   enum MeshObjectType {
     HYPOTHESIS,
     ALGORITHM,
@@ -64,5 +64,5 @@ namespace SMESH{
     IDSOURCE_FACE,
     IDSOURCE_VOLUME
   };
-};
+}
 #endif
index 5f12c7faa9a794c7b6757d6d6193cd8136be1b1d..fc0c43bdd0f5bed7f427e1a0f3bbd2573e389960 100644 (file)
@@ -264,6 +264,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const
           Ok = isIDSourceOfType( obj, SMESH::VOLUME );
           break;
         }
+    default:;
     }
   }
   return Ok;
index 4de86fc5de86e697971eb893e0c3f3bbd097e5d5..d72312ddb456b4aac9d5d6f612c90f5775717c73 100644 (file)
@@ -1176,7 +1176,7 @@ namespace
                   out << "# Control: " << functorToString( aFunctor ) << endl;
                   out << "#" << endl;
                   out.setFieldWidth( 10 );
-                  for ( int i = 0; i < qMin( nbEvents.size(), funValues.size()-1 ); i++ )
+                  for ( int i = 0; i < (int)qMin( nbEvents.size(), funValues.size()-1 ); i++ )
                     out << funValues[i] << "\t" << funValues[i+1] << "\t" << nbEvents[i] << endl;
                   f.close();
                 }
@@ -1951,7 +1951,7 @@ SalomeApp_Module( "SMESH" )
     nbSeg = aResourceMgr->integerValue( "SMESH", "nb_segments_per_edge", 15 );
     myComponentSMESH->SetDefaultNbSegments( nbSeg );
 
-    const char* options[] = { "historical_python_dump", "forget_mesh_on_hyp_modif" };
+    const char* options[] = { "historical_python_dump", "forget_mesh_on_hyp_modif", "default_grp_color" };
     for ( size_t i = 0; i < sizeof(options)/sizeof(char*); ++i )
       if ( aResourceMgr->hasValue( "SMESH", options[i] ))
       {
@@ -4353,7 +4353,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   createPopupItem( SMESHOp::OpCreateGeometryGroup,    OB, mesh, "&& hasGeomReference" );
   createPopupItem( SMESHOp::OpConstructGroup,         OB, subMesh );
   popupMgr()->insert( separator(), -1, 0 );
-  createPopupItem( SMESHOp::OpEditHypothesis,         OB, hypo);
+  createPopupItem( SMESHOp::OpEditHypothesis,         OB, hypo, "&& isEditableHyp");
   createPopupItem( SMESHOp::OpUnassign,               OB, hyp_alg );     // REMOVE HYPOTHESIS / ALGORITHMS
   popupMgr()->insert( separator(), -1, 0 );
   createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh + " " + subMesh );  // convert to quadratic
@@ -4901,7 +4901,7 @@ void SMESHGUI::ProcessEvents( vtkObject* theObject,
                               void* theCallData )
 {
   if( SMESHGUI* aSMESHGUI = reinterpret_cast<SMESHGUI*>( theClientData ) ) {
-    if( theObject && theEvent == SMESH::DeleteActorEvent ) {
+    if( theObject && (int) theEvent == SMESH::DeleteActorEvent ) {
       if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( theObject ) ) {
         SMESHGUI_ClippingPlaneInfoMap& aClippingPlaneInfoMap = aSMESHGUI->getClippingPlaneInfoMap();
         SMESHGUI_ClippingPlaneInfoMap::iterator anIter1 = aClippingPlaneInfoMap.begin();
@@ -5305,79 +5305,92 @@ void SMESHGUI::createPreferences()
 
 void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
 {
-  if( sect=="SMESH" ) {
-    float sbX1,sbY1,sbW,sbH;
+  if ( sect=="SMESH" ) {
+    float sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08;
     float aTol = 1.00000009999999;
     std::string aWarning;
     SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
-    if( name=="selection_object_color" || name=="selection_element_color" ||
-        name=="highlight_color" ||
-        name=="selection_precision_node" || name=="selection_precision_element" ||
-        name=="selection_precision_object")
+
+    if ( name== "selection_object_color" ||
+         name=="selection_element_color" ||
+         name==        "highlight_color" ||
+         name=="selection_precision_node"    ||
+         name=="selection_precision_element" ||
+         name=="selection_precision_object"   )
+    {
       SMESH::UpdateSelectionProp( this );
-    else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){
-      sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1);
-      sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW);
-      if(sbX1+sbW > aTol){
+    }
+    else if (name == "scalar_bar_vertical_x" || name == "scalar_bar_vertical_width")
+    {
+      sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x",     sbX1);
+      sbW  = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW);
+      if ( sbX1+sbW > aTol ) {
         aWarning = "Origin and Size Vertical: X+Width > 1\n";
-        sbX1=0.01;
-        sbW=0.08;
-        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
+        sbX1 = 0.01;
+        sbW  = 0.08;
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x",     sbX1);
         aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
       }
     }
-    else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){
-      sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1);
-      sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH);
-      if(sbY1+sbH > aTol){
+    else if (name == "scalar_bar_vertical_y" || name == "scalar_bar_vertical_height" )
+    {
+      sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y",     sbY1);
+      sbH  = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH);
+      if ( sbY1 + sbH > aTol ) {
         aWarning = "Origin and Size Vertical: Y+Height > 1\n";
-        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y",     sbY1);
         aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
       }
     }
-    else if(name ==  QString("scalar_bar_horizontal_x") || name ==  QString("scalar_bar_horizontal_width")){
-      sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1);
-      sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
-      if(sbX1+sbW > aTol){
+    else if (name == "scalar_bar_horizontal_x" || name ==  "scalar_bar_horizontal_width")
+    {
+      sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x",     sbX1);
+      sbW  = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
+      if ( sbX1 + sbW > aTol ) {
         aWarning = "Origin and Size Horizontal: X+Width > 1\n";
         sbX1=0.1;
-        sbW=0.08;
+        sbW =0.08;
         aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
         aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
       }
     }
-    else if(name ==  QString("scalar_bar_horizontal_y") || name ==  QString("scalar_bar_horizontal_height")){
-      sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1);
-      sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH);
-      if(sbY1+sbH > aTol){
+    else if (name == "scalar_bar_horizontal_y" || name ==  "scalar_bar_horizontal_height")
+    {
+      sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y",     sbY1);
+      sbH  = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH);
+      if ( sbY1 + sbH > aTol ) {
         aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
         sbY1=0.01;
-        sbH=0.08;
+        sbH =0.08;
         aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
         aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
       }
     }
-    else if ( name == "segmentation" ) {
+    else if ( name == "segmentation" )
+    {
       int nbSeg = aResourceMgr->integerValue( "SMESH", "segmentation", 10 );
       myComponentSMESH->SetBoundaryBoxSegmentation( nbSeg );
     }
-    else if ( name == "nb_segments_per_edge" ) {
+    else if ( name == "nb_segments_per_edge" )
+    {
       int nbSeg = aResourceMgr->integerValue( "SMESH", "nb_segments_per_edge", 15 );
       myComponentSMESH->SetDefaultNbSegments( nbSeg );
     }
-    else if ( name == "historical_python_dump" ||
-              name == "forget_mesh_on_hyp_modif") {
+    else if ( name == "historical_python_dump" || name == "forget_mesh_on_hyp_modif" || name == "default_grp_color" )
+    {
       QString val = aResourceMgr->stringValue( "SMESH", name );
       myComponentSMESH->SetOption( name.toLatin1().constData(), val.toLatin1().constData() );
     }
-    else if ( name == QString( "numbering_node_color" ) || name == QString( "numbering_node_font" ) ) {
-      SMESH::UpdateFontProp( this );    
+    else if ( name == "numbering_node_color" || name == "numbering_node_font" )
+    {
+      SMESH::UpdateFontProp( this );
     }
-    else if ( name == QString( "numbering_elem_color" ) || name == QString( "numbering_elem_font" ) ) {
+    else if ( name == "numbering_elem_color" || name == "numbering_elem_font" )
+    {
       SMESH::UpdateFontProp( this );
     }
 
-    if(aWarning.size() != 0){
+    if ( aWarning.size() != 0 ) {
       aWarning += "The default values are applied instead.";
       SUIT_MessageBox::warning(SMESHGUI::desktop(),
                                QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
index 12d43fc6d37e9713e2efc733552477ea5f0c122f..a429e8818fc76fc28400b8a6adfa82d1926dee14 100644 (file)
@@ -84,7 +84,7 @@ typedef std::map<SUIT_ViewManager*, SMESHGUI_ClippingPlaneInfoList> SMESHGUI_Cli
 //=================================================================================
 class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module
 {
-  Q_OBJECT;
+  Q_OBJECT
 
 public :
   SMESHGUI();
index 96fca0d9f0f4e658cf0e94ae1e8d60964a707c9e..8578dbf34df7ba4d870a17963d2d73c5b16e3354 100644 (file)
@@ -497,6 +497,9 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::onSelTypeChange(int selType)
     disconnect( myDlg, SIGNAL( objectChanged( int, const QStringList& )),
                 this,  SLOT  ( onTextChanged( int, const QStringList& )));
 
+  connect( myDlg->myGroupListCmBox, SIGNAL( editTextChanged(const QString & )),
+           this,                    SLOT(   updateButtons() ));
+
   selectionDone();
 }
 
index 5cfddb9ce8850d6010519951a9d9cb24e90ef2fb..f28b8c95c08630b6b7f2ffad3d35db11272e27a8 100644 (file)
@@ -118,8 +118,8 @@ namespace
   static int FirstHexahedronIds[] = {0,1,2,3,4,5,6,7,0,1,2,3};
   static int LastHexahedronIds[] =  {1,2,3,0,5,6,7,4,4,5,6,7};
 
-  static vector<int> FirstPolygonIds;
-  static vector<int> LastPolygonIds;
+  static std::vector<int> FirstPolygonIds;
+  static std::vector<int> LastPolygonIds;
 
   void ReverseConnectivity( std::vector<vtkIdType> & ids, SMDSAbs_EntityType type,
                             bool toReverse, // inverse element
@@ -338,8 +338,8 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myGeomType( theType ),
-    myBusy( false )
+    myBusy( false ),
+    myGeomType( theType )
 {
   setModal( false );
   setAttribute( Qt::WA_DeleteOnClose, true );
@@ -599,6 +599,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
     myNbCenterNodes = 1;
     myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons
     break;
+  default:;
   }
 
   myMidFaceLabel       ->setVisible( myNbMidFaceNodes );
@@ -724,6 +725,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
       anIds.push_back( aListId[ 0 ].toInt() );
     }
     break;
+  default:;
   }
   if ( myReverseCB->isChecked())
     ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
@@ -849,6 +851,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
     case SMESH::VOLUME:
       myActor->SetRepresentation(SMESH_Actor::eSurface);
       myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
+    default:;
     }
   }
 
@@ -1068,6 +1071,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
     case SMDSEntity_Quad_Hexa:
     case SMDSEntity_TriQuad_Hexa:
       anElementType = SMESH::VOLUME; break;
+    default:;
     }
     myGroups.clear();
     ComboBox_GroupName->clear();
@@ -1309,7 +1313,7 @@ bool SMESHGUI_AddQuadraticElementDlg::IsValid()
     okIDs.insert( anID );
   }
 
-  return okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
+  return (int) okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
 }
 
 //=================================================================================
@@ -1406,6 +1410,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
       aFirstColIds = FirstHexahedronIds;
       aLastColIds  = LastHexahedronIds;
       break;
+    default:;
     }
 
     // fill the First and the Last columns
index 90f42ee453f8a59443659b138b98ecea6b93d54e..ae1f5ad3f371312ded0de3e7b2193d2764268696 100644 (file)
@@ -228,7 +228,7 @@ void SMESHGUI_BuildCompoundDlg::Init()
   ComboBoxUnion->addItem(tr("RENAME"));
   ComboBoxUnion->setCurrentIndex(0);
 
-  CheckBoxMerge->setChecked(false);
+  CheckBoxMerge->setChecked(true);
 
   TextLabelTol->setEnabled(CheckBoxMerge->isChecked());
   SpinBoxTol->SetValue(1e-05);
index 161d2183fd7191cc11d06abcb65b5f9c31714754..b3e117556084ef3773a48097c1cdfe769918f0e2 100644 (file)
@@ -56,7 +56,7 @@ class SUIT_SelectionFilter;
 //=================================================================================
 class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
 {
-  Q_OBJECT;
+  Q_OBJECT
 
 public:
 
index 1d68b74fa04a8a9f980913c3307a423ac37cc33b..c02181beeebf45fa5f5456f3593bc51fe92672ad 100644 (file)
@@ -601,12 +601,12 @@ SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg()
   if (myViewWindow)
     SMESH::RenderViewWindow(myViewWindow);
 
-  for( int i=0; i< myPlanes.size(); i++ ) {
+  for ( size_t i = 0; i < myPlanes.size(); i++ ) {
     SMESH::TPlaneData aPlaneData = myPlanes[i];
     aPlaneData.Plane->Delete();
   }
 
-  if (myPreviewWidget) {
+  if ( myPreviewWidget ) {
     myPreviewWidget->Off();
     myPreviewWidget->Delete();
   }
@@ -1134,9 +1134,10 @@ void SMESHGUI_ClippingDlg::updateActorItem( QListWidgetItem* theItem,
           anActorList.remove( anActor );
 
         if( SMESH::ComputeBounds( anActorList, myBounds ) ) {
-          myPreviewWidget->On();
           myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
                                         myBounds[3], myBounds[4], myBounds[5] );
+          if( PreviewCheckBox->isChecked() )
+            myPreviewWidget->On();
         }
         else
           myPreviewWidget->Off();
@@ -1249,9 +1250,10 @@ void SMESHGUI_ClippingDlg::ClickOnNew()
     bool anIsBlocked = ActorList->blockSignals( true );
 
     if( SMESH::ComputeBounds( anActorList, myBounds ) ) {
-      myPreviewWidget->On();
       myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
                                     myBounds[3], myBounds[4], myBounds[5] );
+      if( PreviewCheckBox->isChecked() )
+        myPreviewWidget->On();
     }
     else
       myPreviewWidget->Off();
@@ -1342,9 +1344,10 @@ void SMESHGUI_ClippingDlg::onSelectPlane ( int theIndex )
   myIsSelectPlane = false;
 
   if( SMESH::ComputeBounds( aPlaneData.ActorList, myBounds ) ) {
-    myPreviewWidget->On();
     myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
                                   myBounds[3], myBounds[4], myBounds[5] );
+    if( PreviewCheckBox->isChecked() )
+      myPreviewWidget->On();
   }
   else
     myPreviewWidget->Off();
index 429531fd28919106e398c59cf2775f7339b2e467..ad1a5c5cd9ba376bb86a0fbb6ac9d7becd332aac 100644 (file)
 #define MARGIN  11
 
 #define COLONIZE(str)   (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
+#define __SHAPE_RGB__ 250, 0, 250
 
 enum TCol {
   COL_ALGO = 0, COL_SHAPE, COL_ERROR, COL_SHAPEID, COL_PUBLISHED, COL_BAD_MESH, NB_COLUMNS
@@ -147,10 +148,10 @@ namespace SMESH
     {
       myProperty = vtkProperty::New();
       myProperty->SetRepresentationToWireframe();
-      myProperty->SetColor( 250, 0, 250 );
-      myProperty->SetAmbientColor( 250, 0, 250 );
-      myProperty->SetDiffuseColor( 250, 0, 250 );
-      //myProperty->SetSpecularColor( 250, 0, 250 );
+      myProperty->SetColor( __SHAPE_RGB__ );
+      myProperty->SetAmbientColor( __SHAPE_RGB__ );
+      myProperty->SetDiffuseColor( __SHAPE_RGB__ );
+      //myProperty->SetSpecularColor( __SHAPE_RGB__ );
       myProperty->SetLineWidth( 5 );
     }
     // -----------------------------------------------------------------------
@@ -271,20 +272,25 @@ namespace SMESH
     GEOM_Actor* getActor(const TopoDS_Shape& shape)
     {
       int index = myIndexToShape.FindIndex( shape ) - 1;
-      if ( index < 0 || index >= myActors.size() )
+      if ( index < 0 || index >= (int) myActors.size() )
         return 0;
       GEOM_Actor* & actor = myActors[ index ];
       if ( !actor ) {
         actor = GEOM_Actor::New();
         if ( actor ) {
           actor->SetShape(shape,0,0);
-          actor->SetProperty(myProperty);
-          actor->SetShadingProperty(myProperty);
-          actor->SetWireframeProperty(myProperty);
-          actor->SetPreviewProperty(myProperty);
+          // actor->SetProperty(myProperty);
+          // actor->SetShadingProperty(myProperty);
+          // actor->SetWireframeProperty(myProperty);
+          // actor->SetPreviewProperty(myProperty);
           actor->PickableOff();
-          //         if ( shape.ShapeType() == TopAbs_EDGE )
-          //           actor->SubShapeOn();
+          //
+          actor->SetWidth( myProperty->GetLineWidth() );
+          actor->SetIsosWidth( myProperty->GetLineWidth() );
+          actor->SetIsosColor( __SHAPE_RGB__ );
+          actor->SetColor( __SHAPE_RGB__ );
+          // if ( shape.ShapeType() == TopAbs_EDGE )
+          //   actor->SubShapeOn();
           myViewWindow->AddActor( actor );
         }
       }
@@ -732,10 +738,11 @@ void SMESHGUI_ComputeDlg_QThread::cancel()
 //================================================================================
 //================================================================================
 
-SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget             * parent,
-                                                                       SMESH::SMESH_Gen_var  gen,
-                                                                       SMESH::SMESH_Mesh_var mesh,
-                                                                       GEOM::GEOM_Object_var mainShape)
+SMESHGUI_ComputeDlg_QThreadQDialog::
+SMESHGUI_ComputeDlg_QThreadQDialog(QWidget             * parent,
+                                   SMESH::SMESH_Gen_var  gen,
+                                   SMESH::SMESH_Mesh_var mesh,
+                                   GEOM::GEOM_Object_var mainShape)
   : QDialog(parent,
             Qt::WindowSystemMenuHint |
             Qt::WindowCloseButtonHint |
@@ -887,7 +894,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
 #endif
       aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
       // check if there are memory problems
-      for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
+      for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
         memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
     }
     catch(const SALOME::SALOME_Exception & S_ex) {
@@ -916,23 +923,28 @@ void SMESHGUI_BaseComputeOp::computeMesh()
       if ( !memoryLack )
       {
         // List of objects that will be updated automatically
-        QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > aListToUpdate;
-        SMESH::SMESH_IDSource_var aMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
+        typedef QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > TListOf_IDSrc_SObj;
+        TListOf_IDSrc_SObj aListToUpdate;
+        SMESH::SMESH_IDSource_var aMeshObj =
+          SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
         // put Mesh into list
-        aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) );
+        aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aMeshObj, aMeshSObj ));
         SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
         // put SubMeshes into list
-        for ( int i = 0; i < aSubMeshes->length(); i++ ) {
+        for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ )
+        {
           SMESH::SMESH_subMesh_var sm = aSubMeshes[i];
           if ( CORBA::is_nil( sm ) ) continue;
           _PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
           if ( !smSObj ) continue;
-          SMESH::SMESH_IDSource_var aSubMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
-          aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aSubMeshObj, smSObj) );
+          SMESH::SMESH_IDSource_var aSubMeshObj =
+            SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
+          aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj ));
         }
         // put Groups into list
-        SMESH::ListOfGroups_var  aGroups = myMesh->GetGroups();
-        for ( size_t i = 0; i < aGroups->length(); ++i ) {
+        SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
+        for ( size_t i = 0; i < aGroups->length(); ++i )
+        {
           SMESH::SMESH_GroupBase_var aGrp = aGroups[i];
           if ( CORBA::is_nil( aGrp ) ) continue;
           SMESH::SMESH_Group_var         aStdGroup  = SMESH::SMESH_Group::_narrow( aGrp );
@@ -941,26 +953,31 @@ void SMESHGUI_BaseComputeOp::computeMesh()
           if ( !aStdGroup->_is_nil() ) continue; // don't update the standalone groups
           _PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp );
           if ( !aGroupSO ) continue;
-          SMESH::SMESH_IDSource_var aGroupObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
-          aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aGroupObj, aGroupSO) );
+          SMESH::SMESH_IDSource_var aGroupObj =
+            SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
+          aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO ));
         }
 
         // update mesh, sub-mesh and groups, if it's possible
-        QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > >::iterator anIter;
-        for( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ ) {
-          SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
-          if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, &hidden, &nbElements ) )
+        TListOf_IDSrc_SObj::iterator anIter;
+        for ( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ )
+        {
+          SMESH::SMESH_Mesh_var aMesh =
+            SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
+
+          if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded,
+                                               &hidden, &nbElements ) )
           {
             try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
               OCC_CATCH_SIGNALS;
-#endif
               bool toDisplay = false;
-
-              if ( !aMesh->_is_nil() ) { // display a mesh only
+              if ( !aMesh->_is_nil() ) // display only a mesh
+              {
                 toDisplay = true;
                 SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
-                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(), (*anIter).second->GetID().c_str(), true );    
+                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(),
+                                                              (*anIter).second->GetID().c_str(),
+                                                              /*clearLog =*/ true );
                 if ( anActor ) // actor is not created for an empty mesh
                 {
                   anActor->SetEntityMode( entities );
@@ -981,7 +998,10 @@ void SMESHGUI_BaseComputeOp::computeMesh()
                 if ( hidden & SMESH_Actor::eBallElem )   hiddenMsg << tr( "SMESH_BALLS" );
                 SUIT_MessageBox::warning( desktop(),
                                           tr( "SMESH_WRN_WARNING" ),
-                                          tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ).arg( hiddenMsg.join(", ") ) );
+                                          tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).
+                                          arg( nbElements ).
+                                          arg( limitSize ).
+                                          arg( hiddenMsg.join(", ")));
               }
             }
             catch (...) {
@@ -1000,12 +1020,12 @@ void SMESHGUI_BaseComputeOp::computeMesh()
           {
             SUIT_MessageBox::warning( desktop(),
                                       tr( "SMESH_WRN_WARNING" ),
-                                      tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ) );
+                                      tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).
+                                      arg( nbElements ).arg( limitSize ) );
           }
         }
       }
-      LightApp_SelectionMgr *Sel = selectionMgr();
-      if ( Sel )
+      if ( LightApp_SelectionMgr *Sel = selectionMgr() )
       {
         SALOME_ListIO selected;
         selected.Append( myIObject );
@@ -1017,10 +1037,11 @@ void SMESHGUI_BaseComputeOp::computeMesh()
   if ( memoryLack )
     aMemoryReserve.release();
 
-  myCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
+  myCompDlg->setWindowTitle
+    ( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" ));
 
   // SHOW ERRORS
-  
+
   bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
   bool noHypoError = ( aHypErrors.isEmpty() );
 
@@ -1081,7 +1102,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
   else
   {
     bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported
-    for ( int i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
+    for ( CORBA::ULong i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
       onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING ||
                        theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
 
@@ -1136,7 +1157,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
       tbl->setColumnWidth( COL_ERROR, 200 );
 
       bool hasBadMesh = false;
-      for ( int row = 0; row < theCompErrors->length(); ++row )
+      for ( int row = 0; row < (int) theCompErrors->length(); ++row )
       {
         SMESH::ComputeError & err = theCompErrors[ row ];
 
@@ -1234,8 +1255,9 @@ 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, name.toLatin1().data(), GEOM::GEOM_Object::_nil());
+        SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, myMainShape,
+                                                         name.toLatin1().data(),
+                                                         GEOM::GEOM_Object::_nil());
         // look for myMainShape in the table
         for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
           if ( table()->item( r, COL_SHAPEID )->text() == "1" ) {
@@ -1252,7 +1274,8 @@ 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, name.toLatin1().data(), myMainShape);
+      SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape,
+                                                       name.toLatin1().data(), myMainShape);
       if ( !so->_is_nil() ) {
         CORBA::String_var name  = so->GetName();
         CORBA::String_var entry = so->GetID();
@@ -1542,15 +1565,15 @@ LightApp_Dialog* SMESHGUI_ComputeOp::dlg() const
 //================================================================================
 /*!
  * \brief Constructor
-*/
+ */
 //================================================================================
 
 SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp()
   : SMESHGUI_BaseComputeOp(),
-    myDlg( 0 ),
-    myOrderMgr( 0 ),
     myActiveDlg( 0 ),
-    myPreviewDisplayer( 0 )
+    myDlg( 0 ),
+    myPreviewDisplayer( 0 ),
+    myOrderMgr( 0 )
 {
 }
 
@@ -1710,7 +1733,7 @@ void SMESHGUI_PrecomputeOp::initDialog()
   myOrderMgr = new SMESHGUI_MeshOrderMgr( myDlg->getMeshOrderBox() );
   myOrderMgr->SetMesh( myMesh );
   bool isOrder = myOrderMgr->GetMeshOrder(myPrevOrder);
-  myDlg->getMeshOrderBox()->setShown(isOrder);
+  myDlg->getMeshOrderBox()->setVisible(isOrder);
   if ( !isOrder ) {
     delete myOrderMgr;
     myOrderMgr = 0;
@@ -1773,7 +1796,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
   }
 
   // check sub-meshes
-  for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart < SMESH::Tag_LastSubMesh; ++aPart )
+  for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart <= SMESH::Tag_LastSubMesh; ++aPart )
   {
     if ( !theMesh->FindSubObject( aPart, aHypFolder ))
       continue;
@@ -1962,7 +1985,7 @@ void SMESHGUI_PrecomputeOp::onPreview()
 #endif
     aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
     // check if there are memory problems
-    for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
+    for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
       memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
   }
   catch(const SALOME::SALOME_Exception & S_ex){
@@ -1995,7 +2018,8 @@ void SMESHGUI_PrecomputeOp::onPreview()
   if ( isShowError )
   {
     myDlg->hide();
-    aCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
+    aCompDlg->setWindowTitle
+      ( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" ));
     showComputeResult( memoryLack, noCompError, aCompErrors, noHypoError, aHypErrors );
   }
 }
@@ -2198,10 +2222,11 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
     aMemoryReserve.release();
 
   evaluateFailed =  ( aCompErrors->length() > 0 );
-  myCompDlg->setWindowTitle(tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED"));
+  myCompDlg->setWindowTitle
+    ( tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED" ));
 
   // SHOW ERRORS
-  
+
   bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
   bool noHypoError = ( aHypErrors.isEmpty() );
 
@@ -2293,7 +2318,7 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes,
       tbl->setColumnWidth( COL_ERROR, 200 );
 
       bool hasBadMesh = false;
-      for ( int row = 0; row < theCompErrors->length(); ++row )
+      for ( int row = 0; row < (int) theCompErrors->length(); ++row )
       {
         SMESH::ComputeError & err = theCompErrors[ row ];
 
index 5da5ff109b67ac350b4e13a7969f07c005de999e..35611dfe5a004b715b44c329b90647a09ee02190 100644 (file)
@@ -109,8 +109,8 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg(0),
     mySelectedObject(SMESH::SMESH_IDSource::_nil()),
+    myFilterDlg(0),
     myIsApplyAndClose( false )
 {
   QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH")));
@@ -494,6 +494,9 @@ void SMESHGUI_CopyMeshDlg::onTextChange (const QString& theNewText)
 void SMESHGUI_CopyMeshDlg::SelectionIntoArgument()
 {
   if (myBusy) return;
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
+  if (!GroupButtons->isEnabled()) return;              // inactive
+
   BusyLocker lock( myBusy );
 
   // clear
@@ -677,6 +680,15 @@ void SMESHGUI_CopyMeshDlg::setFilters()
   if ( !myFilterDlg )
     myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
 
+  QList<int> types;
+  if ( myMesh->NbEdges()     ) types << SMESH::EDGE;
+  if ( myMesh->NbFaces()     ) types << SMESH::FACE;
+  if ( myMesh->NbVolumes()   ) types << SMESH::VOLUME;
+  if ( myMesh->NbBalls()     ) types << SMESH::BALL;
+  if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D;
+  if ( types.count() > 1 )     types << SMESH::ALL;
+
+  myFilterDlg->Init( types );
   myFilterDlg->SetSelection();
   myFilterDlg->SetMesh( myMesh );
   myFilterDlg->SetSourceWg( myLineEditElements );
index 47c2f8eecbd27236c838df8a9d1da1b3c0f61d13..da805271a1f7992131c8cdef5908baf98f245ae4 100755 (executable)
@@ -378,7 +378,7 @@ void SMESHGUI_CreatePatternDlg::onSave()
     SUIT_FileDlg* aDlg = new SUIT_FileDlg( this, false );
     aDlg->setWindowTitle( tr( "SAVE_PATTERN" ) );
     aDlg->setFileMode( QFileDialog::AnyFile );
-    aDlg->setFilter( tr( "PATTERN_FILT" ) );
+    aDlg->setNameFilter( tr( "PATTERN_FILT" ) );
     if ( myName->text() != "" )
       aDlg->selectFile( myName->text() );
 
@@ -392,7 +392,7 @@ void SMESHGUI_CreatePatternDlg::onSave()
     if ( QFileInfo( fName ).suffix().isEmpty() )
       fName = autoExtension( fName );
 
-    fName = QDir::convertSeparators( fName );
+    fName = QDir::toNativeSeparators( fName );
 
     QString aData( myPattern->GetString() );
     long aLen = aData.length();
index 5af9a3789b33ba42bb4c3496f44aae83d15e518c..dd1f1e684c4a52f963bf42545cd36782074804fe 100644 (file)
@@ -73,8 +73,8 @@
 //=================================================================================
 SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
   QDialog(SMESH::GetDesktop(theModule)),
-  mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-  mySMESHGUI(theModule)
+  mySMESHGUI(theModule),
+  mySelectionMgr(SMESH::GetSelectionMgr(theModule))
 {
   setModal(false);
   setWindowTitle(tr("CAPTION"));
index 5a62c1de60021b8662d8efd89a7445c0e9f5a4eb..38b36d060c79d521335a4a97d3f4fd98660e163b 100644 (file)
@@ -397,7 +397,7 @@ void SMESHGUI_3TypesSelector::addTmpIdSource( SMESH::long_array_var& ids, int iT
   SMESH::SMESH_IDSource_var idSrc =
     aMeshEditor->MakeIDSource( ids, SMESH::ElementType( iType+1 ));
 
-  if ( myIDSource[ iType ]->length() <= index )
+  if ( (int) myIDSource[ iType ]->length() <= index )
     myIDSource[ iType ]->length( index + 1 );
   myIDSource[ iType ][ index ] = idSrc;
 
index ff6cd870700ff22faf119259246a2bb10b8ac771..9b72ae2f4f5b6feb2b121997b1847ef4f5d63163 100644 (file)
@@ -170,7 +170,7 @@ bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds()
 {
   int nbSelected = 0;
   if ( myTree->isEnabled() )
-    for ( size_t i = 0; i < myTree->topLevelItemCount(); ++i )
+    for ( int i = 0; i < myTree->topLevelItemCount(); ++i )
     {
       QTreeWidgetItem* meshItem = myTree->topLevelItem( i );
       int iM = meshItem->data( 0, Qt::UserRole ).toInt();
@@ -202,7 +202,7 @@ bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds()
     }
   else
   {
-    for ( size_t iF = 0; iF < myFields->count(); ++iF )
+    for ( int iF = 0; iF < myFields->count(); ++iF )
     {
       GEOM::ListOfFields& fields = (*myFields)[ iF ].first.inout();
       fields.length( 0 );
index 97f1df847d47671462c6830e5880de2cc680197a..04732d8f6fff5539617f7e477d8063fb2ada1305 100755 (executable)
@@ -870,8 +870,8 @@ SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
                                             QWidget* parent,
                                             const int type )
 : QWidget( parent ),
-  myIsLocked( false ),
-  mySMESHGUI( theModule )
+  mySMESHGUI( theModule ),
+  myIsLocked( false )
 {
   myEntityType = -1;
 
@@ -888,8 +888,8 @@ SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
                                             QWidget* parent,
                                             const QList<int>& types )
 : QWidget( parent ),
-  myIsLocked( false ),
-  mySMESHGUI( theModule )
+  mySMESHGUI( theModule ),
+  myIsLocked( false )
 {
   myEntityType = -1;
   Init(types);
@@ -1155,7 +1155,7 @@ bool SMESHGUI_FilterTable::IsValid (const bool theMess, const int theEntityType)
       bool aRes = false;
       bool isSignalsBlocked = aTable->signalsBlocked();
       aTable->blockSignals(true);
-      double  aThreshold = (int)aTable->text(i, 2).toDouble(&aRes);
+      /*double  aThreshold =*/ aTable->text(i, 2).toDouble( &aRes );
       aTable->blockSignals(isSignalsBlocked);
 
       if (!aRes && aTable->isEditable(i, 2))
@@ -3365,7 +3365,7 @@ bool SMESHGUI_FilterDlg::onApply()
 
     if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
       //
-      bool toFilter = (( SMESH::FindActorByObject( myMesh )) ||
+      bool toFilter = (( getActor() ) ||
                        ( myInitSourceWgOnApply && mySourceWg ) ||
                        ( mySourceGrp->checkedId() == Dialog && mySourceWg ));
       if ( toFilter ) {
@@ -3416,7 +3416,7 @@ bool SMESHGUI_FilterDlg::createFilter (const int theType)
   if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
     aPrecision = mgr->integerValue( "SMESH", "controls_precision", aPrecision );
 
-  for (CORBA::ULong i = 0; i < n; i++) {
+  for ( int i = 0; i < n; i++) {
     SMESH::Filter::Criterion aCriterion = createCriterion();
     myTable->GetCriterion(i, aCriterion);
     aCriterion.Precision = aPrecision;
@@ -3622,6 +3622,35 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType,
       theResIds.append(aResIter.Key());
 }
 
+//=======================================================================
+//function : getActor
+//purpose  : Returns an actor to show filtered entities
+//=======================================================================
+
+SMESH_Actor* SMESHGUI_FilterDlg::getActor()
+{
+  SMESH_Actor* meshActor = SMESH::FindActorByObject( myMesh );
+  if ( meshActor && meshActor->GetVisibility() )
+    return meshActor;
+
+  SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects);
+  for ( ; anIter.More(); anIter.Next())
+  {
+    Handle(SALOME_InteractiveObject) io = anIter.Key();
+    if ( io->hasEntry() )
+    {
+      SMESH_Actor* actor = SMESH::FindActorByEntry( io->getEntry() );
+      if ( !actor )
+        continue;
+      if ( actor->GetVisibility() )
+        return actor;
+      if ( !meshActor )
+        meshActor = actor;
+    }
+  }
+  return meshActor;
+}
+
 //=======================================================================
 // name    : SMESHGUI_FilterDlg::selectInViewer
 // Purpose : Select given entities in viewer
@@ -3644,8 +3673,8 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList<int>& th
   }
 
   // Clear selection
-  SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
-  if (!anActor || !anActor->hasIO())
+  SMESH_Actor* anActor = getActor();
+  if ( !anActor || !anActor->hasIO() )
     return;
 
   Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
index 50dabdaa192be632bd58c655239e0adbbeb86827..2bff4ba6f2f1a2d83ed6cc26ca4950b2845d342d 100755 (executable)
 #include CORBA_SERVER_HEADER(SMESH_Filter)
 #include CORBA_SERVER_HEADER(SMESH_Mesh)
 
-class QFrame;
+class LightApp_SelectionMgr;
 class QButtonGroup;
 class QCheckBox;
+class QFrame;
 class QGroupBox;
 class QPushButton;
+class QStackedWidget;
 class QTableWidget;
 class QTableWidgetItem;
-class QStackedWidget;
-class LightApp_SelectionMgr;
 class SMESHGUI;
 class SMESHGUI_FilterLibraryDlg;
+class SMESH_Actor;
 class SVTK_Selector;
 
 /*!
@@ -282,6 +283,7 @@ private:
   void                      setIdsToWg( QWidget*, const QList<int>& );
   Selection_Mode            getSelMode( const int ) const;
   void                      updateSelection();
+  SMESH_Actor*              getActor();
 
 private:
   // widgets
index c4b0465de691d71a1e70b2dec1ff5abfa3b64e97..e7a519e0314749e0183b6f95227553d3683913d8 100644 (file)
@@ -611,7 +611,7 @@ void SMESHGUI_FilterLibraryDlg::onBrowse()
 
   //aDlg->setMode(myMode == COPY_FROM ? QFileDialogP::ExistingFile : QFileDialogP::AnyFile);
   aDlg->setFileMode(myMode == COPY_FROM ? QFileDialog::ExistingFile : QFileDialog::AnyFile);
-  aDlg->setFilters(prepareFilters());
+  aDlg->setNameFilters(prepareFilters());
   aDlg->selectFile(getFileName());
 
   QPushButton* anOkBtn = (QPushButton*)aDlg->findChild<QPushButton*>("OK");
@@ -629,8 +629,8 @@ void SMESHGUI_FilterLibraryDlg::onBrowse()
   if (QFileInfo(fName).suffix().isEmpty())
     fName = autoExtension(fName);
 
-  fName = QDir::convertSeparators(fName);
-  QString prev = QDir::convertSeparators(getFileName());
+  fName = QDir::toNativeSeparators(fName);
+  QString prev = QDir::toNativeSeparators(getFileName());
 
   if (prev == fName)
     return;
@@ -756,7 +756,7 @@ bool SMESHGUI_FilterLibraryDlg::isPermissionValid(const bool theIsExistingOnly)
   if (QFileInfo(fName).suffix().isEmpty())
     fName = autoExtension(fName);
 
-  fName = QDir::convertSeparators(fName);
+  fName = QDir::toNativeSeparators(fName);
 
   if (QFileInfo(fName).exists()) {
     isWritable = QFileInfo(fName).isWritable();
index fc4304500cff44a28641f5505dc693f87b504b31..5b3f1ef2792624efc96755eb3ccadec633f4e6ab 100644 (file)
@@ -101,7 +101,7 @@ void SMESHGUI_FindElemByPointDlg::setTypes(SMESH::array_of_ElementType_var & typ
   myElemTypeCombo->blockSignals(true);
   myElemTypeCombo->clear();
   int nbTypes = 0, hasNodes = 0;
-  for ( int i = 0; i < types->length(); ++i )
+  for ( int i = 0; i < (int) types->length(); ++i )
   {
     switch ( types[i] ) {
     case SMESH::NODE:
@@ -449,7 +449,7 @@ void SMESHGUI_FindElemByPointOp::onFind()
                                                myDlg->myZ->GetValue(),
                                                SMESH::ElementType( myDlg->myElemTypeCombo->currentId()));
     myDlg->myFoundList->clear();
-    for ( int i = 0; i < foundIds->length(); ++i )
+    for ( int i = 0; i < (int) foundIds->length(); ++i )
       myDlg->myFoundList->addItem( QString::number( foundIds[i] ));
 
     if ( foundIds->length() > 0 )
index 7b1ad6ec92a35cdd376a4c38424dd473b9f45d21..c2575f14e533e0d8430a9fd72916ad07d5119ec8 100644 (file)
@@ -128,8 +128,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
     mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
     myIsBusy( false ),
     myNameChanged( false ),
-    myIsApplyAndClose( false ),
-    myNbChangesOfContents(0)
+    myNbChangesOfContents(0),
+    myIsApplyAndClose( false )
 {
   initDialog( true );
   if ( !theMesh->_is_nil() )
@@ -612,6 +612,8 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
   case SMESH::EDGE:   aType = grpEdgeSelection;   break;
   case SMESH::FACE:   aType = grpFaceSelection;   break;
   case SMESH::VOLUME: aType = grpVolumeSelection; break;
+  case SMESH::ALL:
+  case SMESH::NB_ELEMENT_TYPES: break;
   }
   myTypeGroup->button(aType)->setChecked(true);
 
@@ -1075,7 +1077,7 @@ bool SMESHGUI_GroupDlg::onApply()
         // check and add all selected GEOM objects: they must be
         // a sub-shapes of the main GEOM and must be of one type
         TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
-        for ( int i =0; i < myGeomObjects->length(); i++) {
+        for ( int i =0; i < (int)myGeomObjects->length(); i++) {
           TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType();
           if (i == 0)
             aGroupType = aSubShapeType;
@@ -1809,6 +1811,10 @@ void SMESHGUI_GroupDlg::onFilterAccepted()
         mesh = myGroupOnFilter->GetMesh();
     }
     myFilter->SetMesh( mesh );
+
+    // highlight ids if selection changed in the Viewer (IPAL52924)
+    myCurrentLineEdit = 0;
+    onObjectSelectionChanged();
   }
 
   updateButtons();
@@ -2139,15 +2145,13 @@ void SMESHGUI_GroupDlg::onRemove()
       }
     }
     else if (myCurrentLineEdit == myGroupLine) {
-      Standard_Boolean aRes;
-      //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
       SALOME_ListIO aList;
       mySelectionMgr->selectedObjects( aList );
 
       SALOME_ListIteratorOfListIO anIt (aList);
       for ( ; anIt.More(); anIt.Next()) {
         SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
-        if (aRes && !aGroup->_is_nil()) {
+        if (!aGroup->_is_nil()) {
           // check if mesh is the same
           if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
             SMESH::long_array_var anElements = aGroup->GetListOfID();
@@ -2285,18 +2289,20 @@ void SMESHGUI_GroupDlg::onHelp()
 {
   LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
   if (app)
-    app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString( "" ), myHelpFileName);
-  else {
-    QString platform;
+  {
+    app->onHelpContextModule
+      ( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : QString(""), myHelpFileName );
+  }
+  else
+  {
 #ifdef WIN32
-    platform = "winapplication";
+    QString platform = "winapplication";
 #else
-    platform = "application";
+    QString platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
                              tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
-                             arg(app->resourceMgr()->stringValue( "ExternalBrowser",
-                                                                 platform)).
+                             arg(app->resourceMgr()->stringValue( "ExternalBrowser", platform)).
                              arg(myHelpFileName));
   }
 }
@@ -2343,16 +2349,16 @@ void SMESHGUI_GroupDlg::keyPressEvent( QKeyEvent* e )
     return;
 
   if ( e->key() == Qt::Key_F1 )
-    {
-      e->accept();
-      onHelp();
-    }
+  {
+    e->accept();
+    onHelp();
+  }
 }
 
 //================================================================================
 /*!
  * \brief Enable showing of the popup when Geometry selection btn is clicked
 * \param enable - true to enable
+ * \param enable - true to enable
  */
 //================================================================================
 
@@ -2388,17 +2394,17 @@ void SMESHGUI_GroupDlg::updateGeomPopup()
 void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn)
 {
   if ( myGeomPopup && isBtnOn )
-    {
-      myCurrentLineEdit = myGeomGroupLine;
-      QAction* a = myGeomPopup->exec( QCursor::pos() );
-      if (!a || myActions[a] == DIRECT_GEOM_INDEX)
-        setSelectionMode(grpGeomSelection);
-    }
+  {
+    myCurrentLineEdit = myGeomGroupLine;
+    QAction* a = myGeomPopup->exec( QCursor::pos() );
+    if (!a || myActions[a] == DIRECT_GEOM_INDEX)
+      setSelectionMode(grpGeomSelection);
+  }
   else if (!isBtnOn)
-    {
-      myCurrentLineEdit = 0;
-      setSelectionMode(grpAllSelection);
-    }
+  {
+    myCurrentLineEdit = 0;
+    setSelectionMode(grpAllSelection);
+  }
 }
 
 //=================================================================================
@@ -2409,26 +2415,26 @@ void SMESHGUI_GroupDlg::onGeomPopup( QAction* a )
 {
   int index = myActions[a];
   if ( index == GEOM_BY_MESH_INDEX )
-    {
-      mySelectionMode = grpNoSelection;
-      if ( !myShapeByMeshOp ) {
-        myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
-        connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
-                SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
-        connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
-                SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
-      }
-      // set mesh object to SMESHGUI_ShapeByMeshOp and start it
-      if ( !myMesh->_is_nil() ) {
-        myIsBusy = true;
-        hide(); // stop processing selection
-        myIsBusy = false;
-        myShapeByMeshOp->setModule( mySMESHGUI );
-        myShapeByMeshOp->setStudy( 0 ); // it's really necessary
-        myShapeByMeshOp->SetMesh( myMesh );
-        myShapeByMeshOp->start();
-      }
+  {
+    mySelectionMode = grpNoSelection;
+    if ( !myShapeByMeshOp ) {
+      myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
+      connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
+              SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
+      connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
+              SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
+    }
+    // set mesh object to SMESHGUI_ShapeByMeshOp and start it
+    if ( !myMesh->_is_nil() ) {
+      myIsBusy = true;
+      hide(); // stop processing selection
+      myIsBusy = false;
+      myShapeByMeshOp->setModule( mySMESHGUI );
+      myShapeByMeshOp->setStudy( 0 ); // it's really necessary
+      myShapeByMeshOp->SetMesh( myMesh );
+      myShapeByMeshOp->start();
     }
+  }
 }
 
 //================================================================================
@@ -2469,10 +2475,10 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op)
 void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op)
 {
   if ( myShapeByMeshOp == op )
-    {
-      show();
-      setSelectionMode(grpGeomSelection);
-    }
+  {
+    show();
+    setSelectionMode(grpGeomSelection);
+  }
 }
 
 //=================================================================================
index 69077f967f5ef8ec291f55ad8706943d2ef6b401..6f32383c0706c598664c1c558f07d83c18bb057c 100644 (file)
@@ -31,6 +31,7 @@
 #include "SMESHGUI_Utils.h"
 #include "SMESHGUI_VTKUtils.h"
 #include "SMESH_TypeFilter.hxx"
+#include <SMESH_ActorUtils.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -232,6 +233,8 @@ void SMESHGUI_GroupOpDlg::Init()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
+
+  setDefaultGroupColor();
 }
 
 /*!
@@ -447,6 +450,14 @@ SALOMEDS::Color SMESHGUI_GroupOpDlg::getColor() const
   return aColor;
 }
 
+/*!
+  \brief Set default color for group
+*/
+void SMESHGUI_GroupOpDlg::setDefaultGroupColor()
+{
+  myColorBtn->setColor( SMESH::GetColor( "SMESH", "default_grp_color", QColor( 255, 170, 0 ) ) );
+}
+
 /*!
   \brief SLOT, called when selection is changed. Current implementation does 
    nothing. The method should be redefined in derived classes to update 
@@ -505,6 +516,7 @@ void SMESHGUI_GroupOpDlg::reset()
 {
   myNameEdit->setText("");
   myNameEdit->setFocus();
+  setDefaultGroupColor();
 }
 
 /*!
index 6f6b70175f49c3402cf7cca13d1464c57057719c..f4191a9428a1a91f08a4eccc13d1557a95cda2f0 100644 (file)
@@ -88,6 +88,7 @@ protected:
   SMESH::ListOfGroups*      convert( const QList<SMESH::SMESH_GroupBase_var>& );
 
   SALOMEDS::Color           getColor() const;
+  void                      setDefaultGroupColor();
 
   void                      setIsApplyAndClose( const bool theFlag );
   bool                      isApplyAndClose() const;
index 06d9172e43f2560ee9c8085c573681e4811a30a2..504607da543b8e70bdf7004f2e04a889f38568c1 100644 (file)
@@ -41,6 +41,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_Tools.h>
 
 // Qt includes
 #include <QFrame>
@@ -239,7 +240,9 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
           }
         }
         break;
-      }
+
+      default:;
+      } // switch( (*anIt).myValue.type() )
 
     if( w )
     {
@@ -271,13 +274,20 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
   bool res = result==QDialog::Accepted;
   if( res )
   {
-    SUIT_OverrideCursor wc;
-      /*QString paramValues = */storeParams();
+    try
+    {
+      SUIT_OverrideCursor wc;
+      storeParams();
       // No longer needed since NoteBook appears and "Value" OB field shows names of variable
-//       if ( !paramValues.isEmpty() ) {
-//         if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo ))
-//           SMESH::SetValue( SHyp, paramValues );
-//       }
+      // QString paramValues = storeParams();
+      // if ( !paramValues.isEmpty() ) {
+      //   if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo ))
+      //     SMESH::SetValue( SHyp, paramValues );
+      // }
+    }
+    catch ( const SALOME::SALOME_Exception& S_ex ) {
+      SalomeApp_Tools::QtCatchCorbaException( S_ex );
+    }
   }
 
   changeWidgets().clear();
@@ -297,7 +307,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
   {
     SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo );
     if( listSOmesh.size() > 0 )
-      for( int i = 0; i < listSOmesh.size(); i++ )
+      for( size_t i = 0; i < listSOmesh.size(); i++ )
       {
         _PTR(SObject) submSO = listSOmesh[i];
         SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
@@ -391,8 +401,8 @@ QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams
 {
   QString valueStr = "";
   ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
-  uint len0 = 0;
-  for( int i=0; param!=aLast; param++, i++ )
+  int len0 = 0;
+  for ( ; param != aLast; param++ )
   {
     if ( valueStr.length() > len0 ) {
       valueStr += "; ";
@@ -749,12 +759,12 @@ HypothesisData::HypothesisData( const QString& theTypeName,
     Context( theContext ),
     Dim( theDim ),
     IsAuxOrNeedHyp( theIsAuxOrNeedHyp ),
+    IsNeedGeometry( theIsNeedGeometry ),
+    IsSupportSubmeshes( supportSub ),
     BasicHypos( theBasicHypos ),
     OptionalHypos( theOptionalHypos ),
     InputTypes( theInputTypes ),
-    OutputTypes( theOutputTypes ),
-    IsNeedGeometry( theIsNeedGeometry ),
-    IsSupportSubmeshes( supportSub )
+    OutputTypes( theOutputTypes )
 {
 }
 
index ad2e6f3f3d6b091ccdf572ad7c9dd582c312f6c2..62fbba01125bbe372b277bde2c7e7a33b2d2580b 100644 (file)
@@ -629,7 +629,7 @@ namespace SMESH
             {
               SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
               SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
-              for( int i = 0; i < meshList.size(); i++ )
+              for( size_t i = 0; i < meshList.size(); i++ )
                 RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
             }
         }
@@ -729,7 +729,7 @@ namespace SMESH
   QString GetMessageOnAlgoStateErrors(const algo_error_array& errors)
   {
     QString resMsg; // PAL14861 = QObject::tr("SMESH_WRN_MISSING_PARAMETERS") + ":\n";
-    for ( int i = 0; i < errors.length(); ++i ) {
+    for ( size_t i = 0; i < errors.length(); ++i ) {
       const SMESH::AlgoStateError & error = errors[ i ];
       const bool hasAlgo = ( strlen( error.algoName ) != 0 );
       QString msg;
index f8ab1da2a7af4fe30fe73aa7a0387aae73fb14fd..1767a2805ebbd2b177749c070cfd6718f3da0284 100644 (file)
@@ -305,7 +305,7 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone()
         _PTR(SObject) sobj =
           SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
         mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );  
-        isMesh = !mySrcMesh->_is_nil();
+        //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
       }
       myDlg->setNewMeshEnabled( isMesh );
     }
@@ -374,7 +374,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
       idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
     if ( !idSource->_is_nil() ) {
       SMESH::array_of_ElementType_var types = idSource->GetTypes();
-      for ( int j = 0; j < types->length(); ++j )
+      for ( int j = 0; j < (int) types->length(); ++j )
         if ( types[j] == SMESH::VOLUME )
           hasVolumes = true;
         else if ( types[j] == SMESH::FACE )
index 89034c8a6782b23aa6d4937d66ce61c8dadbc0be..f578c1c2f504ded1d79b6efeaab9f82d2c9c0031 100644 (file)
 #define SPACING 6
 #define MARGIN  11
 
+namespace
+{
+  enum { MANUAL_MODE = 0, SEARCH_MODE }; // how a node to move is specified
+}
+
 /*!
  * \brief Dialog to publish a sub-shape of the mesh main shape
  *        by selecting mesh elements
@@ -437,7 +442,7 @@ void SMESHGUI_MakeNodeAtPointOp::startOperation()
   myDlg->myDestDZ->setReadOnly(true);
   myDlg->myRButNodeToMove->setChecked(true);
 
-  myDlg->ConstructorsClicked(GetConstructorId());
+  myDlg->ConstructorsClicked( GetConstructorId() );
 
   myDlg->show();
 
@@ -469,12 +474,13 @@ void SMESHGUI_MakeNodeAtPointOp::stopOperation()
     mySimulation = 0;
   }
   if ( myMeshActor ) {
-    myMeshActor->SetPointRepresentation(false);
-    SMESH::RepaintCurrentView();
     myMeshActor = 0;
   }
+  SMESH::SetPointRepresentation( false );
+  SMESH::RepaintCurrentView();
+
   disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
-  disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
+  disconnect(mySMESHGUI, SIGNAL (SignalCloseView()),            this, SLOT(onCloseView()));
   selectionMgr()->removeFilter( myFilter );
   SMESHGUI_SelectionOp::stopOperation();
 }
@@ -685,6 +691,9 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
     return;
   myNoPreview = true;
 
+  if ( !myMeshActor && GetConstructorId() == SEARCH_MODE )
+    onSelectionDone();
+
   SMESH::MeshPreviewStruct_var aMeshPreviewStruct;
 
   bool moveShown = false;
@@ -776,7 +785,8 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
             }
           }
         }
-      }catch (...) {
+      }
+      catch (...) {
       }
     }
   }
index e2d3b5b013daedec0babd7edb8be88a99f6ec00a..4b30659ebe8f87193bf6d16a5a2933b4528793ca 100644 (file)
@@ -198,6 +198,7 @@ SMESHGUI_MinDistance::SMESHGUI_MinDistance( QWidget* parent )
   clear();
 
   //setTarget( FirstTgt );
+  selectionChanged();
 }
 
 /*!
@@ -500,13 +501,21 @@ void SMESHGUI_MinDistance::secondEdited()
   setTarget( SecondTgt );
   if ( sender() == mySecondTgt )
     clear();
+  QString text = mySecondTgt->text();
+  if ( !mySecondActor )
+  {
+    selectionChanged();
+    mySecondTgt->setText( text );
+  }
   SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector();
   if ( mySecondActor && selector ) {
     Handle(SALOME_InteractiveObject) IO = mySecondActor->getIO();
     if ( mySecond->checkedId() == NodeTgt || mySecond->checkedId() == ElementTgt ) {
-      TColStd_MapOfInteger ID;
-      ID.Add( mySecondTgt->text().toLong() );
-      selector->AddOrRemoveIndex( IO, ID, false );
+      if ( !text.isEmpty() ) {
+        TColStd_MapOfInteger ID;
+        ID.Add( text.toLong() );
+        selector->AddOrRemoveIndex( IO, ID, false );
+      }
     }
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
       aViewWindow->highlight( IO, true, true );
index f594f650d623db168922ce2979574f6915b265db..e1df393fad444a74bcbdc84acbd909176ca4f8d4 100644 (file)
@@ -102,7 +102,7 @@ QPixmap SMESHGUI_MergeDlg::IconFirst()
     "  ..   ...   ...  ",
     "  ..    ..    ..  ",
     "         .     .  "};
-  return iconFirst;
+  return QPixmap( iconFirst );
 }
 
 //=================================================================================
@@ -797,11 +797,11 @@ void SMESHGUI_MergeDlg::onDetect()
       break;
     }
     
-    for (int i = 0; i < aGroupsArray->length(); i++) {
+    for (int i = 0; i < (int)aGroupsArray->length(); i++) {
       SMESH::long_array& aGroup = aGroupsArray[i];
 
       QStringList anIDs;
-      for (int j = 0; j < aGroup.length(); j++)
+      for (int j = 0; j < (int)aGroup.length(); j++)
         anIDs.append(QString::number(aGroup[j]));
 
       ListCoincident->addItem(anIDs.join(" "));
index 38314468f15793fc042681887ac0c52438e3af23..50fe4e59246f8db15af2859fbdb98c499f001f34 100644 (file)
@@ -173,7 +173,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewD
   vtkPoints* aPoints = vtkPoints::New();
   aPoints->SetNumberOfPoints(aNodesXYZ.length());
 
-  for ( int i = 0; i < aNodesXYZ.length(); i++ ) {
+  for ( size_t i = 0; i < aNodesXYZ.length(); i++ ) {
     aPoints->SetPoint( i, aNodesXYZ[i].x, aNodesXYZ[i].y, aNodesXYZ[i].z );
   }
   myGrid->SetPoints(aPoints);
@@ -197,7 +197,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewD
   vtkIdList *anIdList = vtkIdList::New();
   int aNodePos = 0;
 
-  for ( int i = 0; i < anElemTypes.length(); i++ ) {
+  for ( size_t i = 0; i < anElemTypes.length(); i++ ) {
     const SMESH::ElementSubType& anElementSubType = anElemTypes[i];
     SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType);
     vtkIdType aNbNodes = anElementSubType.nbNodesInElement;
@@ -299,7 +299,7 @@ void SMESHGUI_MeshEditPreview::SetArrowShapeAndNb( int         nbArrows,
   myLabelActors.resize( nbArrows, ( vtkTextActor*) NULL );
   char label[] = "X";
   if ( labels )
-    for ( int iP = 0, iA = 0; iA < nbArrows; ++iA )
+    for ( int iA = 0; iA < nbArrows; ++iA )
     {
       label[0] = labels[iA];
       vtkTextMapper* text = vtkTextMapper::New();
@@ -333,7 +333,7 @@ void SMESHGUI_MeshEditPreview::SetArrows( const gp_Ax1* axes,
 {
   vtkPoints* aPoints = myGrid->GetPoints();
 
-  for ( int iP = 0, iA = 0; iA < myLabelActors.size(); ++iA )
+  for ( int iP = 0, iA = 0; iA < (int) myLabelActors.size(); ++iA )
   {
     gp_Trsf trsf;
     trsf.SetTransformation( gp_Ax3( axes[iA].Location(), axes[iA].Direction() ), gp::XOY() );
index 6fb07fb4fa16e5da7914cfcfa1a2c6da541a2acc..f16d08d87f554efdbf5eb22016e122c7552dc909 100644 (file)
@@ -1268,7 +1268,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
           SMESH::ListOfGroups_var groups = aMesh->GetGroups();
           myInfo->append( "" ); // separator
           bool top_created = false;
-          for ( int i = 0; i < groups->length(); i++ ) {
+          for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
             SMESH::SMESH_GroupBase_var aGrp = groups[i];
             if ( CORBA::is_nil( aGrp ) ) continue;
             QString aName = aGrp->GetName();
@@ -1528,7 +1528,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
           SMESH::ListOfGroups_var  groups = aMesh->GetGroups();
           myInfo->append( "" ); // separator
           bool top_created = false;
-          for ( int i = 0; i < groups->length(); i++ ) {
+          for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
             SMESH::SMESH_GroupBase_var aGrp = groups[i];
             if ( CORBA::is_nil( aGrp ) ) continue;
             QString aName = aGrp->GetName();
@@ -1788,7 +1788,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
         if ( !CORBA::is_nil( aMesh ) ) {
           SMESH::ListOfGroups_var groups = aMesh->GetGroups();
           QTreeWidgetItem* groupsItem = 0;
-          for ( int i = 0; i < groups->length(); i++ ) {
+          for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
             SMESH::SMESH_GroupBase_var aGrp = groups[i];
             if ( CORBA::is_nil( aGrp ) ) continue;
             QString aName = aGrp->GetName();
@@ -2086,7 +2086,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
         if ( !CORBA::is_nil( aMesh ) ) {
           SMESH::ListOfGroups_var  groups = aMesh->GetGroups();
           QTreeWidgetItem* groupsItem = 0;
-          for ( int i = 0; i < groups->length(); i++ ) {
+          for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
             SMESH::SMESH_GroupBase_var aGrp = groups[i];
             if ( CORBA::is_nil( aGrp ) ) continue;
             QString aName = aGrp->GetName();
@@ -2643,7 +2643,7 @@ void SMESHGUI_AddInfo::showGroups()
       itemGroups->setData( 0, Qt::UserRole, GROUPS_ID );
 
       // total number of groups > 10, show extra widgets for info browsing
-      if ( myGroups->length() > MAXITEMS ) {
+      if ((int) myGroups->length() > MAXITEMS ) {
         ExtraWidget* extra = new ExtraWidget( this, true );
         connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousGroups() ) );
         connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextGroups() ) );
@@ -2704,7 +2704,7 @@ void SMESHGUI_AddInfo::showSubMeshes()
       itemSubMeshes->setData( 0, Qt::UserRole, SUBMESHES_ID );
 
       // total number of sub-meshes > 10, show extra widgets for info browsing
-      if ( mySubMeshes->length() > MAXITEMS ) {
+      if ((int) mySubMeshes->length() > MAXITEMS ) {
         ExtraWidget* extra = new ExtraWidget( this, true );
         connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousSubMeshes() ) );
         connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextSubMeshes() ) );
@@ -2917,7 +2917,7 @@ void SMESHGUI_MeshInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO
     myCtrlInfo->showInfo( obj );
 
     myActor = SMESH::FindActorByEntry( IO->getEntry() );
-    SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector();
+    SVTK_Selector* selector = SMESH::GetSelector();
     QString ID;
     int nb = 0;
     if ( myActor && selector ) {
@@ -3081,7 +3081,7 @@ void SMESHGUI_MeshInfoDlg::modeChanged()
 */
 void SMESHGUI_MeshInfoDlg::idChanged()
 {
-  SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector();
+  SVTK_Selector* selector = SMESH::GetSelector();
   if ( myActor && selector ) {
     Handle(SALOME_InteractiveObject) IO = myActor->getIO();
     TColStd_MapOfInteger ID;
@@ -3147,7 +3147,7 @@ void SMESHGUI_MeshInfoDlg::dump()
 
   DumpFileDlg fd( this );
   fd.setWindowTitle( tr( "SAVE_INFO" ) );
-  fd.setFilters( aFilters );
+  fd.setNameFilters( aFilters );
   fd.myBaseChk->setChecked( anIsBase );
   fd.myElemChk->setChecked( anIsElem );
   fd.myAddChk ->setChecked( anIsAdd );
@@ -3858,7 +3858,7 @@ void SMESHGUI_CtrlInfoDlg::dump()
 
   DumpFileDlg fd( this );
   fd.setWindowTitle( tr( "SAVE_INFO" ) );
-  fd.setFilters( aFilters );
+  fd.setNameFilters( aFilters );
   fd.myBaseChk->hide();
   fd.myElemChk->hide();
   fd.myAddChk ->hide();
index f4912f423c753877767ad74630ff7bc9bb8b21dc..69053214aa526c23b7a0f392406890b190e6f89c 100644 (file)
 //================================================================================
 SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh )
 : SMESHGUI_SelectionOp(),
-  myToCreate( theToCreate ),
-  myIsMesh( theIsMesh ),
   myDlg( 0 ),
   myShapeByMeshOp( 0 ),
+  myToCreate( theToCreate ),
+  myIsMesh( theIsMesh ),
   myHypoSet( 0 )
 {
   if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists
@@ -224,7 +224,7 @@ void SMESHGUI_MeshOp::startOperation()
     }
   }
   SMESHGUI_SelectionOp::startOperation();
-  // iterate through dimensions and get available algoritms, set them to the dialog
+  // iterate through dimensions and get available algorithms, set them to the dialog
   _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
   for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
   {
@@ -576,7 +576,7 @@ void SMESHGUI_MeshOp::selectionDone()
 
       if (aSeq->length() > 0) {
         shapeDim = -1;
-        for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
+        for ( CORBA::ULong iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
           GEOM::GEOM_Object_var aGeomVar = aSeq[iss];
           switch ( aGeomVar->GetShapeType() ) {
           case GEOM::SOLID:  shapeDim = 3; break;
@@ -1481,14 +1481,6 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
   if (aDim == -1)
     return;
 
-  // find highest available dimension, all algos of this dimension are available for choice
-  int aTopDim = -1;
-  for (int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++)
-    if (isAccessibleDim( i ))
-      aTopDim = i;
-  if (aTopDim == -1)
-    return;
-
   const bool isSubmesh = ( myToCreate ? !myIsMesh : myDlg->isObjectShown( SMESHGUI_MeshDlg::Mesh ));
 
   HypothesisData* algoData = hypData( aDim, Algo, theIndex );
@@ -1497,32 +1489,25 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
 
   QStringList anAvailable;
 
-  // check that tab enabled of one less dimension
-  if ( aDim > SMESH::DIM_0D )
-  {
-    if ( isAccessibleDim( aDim - 1 ) ) {
-      if ( algoData && myIsOnGeometry ) {
-        for (int i = aDim - 1; i >= SMESH::DIM_0D; i--) {
-          if ( isAccessibleDim( i ) && ( currentHyp( i, Algo ) < 0 ||
-             algoData->InputTypes.isEmpty() ) ) {
-            myDlg->disableTab( i );
-            setCurrentHyp(i, Algo, -1);
-          }
-        }
+  // enable / disable tabs
+  if ( myIsOnGeometry ) {
+    for (int i = SMESH::DIM_3D; i >= SMESH::DIM_0D; i--) {
+      if ( i > aDim ) {
+        if ( i > myMaxShapeDim ) myDlg->disableTab( i );
+        else                     myDlg->enableTab( i );
       }
-    }
-    if ( algoData && myIsOnGeometry && !algoData->InputTypes.isEmpty() ) {
-      myDlg->enableTab( aDim - 1 );
-    }
-    if ( !algoData ) {
-      if ( aDim != SMESH::DIM_2D || ( aDim == SMESH::DIM_2D &&
-         currentHyp( SMESH::DIM_2D, Algo ) < 0) ) {
-        for (int i = aDim - 1; i >= SMESH::DIM_0D; i--)
-          myDlg->enableTab( i );
+      else if ( i == aDim ) {
+        continue;
       }
-      else {
-        for (int i = aDim - 1; i >= SMESH::DIM_0D; i--)
+      else {//( i < aDim )
+        if ( algoData && algoData->InputTypes.isEmpty() ) {
           myDlg->disableTab( i );
+          for ( int type = Algo, nbTypes = nbDlgHypTypes(i); type < nbTypes; type++ )
+            setCurrentHyp(i, type, -1);
+        }
+        else {
+          myDlg->enableTab( i );
+        }
       }
     }
   }
@@ -1566,7 +1551,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
         nextAlgo = 0;
       }
 
-      // set new available algoritms
+      // set new available algorithms
       availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], prevAlgo, nextAlgo, anCurrentCompareType);
       HypothesisData* soleCompatible = 0;
       if ( anAvailable.count() == 1 )
@@ -1576,13 +1561,15 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
       algoIndex = myAvailableHypData[dim][Algo].indexOf( curAlgo );
       if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D) {
         // select the sole compatible algo
-        algoIndex = myAvailableHypData[dim][Algo].indexOf( soleCompatible );
+        algoIndex = 0;
       }
-      setCurrentHyp( dim, Algo, algoIndex);
+      setCurrentHyp( dim, Algo, algoIndex );
 
       // remember current algo
       prevAlgo = algoByDim[ dim ] = hypData( dim, Algo, algoIndex );
-    }
+
+    } // loop on dims
+
     if ( myMaxShapeDim == SMESH::DIM_3D && forward && algoDim == SMESH::DIM_1D )
     {
       algoDim = SMESH::DIM_3D;
@@ -1590,9 +1577,10 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
       a3DAlgo = prevAlgo;
       continue;
     }
-  }
+  } // loops backward and forward
+
 
-  // set hypotheses corresponding to the found algoritms
+  // set hypotheses corresponding to the found algorithms
 
   _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
 
@@ -2126,7 +2114,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
     return anAlgoVar;
   QString aHypName = dataList[ aHypIndex ]->TypeName;
 
-  // get existing algoritms
+  // get existing algorithms
   _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
   QStringList tmp;
   existingHyps( theDim, Algo, pObj, tmp, myExistingHyps[ theDim ][ Algo ]);
@@ -2263,6 +2251,9 @@ void SMESHGUI_MeshOp::readMesh()
     {
       // get hypotheses
       existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] );
+      if ( myObjHyps[ dim ][ hypType ].count() == 0 ) {
+        setCurrentHyp( dim, hypType, -1 );
+      }
       for ( int i = 0, nb = myObjHyps[ dim ][ hypType ].count(); i < nb; ++i )
       {
         // find index of required hypothesis among existing ones for this dimension and type
@@ -2403,7 +2394,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
   // Assign new algorithms and hypotheses
   for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ )
   {
-    if ( !isAccessibleDim( dim )) continue;
+    //if ( !isAccessibleDim( dim )) continue;
 
     // find or create algorithm
     SMESH::SMESH_Hypothesis_var anAlgoVar = getAlgo( dim );
@@ -2666,7 +2657,7 @@ void SMESHGUI_MeshOp::onAlgoSetByMeshType( const int theTabIndex, const int theI
   * \param theIndex - Index of current type of mesh
  */
 //================================================================================
-void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theIndex)
+void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theIndex )
 {
   QStringList anAvailableAlgs;
   QString anCompareType = currentMeshTypeName( theIndex );
@@ -2684,7 +2675,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
       anCurrentAvailableAlgo = -1;
       isNone = currentHyp( dim, Algo ) < 0;
       //return current algo in current tab and set new algorithm list
-      HypothesisData* algoCur;
+      HypothesisData* algoCur = 0;
       if ( !isNone && !myAvailableHypData[dim][Algo].empty() ) {
         algoCur = myAvailableHypData[dim][Algo].at( currentHyp( dim, Algo ) );
       }
@@ -2702,8 +2693,6 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
       setCurrentHyp( dim, Algo, anCurrentAvailableAlgo );
       if ( anCurrentAvailableAlgo > -1 )
         isReqDisBound = algoCur->InputTypes.isEmpty();
-      else if ( dim != SMESH::DIM_3D && currentHyp( SMESH::DIM_3D, Algo ) >= 0 )
-        isReqDisBound = true;
       if ( isReqDisBound ) {
         aReqDim = dim;
         break;
@@ -2716,8 +2705,8 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
       }
     else
       for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) {
-        if ( i > myMaxShapeDim || ( isReqDisBound && i < aReqDim ) ) myDlg->disableTab( i );
-        else                                                         myDlg->enableTab( i );
+        if ( i > myMaxShapeDim || ( isReqDisBound && i != aReqDim ) ) myDlg->disableTab( i );
+        else                                                          myDlg->enableTab( i );
       }
     myDlg->setCurrentTab( theTabIndex );
   }
@@ -2754,40 +2743,32 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
       setCurrentHyp( dim, Algo, anCurrentAvailableAlgo );
     }
 
-    if ( isNone || isReqDisBound ) {
-      for ( int i = SMESH::DIM_0D; i <= myMaxShapeDim; i++ ) {
-        if ( aDim != i ) {
-          myDlg->disableTab( i );
-        }
-      }
-    }
-    else if ( !isNone ) {
-      if ( aDim == SMESH::DIM_2D) {
-        myDlg->disableTab( SMESH::DIM_3D );
-        setCurrentHyp( SMESH::DIM_3D, Algo, -1);
-      }
-      for ( int i = myMaxShapeDim; i > SMESH::DIM_0D; i-- ) {
-        bool isNoneAlg = currentHyp( i, Algo ) < 0;
-        if ( !isNoneAlg )
-          isReqDisBound = myAvailableHypData[i][Algo].at( currentHyp( i, Algo ) )->InputTypes.isEmpty();
-        else
-          isReqDisBound = true;
-        if ( isReqDisBound && isNoneAlg ) {
-          for (int j = i - 1; j >= SMESH::DIM_0D; j--) {
-            if ( j < aDim && currentHyp( j+1, Algo ) < 0 ) {
-              myDlg->disableTab( j );
-              setCurrentHyp( j , Algo, -1 );
-            }
+    for ( int i = myMaxShapeDim; i >= SMESH::DIM_0D; i-- ) {
+      bool isNoneAlg = currentHyp( i, Algo ) < 0;
+      if ( !isNoneAlg )
+        isReqDisBound = myAvailableHypData[i][Algo].at( currentHyp( i, Algo ) )->InputTypes.isEmpty();
+      else
+        isReqDisBound = true;
+      if ( isReqDisBound && !isNoneAlg && i <= aDim) {
+        for (int j = myMaxShapeDim; j >= SMESH::DIM_0D; j--) {
+          if ( currentHyp( j, Algo ) < 0 ) {
+            myDlg->disableTab( j );
+            setCurrentHyp( j , Algo, -1 );
           }
-          break;
-        }
-        else if ( isNoneAlg ) {
-          myDlg->disableTab( i );
         }
+        break;
+      }
+      else {
+        myDlg->enableTab( i );
       }
     }
-    myDlg->enableTab( aDim );
-    myDlg->setCurrentTab( aDim );
+    if ( aDim == SMESH::DIM_2D) {
+      myDlg->disableTab( SMESH::DIM_3D );
+      setCurrentHyp( SMESH::DIM_3D, Algo, -1);
+    }
+
+    int currentTab = ( theTabIndex <= aDim ) ? theTabIndex : aDim;
+    myDlg->setCurrentTab( currentTab );
   }
   THypDataList anAvailableAlgsData;
   QStringList aHypothesesSetsList = SMESH::GetHypothesesSets( aDim );
index 206f4504e97784ff74d3f3a85b681b7d1b72172d..35bd506723b89850afe6e8260cb9dd2200a55bef 100644 (file)
@@ -157,15 +157,15 @@ private:
   bool                           myHasConcurrentSubBefore;
 
   TDim2Type2HypList              myExistingHyps; //!< all hypothesis of SMESH module
-  TDim2Type2HypList              myObjHyps;      //!< hypothesis assigned to the current 
+  TDim2Type2HypList              myObjHyps;      //!< hypothesis assigned to the current
                                                  //   edited mesh/sub-mesh
   // hypdata corresponding to hypotheses present in myDlg
   THypDataList                   myAvailableHypData[4][NbHypTypes];
   QString                        myLastGeomToSelect;
   THypLabelIsAppMap              myHypMapIsApplicable;
   bool                           myIgnoreAlgoSelection;
-  HypothesesSet* myHypoSet;
-  int myDim, myType, myMaxShapeDim;
+  HypothesesSet*                 myHypoSet;
+  int                            myDim, myType, myMaxShapeDim;
 
   QString                        myObjectToSelect;
 };
index dd4d753377e5abe513a2ca41257535fde408d23f..654e6d6ce28638047733ef00548e0fde75683b11 100755 (executable)
@@ -809,10 +809,10 @@ void SMESHGUI_MeshPatternDlg::onOpen()
   SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, true);
   aDlg->setWindowTitle(tr("LOAD_PATTERN"));
   aDlg->setFileMode(QFileDialog::ExistingFile);
-  aDlg->setFilters(prepareFilters());
+  aDlg->setNameFilters(prepareFilters());
   if (!myName->text().isEmpty())
     aDlg->selectFile(myName->text() + ".smp");
-  QPushButton* anOkBtn = qFindChild<QPushButton*>( aDlg, "OK" );
+  QPushButton* anOkBtn = aDlg->findChild<QPushButton*>( "OK" );
   if (anOkBtn != 0)
     anOkBtn->setText(tr("SMESH_BUT_OK"));
 
@@ -826,9 +826,9 @@ void SMESHGUI_MeshPatternDlg::onOpen()
   if (QFileInfo(fName).suffix().isEmpty())
     fName = autoExtension(fName);
 
-  fName = QDir::convertSeparators(fName);
+  fName = QDir::toNativeSeparators(fName);
 
-  QString prev = QDir::convertSeparators(myName->text());
+  QString prev = QDir::toNativeSeparators(myName->text());
   if (prev == fName)
     return;
 
index f123ea17ea7ccf412e128ea3c31e095fe446fd6a..ffae8359b7c51b8197bb48316a5d1432341e7ee8 100755 (executable)
@@ -112,8 +112,8 @@ SMESHGUI_MultiEditDlg
                         const bool the3d2d,
                         bool       theDoInit):
   SMESHGUI_PreviewDlg(theModule),
-  mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+  mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySMESHGUI(theModule)
 {
   setModal(false);
@@ -1572,7 +1572,6 @@ SMESHGUI_SplitVolumesDlg::SMESHGUI_SplitVolumesDlg(SMESHGUI* theModule)
   QLabel* dXLbl = new QLabel( tr("SMESH_DX"), myFacetSelGrp);
   QLabel* dYLbl = new QLabel( tr("SMESH_DY"), myFacetSelGrp);
   QLabel* dZLbl = new QLabel( tr("SMESH_DZ"), myFacetSelGrp);
-  QPushButton* axisBtn[3];
   for ( int i = 0; i < 3; ++i )
   {
     myPointSpin[i] = new SMESHGUI_SpinBox( myFacetSelGrp );
@@ -1853,7 +1852,7 @@ void SMESHGUI_SplitVolumesDlg::showFacetByElement( int elemID )
   gp_XYZ bc( 0,0,0 );
   Bnd_B3d bbox;
   SMDS_NodeIteratorPtr nIt = elem->nodeIterator();
-  vector< const SMDS_MeshNode* > nodes;
+  std::vector< const SMDS_MeshNode* > nodes;
   nodes.reserve( elem->NbNodes() );
   while ( nIt->more() )
   {
@@ -1983,7 +1982,7 @@ void SMESHGUI_SplitVolumesDlg::onSetDir()
     if ( sender() == myAxisBtn[i] )
       break;
   if ( i == 3 )
-    i == 0;
+    i = 0;
   myDirSpin[i]->SetValue(1.);
 
   if ( myActor && !myMesh->_is_nil() && myMesh->NbNodes() > 0 )
index e163699d4fc9921378360e394f3f1a8ad23c6dc0..5a2cf87b8e20c0e192aff50ad89ab6d6a64a807f 100644 (file)
@@ -230,8 +230,8 @@ namespace SMESH
 //=================================================================================
 SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): 
   QDialog( SMESH::GetDesktop( theModule ) ),
-  mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
   mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+  mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
   mySMESHGUI( theModule )
 {
   setModal( false );
index d466dedf32efe535dd17667d2ca2420039641735..8dc5f52c936104e0451554d3ae1b8ec8c3cbf321 100644 (file)
@@ -45,8 +45,8 @@
 // purpose  :
 //=================================================================================
 SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
-  mySMESHGUI(theModule),
   QDialog(SMESH::GetDesktop( theModule )),
+  mySMESHGUI(theModule),
   myIsApplyAndClose( false )
 {
   mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
@@ -151,8 +151,8 @@ void SMESHGUI_PreviewDlg::onOpenView()
 // purpose  :
 //=================================================================================
 SMESHGUI_MultiPreviewDlg::SMESHGUI_MultiPreviewDlg( SMESHGUI* theModule ) :
-  mySMESHGUI( theModule ),
   QDialog( SMESH::GetDesktop( theModule ) ),
+  mySMESHGUI( theModule ),
   myIsApplyAndClose( false )
 {
   mySimulationList.clear();
index 1decdeff61f3cad222877bc3958701877badba6f..e60f386b61e11d0bd57bd49d8f62e774222fc247 100644 (file)
@@ -42,6 +42,7 @@
 #include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -80,8 +81,8 @@
 SMESHGUI_RemoveElementsDlg
 ::SMESHGUI_RemoveElementsDlg(SMESHGUI* theModule)
   : QDialog(SMESH::GetDesktop(theModule)),
-    mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+    mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySMESHGUI(theModule),
     myBusy(false),
     myFilterDlg(0)
@@ -225,7 +226,10 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply()
   if (mySMESHGUI->isActiveStudyLocked())
     return;
 
-  if (myNbOkElements) {
+  if (myNbOkElements)
+  {
+    SUIT_OverrideCursor wc;
+
     QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
     SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
     anArrayOfIdeces->length(aListId.count());
@@ -233,7 +237,8 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply()
       anArrayOfIdeces[i] = aListId[ i ].toInt();
 
     bool aResult = false;
-    try {
+    try
+    {
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
       aResult = aMeshEditor->RemoveElements(anArrayOfIdeces.in());
 
@@ -377,7 +382,7 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
 void SMESHGUI_RemoveElementsDlg::SelectionIntoArgument()
 {
   if (myBusy) return;                                  // busy
-  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter digl active
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
   if (!GroupButtons->isEnabled()) return;              // inactive
 
   // clear
index 5baaf4dc24aaa89b84dcafaeca93777a87498e71..8b9ab2e551367ba37d6d3287dc219ba512c18228 100644 (file)
@@ -81,8 +81,8 @@
 SMESHGUI_RemoveNodesDlg
 ::SMESHGUI_RemoveNodesDlg(SMESHGUI* theModule)
   : QDialog(SMESH::GetDesktop(theModule)),
-    mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+    mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySMESHGUI(theModule),
     myBusy(false),
     myFilterDlg(0)
index a91586798c0e9c657c4a93ec1a657a1502757fb9..82a7a0451b30c1bcecce4cbfdf92e208191a7d80 100644 (file)
@@ -612,9 +612,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
     if ( !aMesh )
       return;
 
-    int aNbUnits = 0;
-
-    bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X ||
+    bool isNodeSelected = ((myEditCurrentArgument == (QWidget*)SpinBox_X ) ||
                            (myEditCurrentArgument == (QWidget*)SpinBox_DX &&
                             myVectorDefinition==POINT_SELECT));
 
index 9531609ab967351f2706ee710467974516717fe3..81568b57d01fd72afa21c1bd601149e3ae24eccb 100644 (file)
@@ -677,6 +677,7 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText)
 void SMESHGUI_RotationDlg::SelectionIntoArgument()
 {
   if (myBusy) return;
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
 
   // clear
   myActor = 0;
@@ -705,34 +706,35 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
 
   int aNbUnits = 0;
 
-  if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+  if (myEditCurrentArgument == (QWidget*)LineEditElements)
+  {
     myElementsId = "";
     myObjects.clear();
     myObjectsNames.clear();
     myMeshes.clear();
 
-    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() )
+    {
       Handle(SALOME_InteractiveObject) IO = it.Value();
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
       if ( aMesh->_is_nil() )
         return;
-      
+
       myActor = SMESH::FindActorByObject( aMesh );
       if ( !myActor )
         myActor = SMESH::FindActorByEntry( IO->getEntry() );
-      if ( !myActor && !CheckBoxMesh->isChecked() )
-        return;
-      
-      if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-          _PTR(GenericAttribute) anAttr;
-          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-            _PTR(AttributeName) aNameAttr( anAttr );
-            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-            myObjectsNames << aNameAttr->Value().c_str();
-            myMeshes << aMesh;
-          }
+      // if ( !myActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter
+      //   return;
+
+      SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+      if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc ))
+      {
+        std::string name = obj->GetName();
+        if ( !name.empty() )
+        {
+          myObjects << idSrc;
+          myObjectsNames << name.c_str();
+          myMeshes << aMesh;
         }
       }
     }
@@ -748,11 +750,11 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
     else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) {
       MakeGroupsCheck->setEnabled(true);
     }
-    if (CheckBoxMesh->isChecked()) {
-      SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
+    if (CheckBoxMesh->isChecked()) {
       if ( myMeshes.isEmpty() )
         return;
+      SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
     }
     else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aList.First(), aString);
@@ -763,15 +765,13 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
 
     myNbOkElements = true;
 
-  } else {
+  }
+  else // set coordinates by picked nodes
+  {
     Handle(SALOME_InteractiveObject) IO = aList.First();
-    if ((SMESH::GetMeshByIO(IO))->_is_nil())
-      return;
 
-    SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO));
+    SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
     if (!anActor)
-      anActor = SMESH::FindActorByEntry(IO->getEntry());
-    if (!anActor && !CheckBoxMesh->isChecked())
       return;
 
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@@ -1061,9 +1061,20 @@ void SMESHGUI_RotationDlg::setFilters()
                               tr("NO_MESH_SELECTED"));
    return;
   }
-  if ( !myFilterDlg )
+  if ( !myFilterDlg ) {
     myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+    connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted()));
+  }
 
+  QList<int> types;
+  if ( myMeshes[0]->NbEdges()     ) types << SMESH::EDGE;
+  if ( myMeshes[0]->NbFaces()     ) types << SMESH::FACE;
+  if ( myMeshes[0]->NbVolumes()   ) types << SMESH::VOLUME;
+  if ( myMeshes[0]->NbBalls()     ) types << SMESH::BALL;
+  if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+  if ( types.count() > 1 )          types << SMESH::ALL;
+
+  myFilterDlg->Init( types );
   myFilterDlg->SetSelection();
   myFilterDlg->SetMesh( myMeshes[0] );
   myFilterDlg->SetSourceWg( LineEditElements );
@@ -1071,6 +1082,23 @@ void SMESHGUI_RotationDlg::setFilters()
   myFilterDlg->show();
 }
 
+//=======================================================================
+// name    : onFilterAccepted()
+// Purpose : SLOT. Called when Filter dlg closed with OK button.
+//           Activate [Apply] if no Actor is available
+//=======================================================================
+void SMESHGUI_RotationDlg::onFilterAccepted()
+{
+  if ( myMeshes.length() > 0 && !buttonOk->isEnabled() )
+  {
+    myElementsId = LineEditElements->text();
+    QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+    myNbOkElements = aListElementsId.count();
+    buttonOk->setEnabled( myNbOkElements );
+    buttonApply->setEnabled( myNbOkElements );
+  }
+}
+
 //=================================================================================
 // function : isValid
 // purpose  :
index 8b4be67e662d8e5c492f25c109eee76d81708f66..736bafb5916d2e621244939294dce81c3d6c33f6 100644 (file)
@@ -135,6 +135,7 @@ private:
 protected slots:
   virtual void           onDisplaySimulation( bool );
   virtual void           reject();
+  void                   onFilterAccepted();
  
 private slots:
   void                   ClickOnOk();
index 1e712f0a348148f80ff5c8ed8100e4de4835c852..2248ac60eec32fefcdca45ed4615c8bd62df4e25 100644 (file)
@@ -715,6 +715,8 @@ void SMESHGUI_ScaleDlg::onTextChange (const QString& theNewText)
 void SMESHGUI_ScaleDlg::SelectionIntoArgument()
 {
   if (myBusy) return;
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
+
   BusyLocker lock( myBusy );
   // clear
   myActor = 0;
@@ -741,38 +743,39 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument()
 
   int aNbUnits = 0;
 
-  if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+  if (myEditCurrentArgument == (QWidget*)LineEditElements)
+  {
     myElementsId = "";
     myObjects.clear();
     myObjectsNames.clear();
     myMeshes.clear();
 
-    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() )
+    {
       Handle(SALOME_InteractiveObject) IO = it.Value();
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
       if ( aMesh->_is_nil() )
         return;
-  
+
       myActor = SMESH::FindActorByObject( aMesh );
       if ( !myActor )
         myActor = SMESH::FindActorByEntry( IO->getEntry() );
-      if ( !myActor && !CheckBoxMesh->isChecked() )
-        return;
-
-      if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-          _PTR(GenericAttribute) anAttr;
-          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-            _PTR(AttributeName) aNameAttr( anAttr );
-            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-            myObjectsNames << aNameAttr->Value().c_str();
-            myMeshes << aMesh;
-          }
+      // if ( !myActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter
+      //   return;
+
+      SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+      if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc ))
+      {
+        std::string name = obj->GetName();
+        if ( !name.empty() )
+        {
+          myObjects << idSrc;
+          myObjectsNames << name.c_str();
+          myMeshes << aMesh;
         }
       }
     }
-      
+
     // MakeGroups is available if there are groups and "Copy"
     int aNbGroups = 0;
     for ( int i = 0; i < myMeshes.count(); i++ )
@@ -787,50 +790,11 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument()
     }
 
     if (CheckBoxMesh->isChecked()) {
-      SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
       if (myMeshes.isEmpty())
         return;
-        // get IDs from mesh
-        /*
-        SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
-        if (!aSMDSMesh)
-          return;
-
-        for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
-          const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
-          if (e) {
-            myElementsId += QString(" %1").arg(i);
-            aNbUnits++;
-          }
-        }
-      } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
-        // get submesh
-        SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
-        // get IDs from submesh
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aSubMesh->GetElementsId();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      } else { // GROUP
-        // get smesh group
-        SMESH::SMESH_GroupBase_var aGroup =
-          SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
-        if (aGroup->_is_nil())
-          return;
-
-        // get IDs from smesh group
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aGroup->GetListOfID();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      }
-        */
-    } else {
+      SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
+    }
+    else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aList.First(), aString);
       myElementsId = aString;
       if (aNbUnits < 1)
@@ -838,15 +802,14 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument()
     }
 
     myNbOkElements = true;
-  } else {
+
+  }
+  else // set coordinates by a picked node
+  {
     Handle(SALOME_InteractiveObject) IO = aList.First();
-    if ((SMESH::GetMeshByIO(IO))->_is_nil())
-      return;
 
-    SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO));
+    SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
     if (!anActor)
-      anActor = SMESH::FindActorByEntry(IO->getEntry());
-    if (!anActor && !CheckBoxMesh->isChecked())
       return;
 
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@@ -1103,15 +1066,24 @@ void SMESHGUI_ScaleDlg::keyPressEvent( QKeyEvent* e )
 //=================================================================================
 void SMESHGUI_ScaleDlg::setFilters()
 {
-  if(myMeshes.isEmpty()) {
-    SUIT_MessageBox::critical(this,
-                              tr("SMESH_ERROR"),
-                              tr("NO_MESH_SELECTED"));
-   return;
+  if ( myMeshes.isEmpty() ) {
+    SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED"));
+    return;
   }
-  if ( !myFilterDlg )
+  if ( !myFilterDlg ) {
     myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+    connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted()));
+  }
 
+  QList<int> types;
+  if ( myMeshes[0]->NbEdges()     ) types << SMESH::EDGE;
+  if ( myMeshes[0]->NbFaces()     ) types << SMESH::FACE;
+  if ( myMeshes[0]->NbVolumes()   ) types << SMESH::VOLUME;
+  if ( myMeshes[0]->NbBalls()     ) types << SMESH::BALL;
+  if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+  if ( types.count() > 1 )          types << SMESH::ALL;
+
+  myFilterDlg->Init( types );
   myFilterDlg->SetSelection();
   myFilterDlg->SetMesh( myMeshes[0] );
   myFilterDlg->SetSourceWg( LineEditElements );
@@ -1119,6 +1091,23 @@ void SMESHGUI_ScaleDlg::setFilters()
   myFilterDlg->show();
 }
 
+//=======================================================================
+// name    : onFilterAccepted()
+// Purpose : SLOT. Called when Filter dlg closed with OK button.
+//           Activate [Apply] if no Actor is available
+//=======================================================================
+void SMESHGUI_ScaleDlg::onFilterAccepted()
+{
+  if ( myMeshes.length() > 0 && !buttonOk->isEnabled() )
+  {
+    myElementsId = LineEditElements->text();
+    QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+    myNbOkElements = aListElementsId.count();
+    buttonOk->setEnabled   ( myNbOkElements );
+    buttonApply->setEnabled( myNbOkElements );
+  }
+}
+
 //=================================================================================
 // function : isValid
 // purpose  :
index a7a15d6ba98b4b6519679364bcd0c7ada3d26208..bdd285b2830037460d00395d599460656b14d81b 100644 (file)
@@ -131,6 +131,7 @@ private:
 protected slots:
   virtual void           onDisplaySimulation( bool );
   virtual void           reject();
+  void                   onFilterAccepted();
    
 private slots:
   void                   ConstructorsClicked( int );
index 3661fa85304ecae7834acfa364b28035977602ed..3d446d96d43f9019368789e84136041d16b5ff83 100644 (file)
@@ -129,6 +129,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
   else if ( p=="isComputable" )         val = QVariant( isComputable( ind ) );
   else if ( p=="isPreComputable" )      val = QVariant( isPreComputable( ind ) );
   else if ( p=="hasGeomReference" )     val = QVariant( hasGeomReference( ind ) );
+  else if ( p=="isEditableHyp" )        val = QVariant( isEditableHyp( ind ) );
   else if ( p=="isImported" )           val = QVariant( isImported( ind ) );
   else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) );
   else if ( p=="groupType" )            val = QVariant( groupType( ind ) );
@@ -474,7 +475,7 @@ int SMESHGUI_Selection::dim( int ind ) const
       if ( !CORBA::is_nil( idSrc ) )
       {
         SMESH::array_of_ElementType_var types = idSrc->GetTypes();
-        for ( int i = 0; i < types->length(); ++ i) {
+        for ( size_t i = 0; i < types->length(); ++ i) {
           switch ( types[i] ) {
           case SMESH::EDGE  : dim = std::max( dim, 1 ); break;
           case SMESH::FACE  : dim = std::max( dim, 2 ); break;
@@ -495,16 +496,16 @@ int SMESHGUI_Selection::dim( int ind ) const
 //purpose  : return true for a ready-to-compute mesh
 //=======================================================================
 
-QVariant SMESHGUI_Selection::isComputable( int ind ) const
+bool SMESHGUI_Selection::isComputable( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" )
   {
     QMap<int,int> modeMap;
     _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
     SMESHGUI_PrecomputeOp::getAssignedAlgos( so, modeMap );
-    return QVariant( modeMap.size() > 0 );
+    return modeMap.size() > 0;
   }
-  return QVariant( false );
+  return false;
 }
 
 //=======================================================================
@@ -512,7 +513,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
 //purpose  : returns true for a mesh with algorithms
 //=======================================================================
 
-QVariant SMESHGUI_Selection::isPreComputable( int ind ) const
+bool SMESHGUI_Selection::isPreComputable( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" )
   {
@@ -523,11 +524,11 @@ QVariant SMESHGUI_Selection::isPreComputable( int ind ) const
       _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
       SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
       if ( modeMap.size() > 1 )
-        return QVariant( ( modeMap.contains( SMESH::DIM_3D )) ||
-                         ( modeMap.contains( SMESH::DIM_2D ) && maxDim < 1 ));
+        return (( modeMap.contains( SMESH::DIM_3D )) ||
+                ( modeMap.contains( SMESH::DIM_2D ) && maxDim < 1 ));
     }
   }
-  return QVariant( false );
+  return false;
 }
 
 //=======================================================================
@@ -535,15 +536,35 @@ QVariant SMESHGUI_Selection::isPreComputable( int ind ) const
 //purpose  : returns true for a mesh or sub-mesh on geometry
 //=======================================================================
 
-QVariant SMESHGUI_Selection::hasGeomReference( int ind ) const
+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() );
     GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
-    return QVariant( !shape->_is_nil() );
+    return !shape->_is_nil();
+  }
+  return false;
+}
+
+//=======================================================================
+//function : isEditableHyp
+//purpose  : 
+//=======================================================================
+
+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() );
+    SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface<SMESH::SMESH_Hypothesis>( so );
+    if ( !hyp->_is_nil() )
+    {
+      isEditable = hyp->HasParameters();
+    }
   }
-  return QVariant( false );
+  return isEditable;
 }
 
 //=======================================================================
@@ -551,17 +572,17 @@ QVariant SMESHGUI_Selection::hasGeomReference( int ind ) const
 //purpose  : 
 //=======================================================================
 
-QVariant SMESHGUI_Selection::isVisible( int ind ) const
+bool SMESHGUI_Selection::isVisible( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
   {
     SMESH_Actor* actor = SMESH::FindActorByEntry( entry( ind ).toLatin1().data() );
     if ( actor && actor->hasIO() ) {
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() )
-        return QVariant( aViewWindow->isVisible( actor->getIO() ) );
+        return aViewWindow->isVisible( actor->getIO() );
     }
   }
-  return QVariant( false );
+  return false;
 }
 
 //=======================================================================
index de0d0d12f1f73c02a8bc64e2623b77152d49c87a..e3146cad3e341b718553d2afa07889b4fd01761a 100644 (file)
@@ -56,10 +56,11 @@ public:
   virtual bool            isAutoColor( int ) const;
   virtual int             numberOfNodes( int ) const;
   virtual int             dim( int ) const;
-  virtual QVariant        isComputable( int ) const;
-  virtual QVariant        isPreComputable( int ) const;
-  virtual QVariant        hasGeomReference( int ) const;
-  virtual QVariant        isVisible( int ) const;
+  virtual bool            isComputable( int ) const;
+  virtual bool            isPreComputable( int ) const;
+  virtual bool            hasGeomReference( int ) const;
+  virtual bool            isEditableHyp( int ) const;
+  virtual bool            isVisible( int ) const;
 
   virtual QString         quadratic2DMode( int ) const;
 
index d7a47f7d08a6bbf466eed370c439a137cd5ebf32..d7f598c826fea5462c582ea2d461cb8626f04674 100644 (file)
@@ -826,12 +826,13 @@ bool SMESHGUI_SewingDlg::haveBorders()
 
 QString SMESHGUI_SewingDlg::getPartText(const SMESH::FreeBorderPart& aPART)
 {
+  typedef CORBA::Long TInt;
   QString text;
-  if ( 0 <= aPART.border && aPART.border < myBorders->borders.length() )
+  if ( 0 <= aPART.border && aPART.border < (TInt)myBorders->borders.length() )
   {
     const SMESH::FreeBorder& aBRD = myBorders->borders[ aPART.border ];
-    if ( 0 <= aPART.node1    && aPART.node1 aBRD.nodeIDs.length() &&
-         0 <= aPART.nodeLast && aPART.nodeLast < aBRD.nodeIDs.length() )
+    if ( 0 <= aPART.node1    && aPART.node1    < (TInt)aBRD.nodeIDs.length() &&
+         0 <= aPART.nodeLast && aPART.nodeLast < (TInt)aBRD.nodeIDs.length() )
     {
       text += QString("( %1 %2 %3 ) ")
         .arg( aBRD.nodeIDs[ aPART.node1 ] )
@@ -853,7 +854,7 @@ QString SMESHGUI_SewingDlg::getGroupText(int groupIndex)
 
   if ( haveBorders()   &&
        groupIndex >= 0 &&
-       groupIndex < myBorders->coincidentGroups.length() )
+       groupIndex < (int)myBorders->coincidentGroups.length() )
   {
     const SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ groupIndex ];
 
@@ -934,7 +935,7 @@ void SMESHGUI_SewingDlg::onRemoveGroupClicked()
     delete item;
     if ( myBorderDisplayers[ groupIndex ])
       myBorderDisplayers[ groupIndex ]->Hide();
-    SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ myCurGroupIndex ];
+    SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ groupIndex ];
     aGRP.length( 0 );
   }
   myBusy = false;
@@ -958,7 +959,7 @@ void SMESHGUI_SewingDlg::showGroup( QListWidgetItem* item )
   int    groupIndex = item->data( GROUP_INDEX ).toInt();
   QColor groupColor = item->data( GROUP_COLOR ).value<QColor>();
   if ( groupIndex >= 0       &&
-       groupIndex < myBorders->coincidentGroups.length() )
+       groupIndex < (int)myBorders->coincidentGroups.length() )
   {
     if ( !myBorderDisplayers[ groupIndex ] && SMESH::GetCurrentVtkView())
       myBorderDisplayers[ groupIndex ] = new BorderGroupDisplayer( myBorders, groupIndex, groupColor, myMesh );
@@ -984,7 +985,7 @@ bool SMESHGUI_SewingDlg::setCurrentGroup()
   
   myCurGroupIndex = selItems[0]->data( GROUP_INDEX ).toInt();
 
-  return ( myCurGroupIndex >= 0 && myCurGroupIndex < myBorders->coincidentGroups.length() );
+  return ( myCurGroupIndex >= 0 && myCurGroupIndex < (int)myBorders->coincidentGroups.length() );
 }
 
 //=======================================================================
@@ -1003,7 +1004,7 @@ bool SMESHGUI_SewingDlg::setCurrentPart()
   myCurPartIndex = ListEdit->currentRow();
   const SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ myCurGroupIndex ];
 
-  return ( myCurPartIndex >= 0 && myCurPartIndex < aGRP.length() );
+  return ( myCurPartIndex >= 0 && myCurPartIndex < (int)aGRP.length() );
 }
 
 //=======================================================================
@@ -1192,15 +1193,18 @@ void SMESHGUI_SewingDlg::onRemoveElemClicked()
 
   SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ myCurGroupIndex ];
 
+  myBusy = true;
   QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
   for ( int i = 0; i < selItems.count(); ++i )
   {
     int part = ListEdit->row( selItems[i] );
-    for ( ; part + 1 < aGRP.length(); ++part )
+    for ( ; part + 1 < (int)aGRP.length(); ++part )
       aGRP[ part ] = aGRP[ part + 1 ];
-    aGRP.length( aGRP.length() - 1 );
+    if ( aGRP.length() > 0 )
+      aGRP.length( aGRP.length() - 1 );
     delete selItems[i];
   }
+  myBusy = false;
 
   if ( aGRP.length() == 0 )
     onRemoveGroupClicked();
@@ -1944,6 +1948,7 @@ void SMESHGUI_SewingDlg::BorderGroupDisplayer::getPartEnds( int                p
                                                             std::vector<int> & ids,
                                                             std::list<gp_XYZ>& coords)
 {
+  if ( partIndex >= (int)myGroup.length() ) return;
   const SMESH::FreeBorderPart& aPART = myGroup  [ partIndex ];
   const SMESH::FreeBorder&      aBRD = myBorders[ aPART.border ];
 
index 2ed7c02719bf82987fb8ede32372bde5956f88ff..e40b5b4d1516841d33fbe45b7eeeba8e83bb7715 100755 (executable)
@@ -93,8 +93,8 @@ private:
 SMESHGUI_SingleEditDlg
 ::SMESHGUI_SingleEditDlg(SMESHGUI* theModule)
   : QDialog(SMESH::GetDesktop(theModule)),
-    mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+    mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySMESHGUI(theModule)
 {
   setModal(false);
index d752a128aa14b55783e5f57f20407b43f4966511..e272d010c091bf338f045343605d732a81770a89 100644 (file)
@@ -111,8 +111,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg(0),
-    mySelectedObject(SMESH::SMESH_IDSource::_nil())
+    mySelectedObject(SMESH::SMESH_IDSource::_nil()),
+    myFilterDlg(0)
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@@ -566,6 +566,7 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
 void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
 {
   if (myBusy) return;
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
 
   // clear
   QString aString = "";
@@ -574,7 +575,8 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
   BusyLocker lock( myBusy );
 
   if (myEditCurrentArgument == LineEditElements ||
-      myEditCurrentArgument == LineEditNodes) {
+      myEditCurrentArgument == LineEditNodes)
+  {
     myEditCurrentArgument->setText(aString);
     if (myEditCurrentArgument == LineEditElements) {
       myNbOkElements = 0;
index 7cc3006b8674226d1bf70d25bb1167569cc8e0b2..d5c5d473d3b3dfe6ebfd62dd0d92cd4245a0cd50 100644 (file)
@@ -736,6 +736,7 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText)
 void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
 {
   if (myBusy) return;
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
 
   // clear
   myActor = 0;
@@ -764,44 +765,44 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
 
   int aNbUnits = 0;
 
-  if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+  if (myEditCurrentArgument == (QWidget*)LineEditElements)
+  {
     myElementsId = "";
     myObjects.clear();
     myObjectsNames.clear();
     myMeshes.clear();
 
-    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() )
+    {
       Handle(SALOME_InteractiveObject) IO = it.Value();
-      
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
-      if( aMesh->_is_nil() )
-        return;
+      if ( aMesh->_is_nil() )
+        continue;
 
       myActor = SMESH::FindActorByObject( aMesh );
       if ( !myActor )
         myActor = SMESH::FindActorByEntry( IO->getEntry() );
-      if ( !myActor && !CheckBoxMesh->isChecked() )
-        return;
+      // if ( !myActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter
+      //   return;
 
-      if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-          _PTR(GenericAttribute) anAttr;
-          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-            _PTR(AttributeName) aNameAttr( anAttr );
-            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-            myObjectsNames << aNameAttr->Value().c_str();
-            myMeshes << aMesh;
-          }
+      SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+      if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc ))
+      {
+        std::string name = obj->GetName();
+        if ( !name.empty() )
+        {
+          myObjects << idSrc;
+          myObjectsNames << name.c_str();
+          myMeshes << aMesh;
         }
       }
     }
 
     // MakeGroups is available if there are groups and "Copy"
-      int aNbGroups = 0;
-      for ( int i = 0; i < myMeshes.count(); i++ )
-        aNbGroups += myMeshes[i]->NbGroups();
-      
+    int aNbGroups = 0;
+    for ( int i = 0; i < myMeshes.count(); i++ )
+      aNbGroups += myMeshes[i]->NbGroups();
+
     if ( aNbGroups == 0 ) {
       MakeGroupsCheck->setChecked(false);
       MakeGroupsCheck->setEnabled(false);
@@ -809,69 +810,26 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
     else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) {
       MakeGroupsCheck->setEnabled(true);
     }
-    if (CheckBoxMesh->isChecked()) {
-      SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
+    if (CheckBoxMesh->isChecked()) {
       if ( myObjects.isEmpty() ) 
         return;
-      // get IDs from mesh
-      /*
-        SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
-        if (!aSMDSMesh)
-          return;
-
-        for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
-          const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
-          if (e) {
-            myElementsId += QString(" %1").arg(i);
-            aNbUnits++;
-          }
-        }
-      } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
-        // get submesh
-        SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
-        // get IDs from submesh
-        /*
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aSubMesh->GetElementsId();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      } else { // GROUP
-        // get smesh group
-        SMESH::SMESH_GroupBase_var aGroup =
-          SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
-        if (aGroup->_is_nil())
-          return;
-
-        // get IDs from smesh group
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aGroup->GetListOfID();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      }
-      */
-    } else {
+      SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
+    }
+    else {
       aNbUnits = SMESH::GetNameOfSelectedElements( mySelector, aList.First(), aString);
       myElementsId = aString;
       if (aNbUnits < 1)
         return;
     }
-
     myNbOkElements = true;
-  } else {
+  }
+  else // set coordinates by a picked node
+  {
     Handle(SALOME_InteractiveObject) IO = aList.First();
-    if ((SMESH::GetMeshByIO(IO))->_is_nil())
-      return;
 
-    SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO));
+    SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
     if (!anActor)
-      anActor = SMESH::FindActorByEntry(IO->getEntry());
-    if (!anActor && !CheckBoxMesh->isChecked())
       return;
 
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@@ -1163,15 +1121,24 @@ void SMESHGUI_SymmetryDlg::keyPressEvent( QKeyEvent* e )
 //=================================================================================
 void SMESHGUI_SymmetryDlg::setFilters()
 {
-  if(myMeshes.isEmpty()) {
-    SUIT_MessageBox::critical(this,
-                              tr("SMESH_ERROR"),
-                              tr("NO_MESH_SELECTED"));
-   return;
+  if ( myMeshes.isEmpty() ) {
+    SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED"));
+    return;
   }
-  if ( !myFilterDlg )
+  if ( !myFilterDlg ) {
     myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+    connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted()));
+  }
 
+  QList<int> types;
+  if ( myMeshes[0]->NbEdges()     ) types << SMESH::EDGE;
+  if ( myMeshes[0]->NbFaces()     ) types << SMESH::FACE;
+  if ( myMeshes[0]->NbVolumes()   ) types << SMESH::VOLUME;
+  if ( myMeshes[0]->NbBalls()     ) types << SMESH::BALL;
+  if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+  if ( types.count() > 1 )          types << SMESH::ALL;
+
+  myFilterDlg->Init( types );
   myFilterDlg->SetSelection();
   myFilterDlg->SetMesh( myMeshes[0] );
   myFilterDlg->SetSourceWg( LineEditElements );
@@ -1179,6 +1146,23 @@ void SMESHGUI_SymmetryDlg::setFilters()
   myFilterDlg->show();
 }
 
+//=======================================================================
+// name    : onFilterAccepted()
+// Purpose : SLOT. Called when Filter dlg closed with OK button.
+//           Activate [Apply] if no Actor is available
+//=======================================================================
+void SMESHGUI_SymmetryDlg::onFilterAccepted()
+{
+  if ( myMeshes.length() > 0 && !buttonOk->isEnabled() )
+  {
+    myElementsId = LineEditElements->text();
+    QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+    myNbOkElements = aListElementsId.count();
+    buttonOk->setEnabled( myNbOkElements );
+    buttonApply->setEnabled( myNbOkElements );
+  }
+}
+
 //=================================================================================
 // function : isValid
 // purpose  :
@@ -1211,10 +1195,13 @@ bool SMESHGUI_SymmetryDlg::isValid()
 // function : onDisplaySimulation
 // purpose  : Show/Hide preview
 //=================================================================================
-void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
-  if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
-    if ( myNbOkElements && isValid() && IsMirrorOk() ) {
-      QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);      
+void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview )
+{
+  if (myPreviewCheckBox->isChecked() && toDisplayPreview)
+  {
+    if ( myNbOkElements && isValid() && IsMirrorOk() )
+    {
+      QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
       SMESH::long_array_var anElementsId = new SMESH::long_array;
 
       anElementsId->length(aListElementsId.count());
@@ -1223,7 +1210,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
 
       SMESH::AxisStruct aMirror;
       SMESH::SMESH_MeshEditor::MirrorType aMirrorType;
-      
+
       getMirror(aMirror,aMirrorType);
 
       try {
@@ -1239,7 +1226,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
           }
         else {
           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
-          aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy );        
+          aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy );
           aMeshPreviewStruct << aMeshEditor->GetPreviewData();
         }
         setSimulationPreview(aMeshPreviewStruct);
@@ -1248,7 +1235,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
       }
     } else {
       hidePreview();
-    } 
+    }
   } else {
     hidePreview();
   }
@@ -1258,7 +1245,9 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
 // function : getMirror
 // purpose  : return mirror parameters
 //=================================================================================
-void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror, SMESH::SMESH_MeshEditor::MirrorType& theMirrorType) {
+void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct&                   theMirror,
+                                     SMESH::SMESH_MeshEditor::MirrorType& theMirrorType)
+{
   theMirror.x =  SpinBox_X->GetValue();
   theMirror.y =  SpinBox_Y->GetValue();
   theMirror.z =  SpinBox_Z->GetValue();
index 1727b59f3714735491a7b3ff8c310664ac21eae2..c7845dcf69f252beecf6fe9896dfe946cd2953ca 100644 (file)
@@ -139,6 +139,7 @@ private:
 protected slots:
   virtual void           onDisplaySimulation( bool );
   virtual void           reject();
+  void                   onFilterAccepted();
 
 private slots:
   void                   ConstructorsClicked( int );
index 32c94694a7c8947ebd02e8cfc6fea9e0275300db..be53d01e411b6af819f752acae39abb5693a8b4d 100644 (file)
@@ -745,6 +745,8 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
 void SMESHGUI_TranslationDlg::SelectionIntoArgument()
 {
   if (myBusy) return;
+  if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
+
   BusyLocker lock( myBusy );
   // clear
   myActor = 0;
@@ -770,13 +772,15 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
     return;
 
   int aNbUnits = 0;
-  if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+  if (myEditCurrentArgument == (QWidget*)LineEditElements)
+  {
     myElementsId = "";
     myObjects.clear();
     myObjectsNames.clear();
     myMeshes.clear();
 
-    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() )
+    {
       Handle(SALOME_InteractiveObject) IO = it.Value();
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
       if ( aMesh->_is_nil() )
@@ -786,25 +790,24 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
       if ( !anActor )
         anActor = SMESH::FindActorByEntry( IO->getEntry() );
 
-      if ( !anActor && !CheckBoxMesh->isChecked() )
-        return;
-
-      if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-          _PTR(GenericAttribute) anAttr;
-          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-            _PTR(AttributeName) aNameAttr( anAttr );
-            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-            myObjectsNames << aNameAttr->Value().c_str();
-            myMeshes << aMesh;
-          }
+      // if ( !anActor && !CheckBoxMesh->isChecked() )  -- elems can be selected by Filter
+      //   return;
+
+      SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+      if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc ))
+      {
+        std::string name = obj->GetName();
+        if ( !name.empty() )
+        {
+          myObjects << idSrc;
+          myObjectsNames << name.c_str();
+          myMeshes << aMesh;
         }
       }
-
-      myActor = anActor;
+      if ( anActor )
+        myActor = anActor;
     }
-    
+
     // MakeGroups is available if there are groups and "Copy"
     int aNbGroups = 0;
     for ( int i = 0; i < myMeshes.count(); i++ )
@@ -819,10 +822,11 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
     }
 
     if (CheckBoxMesh->isChecked()) {
-      SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
       if (myMeshes.isEmpty())
         return;
-    } else {
+      SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
+    }
+    else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aList.First(), aString);
       myElementsId = aString;
       if (aNbUnits < 1)
@@ -830,16 +834,15 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
     }
 
     myNbOkElements = true;
-  } else {
+  }
+  else  // set coordinates by a picked node
+  {
     Handle(SALOME_InteractiveObject) IO = aList.First();
-    if ((SMESH::GetMeshByIO(IO))->_is_nil())
-      return;
 
-    SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO));
+    SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
     if (!anActor)
-      anActor = SMESH::FindActorByEntry(IO->getEntry());
-    if (!anActor && !CheckBoxMesh->isChecked())
       return;
+
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
     if (aNbUnits != 1)
       return;
@@ -1097,15 +1100,24 @@ void SMESHGUI_TranslationDlg::keyPressEvent( QKeyEvent* e )
 //=================================================================================
 void SMESHGUI_TranslationDlg::setFilters()
 {
-  if(myMeshes.isEmpty()) {
-    SUIT_MessageBox::critical(this,
-                              tr("SMESH_ERROR"),
-                              tr("NO_MESH_SELECTED"));
-   return;
+  if ( myMeshes.isEmpty() ) {
+    SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED"));
+    return;
   }
-  if ( !myFilterDlg )
+  if ( !myFilterDlg ) {
     myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+    connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted()));
+  }
 
+  QList<int> types;
+  if ( myMeshes[0]->NbEdges()     ) types << SMESH::EDGE;
+  if ( myMeshes[0]->NbFaces()     ) types << SMESH::FACE;
+  if ( myMeshes[0]->NbVolumes()   ) types << SMESH::VOLUME;
+  if ( myMeshes[0]->NbBalls()     ) types << SMESH::BALL;
+  if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+  if ( types.count() > 1 )          types << SMESH::ALL;
+
+  myFilterDlg->Init( types );
   myFilterDlg->SetSelection();
   myFilterDlg->SetMesh( myMeshes[0] );
   myFilterDlg->SetSourceWg( LineEditElements );
@@ -1113,6 +1125,23 @@ void SMESHGUI_TranslationDlg::setFilters()
   myFilterDlg->show();
 }
 
+//=======================================================================
+// name    : onFilterAccepted()
+// Purpose : SLOT. Called when Filter dlg closed with OK button.
+//           Activate [Apply] if no Actor is available
+//=======================================================================
+void SMESHGUI_TranslationDlg::onFilterAccepted()
+{
+  if ( myMeshes.length() > 0 && !buttonOk->isEnabled() )
+  {
+    myElementsId = LineEditElements->text();
+    QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+    myNbOkElements = aListElementsId.count();
+    buttonOk->setEnabled( myNbOkElements );
+    buttonApply->setEnabled( myNbOkElements );
+  }
+}
+
 //=================================================================================
 // function : isValid
 // purpose  :
@@ -1147,9 +1176,10 @@ bool SMESHGUI_TranslationDlg::isValid()
 //=================================================================================
 void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview )
 {
-  if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
-
-    if (isValid() && myNbOkElements) {
+  if (myPreviewCheckBox->isChecked() && toDisplayPreview)
+  {
+    if (isValid() && myNbOkElements)
+    {
       QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
 
       SMESH::long_array_var anElementsId = new SMESH::long_array;
index f625c61f4929ff89472c3b5fd4e20bcbd413c321..cfd801c7a075cb6a05249b3d1909404f48e1b568 100644 (file)
@@ -133,6 +133,7 @@ private:
 protected slots:
   virtual void           onDisplaySimulation( bool );
   virtual void           reject();
+  void                   onFilterAccepted();
    
 private slots:
   void                   ConstructorsClicked( int );
index 30ddc010bbaa2248b260d8988c963399d45a9ad8..c8f22670819b90e199e4016b5fa38993dc5ac72c 100644 (file)
@@ -298,9 +298,10 @@ namespace SMESH
     aPixmap->SetPixMap( pmName );
 
     _PTR(ChildIterator) anIter = aStudy->NewChildIterator(theSObject);
-    for (int i = 1; anIter->More(); anIter->Next(), i++) {
+    for ( ; anIter->More(); anIter->Next() ) {
       _PTR(SObject) aSObj = anIter->Value();
-      /*if (i >= 1)*/ {
+      if ( aSObj->Tag() >= SMESH::Tag_FirstSubMesh )
+      {
         _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
         for ( ; anIter1->More(); anIter1->Next())
         {
@@ -339,7 +340,7 @@ namespace SMESH
             else
               aPixmap->SetPixMap( "ICON_SMESH_TREE_GROUP" );
           }
-          else
+          else // is it necessary?
           {
             if ( !theIsNotModif )
               aPixmap->SetPixMap( pmName );
index 51d763492dcdc4f2af56e675e314eaee4f9dd37b..6f024242ff497c850a79224551b766bff0efc3db 100644 (file)
@@ -195,7 +195,7 @@ SMESHGUI_EXPORT
   class toStrT : public _STRING {
     CORBA::String_var myStr;
   public:
-    toStrT( char* s ): myStr(s), _STRING( s )
+    toStrT( char* s ): _STRING( s ), myStr(s)
     {}
     operator const char*() const
     { return myStr.in(); }
index ca100fce9ad5868147cfe8eb50034e87945821e0..031335ee5128420f32877bbcfb8effb59c6b94d1 100644 (file)
@@ -773,6 +773,7 @@ namespace SMESH
               anActor->SetVisibility(false);
               aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
               break;
+            default:;
           }
         } else {
           switch (theAction) {
@@ -799,6 +800,7 @@ namespace SMESH
               }
               break;
             }
+          default:;
           }
         }
       }
@@ -808,16 +810,20 @@ namespace SMESH
   }
 
 
-  bool UpdateView(EDisplaing theAction, const char* theEntry){
+  bool UpdateView(EDisplaing theAction, const char* theEntry) {
         //MESSAGE("UpdateView");
     SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() );
     SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() );
-    SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView();
-    return UpdateView(aWnd,theAction,theEntry);
+    if ( SUIT_ViewManager* vm = app->activeViewManager() )
+    {
+      SUIT_ViewWindow *aWnd = vm->getActiveView();
+      return UpdateView(aWnd,theAction,theEntry);
+    }
+    return false;
   }
 
   void UpdateView(){
-    if(SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()){
+    if ( SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()) {
       LightApp_SelectionMgr* mgr = SMESHGUI::selectionMgr();
       SALOME_ListIO selected; mgr->selectedObjects( selected );
 
@@ -848,7 +854,7 @@ namespace SMESH
 
   bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
   {
-        MESSAGE("Update");
+    MESSAGE("Update");
     _PTR(Study) aStudy = GetActiveStudyDocument();
     CORBA::Long anId = aStudy->StudyId();
     if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
@@ -861,7 +867,7 @@ namespace SMESH
 
   bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
   {
-        MESSAGE("UpdateNulData");
+    MESSAGE("UpdateNulData");
     _PTR(Study) aStudy = GetActiveStudyDocument();
     CORBA::Long anId = aStudy->StudyId();
     if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
index b87928995d638f8bed1cdc61e8381c557b7cf492..0d7eed4a74cd7c1dd1b4918d4920ea1405134eb9 100644 (file)
@@ -166,7 +166,7 @@ void SMESH_Block::TFace::Set( const int          faceID,
   // pcurves
   vector< int > edgeIdVec;
   GetFaceEdgesIDs( faceID, edgeIdVec );
-  for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+  for ( size_t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
   {
     myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] );
     if ( myC2d[ iE ]) delete myC2d[ iE ];
@@ -2083,7 +2083,7 @@ bool SMESH_Block::LoadFace(const TopoDS_Face& theFace,
   bool isForward[4];
   vector< int > edgeIdVec;
   GetFaceEdgesIDs( theFaceID, edgeIdVec );
-  for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+  for ( size_t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
   {
     if ( edgeIdVec[ iE ] > theShapeIDMap.Extent() )
       return false;
index 5e6420fda11f1dfb98d2f34f4d9612c64475893b..bb4c9b48748f6f0d97551da39d8d7a284db4054f 100644 (file)
 # include <string>
 # include <sstream>
 
-using namespace std;
-
 /*!
  * \brief Class to generate string from any type
  */
-class SMESH_Comment : public string
+class SMESH_Comment : public std::string
 {
-  ostringstream _s ;
+  std::ostringstream _s ;
 
 public :
 
-  SMESH_Comment():string("") {}
+  SMESH_Comment():std::string("") {}
 
-  SMESH_Comment(const SMESH_Comment& c):string() {
+  SMESH_Comment(const SMESH_Comment& c):std::string() {
     _s << c.c_str() ;
-    this->string::operator=( _s.str() );
+    this->std::string::operator=( _s.str() );
   }
 
   SMESH_Comment & operator=(const SMESH_Comment& c) {
     _s << c.c_str() ;
-    this->string::operator=( _s.str() );
+    this->std::string::operator=( _s.str() );
     return *this;
   }
 
   template <class T>
   SMESH_Comment( const T &anything ) {
     _s << anything ;
-    this->string::operator=( _s.str() );
+    this->std::string::operator=( _s.str() );
   }
 
   template <class T>
   SMESH_Comment & operator<<( const T &anything ) {
     _s << anything ;
-    this->string::operator=( _s.str() );
+    this->std::string::operator=( _s.str() );
     return *this ;
   }
 
index 8d138b46cee114b2425be891aa87241073809f16..10c1f533f1d4a238613f739a18aa51a1233d453c 100644 (file)
@@ -271,7 +271,7 @@ void SMESH_File::rewind()
 
 bool SMESH_File::getInts(std::vector<int>& ints)
 {
-  int i = 0;
+  size_t i = 0;
   while ( i < ints.size() )
   {
     while ( !isdigit( *_pos ) && !eof()) ++_pos;
@@ -330,7 +330,7 @@ bool SMESH_File::writeRaw(const void* data, size_t size)
 #else
 
   ssize_t nbWritten = ::write( _file, data, size );
-  return ( nbWritten == size );
+  return ( nbWritten == (ssize_t) size );
 
 #endif
 }
index 6d180f8c26b19c0ebe081c317f07cd3d42e22fe0..87951012c3389ea15cbe6a9d36b54565862f7a6e 100644 (file)
@@ -290,7 +290,7 @@ namespace
   void BNode::AddClose ( const BEdge* e, double u ) const
   {
     if ( ! e->Contains( this ))
-      myCloseEdges.push_back( make_pair( const_cast< BEdge* >( e ), u ));
+      myCloseEdges.push_back( std::make_pair( const_cast< BEdge* >( e ), u ));
   }
   BEdge* BNode::GetCloseEdgeOfBorder( int borderID, double * uPtr ) const
   {
@@ -344,19 +344,6 @@ namespace
 
 } // namespace
 
-// struct needed for NCollection_Map
-struct TLinkHasher
-{
-  static int HashCode(const SMESH_TLink& link, int aLimit)
-  {
-    return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit );
-  }
-  static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2)
-  {
-    return ( l1.node1() == l2.node1() && l1.node2() == l2.node2() );
-  }
-};
-
 //================================================================================
 /*
  * Returns groups of TFreeBorder's coincident within the given tolerance.
@@ -370,7 +357,7 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh&              mesh,
                                                 CoincidentFreeBorders & foundFreeBordes)
 {
   // find free links
-  typedef NCollection_DataMap<SMESH_TLink, const SMDS_MeshElement*, TLinkHasher > TLink2FaceMap;
+  typedef NCollection_DataMap<SMESH_TLink, const SMDS_MeshElement*, SMESH_TLink > TLink2FaceMap;
   TLink2FaceMap linkMap;
   int nbSharedLinks = 0;
   SMDS_FaceIteratorPtr faceIt = mesh.facesIterator();
@@ -582,9 +569,9 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh&              mesh,
 
   // form groups of coincident parts of free borders
 
-  TFreeBorderPart  part;
-  TCoincidentGroup group;
-  vector< BEdge* > ranges; // couples of edges delimiting parts
+  TFreeBorderPart       part;
+  TCoincidentGroup      group;
+  std::vector< BEdge* > ranges; // couples of edges delimiting parts
   BEdge* be = 0; // a current edge
   int skipGroup = bEdges.size(); // a group ID used to avoid repeating treatment of edges
 
index 970d560e5f0a6d83097bf161c38e6f7c585c6b61..c9fcd85013fb991b19f7235285c15c7b1c79b03b 100644 (file)
@@ -448,14 +448,14 @@ namespace
                   addedEdges.insert( bndSegs[i]._edge->twin() ).second )
         {
           v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex0(), v2Node.size() + 1 )).first;
-          int n0 = v2n->second;
+          size_t n0 = v2n->second;
           if ( n0 == v2Node.size() )
             text << "n" << n0 << " = m.AddNode( "
                  << bndSegs[i]._edge->vertex0()->x() / theScale[0] << ", "
                  << bndSegs[i]._edge->vertex0()->y() / theScale[1] << ", 0 )\n";
 
           v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex1(), v2Node.size() + 1 )).first;
-          int n1 = v2n->second;
+          size_t n1 = v2n->second;
           if ( n1 == v2Node.size() )
             text << "n" << n1 << " = m.AddNode( "
                  << bndSegs[i]._edge->vertex1()->x() / theScale[0] << ", "
@@ -1210,7 +1210,7 @@ namespace
             else // bndSegs[ i ]._branchID > 0
             {
               dInd = +1;
-              for ( edgeInd = 0; edgeInd < branchEdges[ brID ].size(); ++edgeInd )
+              for ( edgeInd = 0; edgeInd < (int)branchEdges[ brID ].size(); ++edgeInd )
                 if ( branchEdges[ brID ][ edgeInd ] == bndSegs[ i ]._edge )
                   break;
             }
@@ -1386,7 +1386,7 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge,
     int di = ( points._params[0] == points._params[i] ) ? +1 : -1;
     while ( points._params[i] == points._params[i+1] )
       i += di;
-    if ( i < 0 || i+1 >= points._params.size() )
+    if ( i < 0 || i+1 >= (int)points._params.size() )
       i = 0;
   }
 
@@ -1394,9 +1394,9 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge,
 
   if ( !points._maEdges[ i ].second ) // no branch at the EDGE end, look for a closest branch
   {
-    if ( i < points._maEdges.size() / 2 ) // near 1st point
+    if ( i < (int)points._maEdges.size() / 2 ) // near 1st point
     {
-      while ( i < points._maEdges.size()-1 && !points._maEdges[ i ].second )
+      while ( i < (int)points._maEdges.size()-1 && !points._maEdges[ i ].second )
         ++i;
       edgeParam = edgeReverse;
     }
@@ -1699,7 +1699,7 @@ bool SMESH_MAT2d::Branch::getParameter(const BranchPoint & p, double & u ) const
   if ( p._iEdge > _params.size()-1 )
     return false;
   if ( p._iEdge == _params.size()-1 )
-    return u = 1.;
+    return ( u = 1. );
 
   u = ( _params[ p._iEdge   ] * ( 1 - p._edgeParam ) +
         _params[ p._iEdge+1 ] * p._edgeParam );
@@ -1805,7 +1805,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >&
   {
     // look for a VERTEX of the opposite EDGE
     // iNext - next after all null-length segments
-    while ( maE = ++iNext )
+    while (( maE = ++iNext ))
     {
       iSeg2 = getBndSegment( maE );
       if ( !_boundary->isConcaveSegment( ie1, iSeg2 ))
@@ -1837,7 +1837,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >&
   else if ( isConcaPrev )
   {
     // all null-length segments passed, find their beginning
-    while ( maE = iPrev.edgePrev() )
+    while (( maE = iPrev.edgePrev() ))
     {
       iSeg1 = getBndSegment( maE );
       if ( _boundary->isConcaveSegment( edgeIDs1.back(), iSeg1 ))
@@ -1909,7 +1909,7 @@ void SMESH_MAT2d::Branch::getOppositeGeomEdges( std::vector< std::size_t >& edge
   BranchPoint divisionPnt;
   divisionPnt._branch = this;
 
-  for ( ++maIter, ++twIter; maIter.index() < _maEdges.size(); ++maIter, ++twIter )
+  for ( ++maIter, ++twIter; maIter.index() < (int)_maEdges.size(); ++maIter, ++twIter )
   {
     size_t ie1 = getGeomEdge( maIter.edge() );
     size_t ie2 = getGeomEdge( twIter.edge() );
index a5171703b8f692055813d3ef2a70c29d2d364510..a897decd65c3ec05780c8b345736a69277861033 100644 (file)
@@ -270,7 +270,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
 
   ElementBndBoxTree::~ElementBndBoxTree()
   {
-    for ( int i = 0; i < _elements.size(); ++i )
+    for ( size_t i = 0; i < _elements.size(); ++i )
       if ( --_elements[i]->_refCount <= 0 )
         delete _elements[i];
   }
@@ -284,7 +284,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
   Bnd_B3d* ElementBndBoxTree::buildRootBox()
   {
     Bnd_B3d* box = new Bnd_B3d;
-    for ( int i = 0; i < _elements.size(); ++i )
+    for ( size_t i = 0; i < _elements.size(); ++i )
       box->Add( *_elements[i] );
     return box;
   }
@@ -297,7 +297,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
 
   void ElementBndBoxTree::buildChildrenData()
   {
-    for ( int i = 0; i < _elements.size(); ++i )
+    for ( size_t i = 0; i < _elements.size(); ++i )
     {
       for (int j = 0; j < 8; j++)
       {
@@ -315,7 +315,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
     for (int j = 0; j < 8; j++)
     {
       ElementBndBoxTree* child = static_cast<ElementBndBoxTree*>( myChildren[j]);
-      if ( child->_elements.size() <= MaxNbElemsInLeaf )
+      if ((int) child->_elements.size() <= MaxNbElemsInLeaf )
         child->myIsLeaf = true;
 
       if ( child->_elements.capacity() - child->_elements.size() > 1000 )
@@ -337,7 +337,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
 
     if ( isLeaf() )
     {
-      for ( int i = 0; i < _elements.size(); ++i )
+      for ( size_t i = 0; i < _elements.size(); ++i )
         if ( !_elements[i]->IsOut( point.XYZ() ))
           foundElems.insert( _elements[i]->_element );
     }
@@ -362,7 +362,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
 
     if ( isLeaf() )
     {
-      for ( int i = 0; i < _elements.size(); ++i )
+      for ( size_t i = 0; i < _elements.size(); ++i )
         if ( !_elements[i]->IsOut( line ))
           foundElems.insert( _elements[i]->_element );
     }
@@ -388,7 +388,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
 
     if ( isLeaf() )
     {
-      for ( int i = 0; i < _elements.size(); ++i )
+      for ( size_t i = 0; i < _elements.size(); ++i )
         if ( !_elements[i]->IsOut( center, radius ))
           foundElems.insert( _elements[i]->_element );
     }
@@ -458,6 +458,10 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
   void GetElementsNearLine( const gp_Ax1&                      line,
                             SMDSAbs_ElementType                type,
                             vector< const SMDS_MeshElement* >& foundElems);
+  void GetElementsInSphere( const gp_XYZ&                      center,
+                            const double                       radius,
+                            SMDSAbs_ElementType                type,
+                            vector< const SMDS_MeshElement* >& foundElems);
   double getTolerance();
   bool getIntersParamOnLine(const gp_Lin& line, const SMDS_MeshElement* face,
                             const double tolerance, double & param);
@@ -466,6 +470,7 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
   {
     return _outerFaces.empty() || _outerFaces.count(face);
   }
+
   struct TInters //!< data of intersection of the line and the mesh face (used in GetPointState())
   {
     const SMDS_MeshElement* _face;
@@ -646,6 +651,7 @@ void SMESH_ElementSearcherImpl::findOuterBoundary(const SMDS_MeshElement* outerF
         set< const SMDS_MeshElement*, TIDCompare >::const_iterator face = faces.begin();
         for ( ; face != faces.end(); ++face )
         {
+          if ( *face == outerFace ) continue;
           if ( !SMESH_MeshAlgos::FaceNormal( *face, fNorm, /*normalized=*/false ))
             continue;
           gp_Vec dirInF = gp_Vec( fNorm ) ^ n1n2;
@@ -660,8 +666,8 @@ void SMESH_ElementSearcherImpl::findOuterBoundary(const SMDS_MeshElement* outerF
     // store the found outer face and add its links to continue seaching from
     if ( outerFace2 )
     {
-      _outerFaces.insert( outerFace );
-      int nbNodes = outerFace2->NbNodes()/( outerFace2->IsQuadratic() ? 2 : 1 );
+      _outerFaces.insert( outerFace2 );
+      int nbNodes = outerFace2->NbCornerNodes();
       for ( int i = 0; i < nbNodes; ++i )
       {
         SMESH_TLink link2( outerFace2->GetNode(i), outerFace2->GetNode((i+1)%nbNodes));
@@ -1078,6 +1084,27 @@ void SMESH_ElementSearcherImpl::GetElementsNearLine( const gp_Ax1&
   foundElems.assign( suspectFaces.begin(), suspectFaces.end());
 }
 
+//=======================================================================
+/*
+ * Return elements whose bounding box intersects a sphere
+ */
+//=======================================================================
+
+void SMESH_ElementSearcherImpl::GetElementsInSphere( const gp_XYZ&                      center,
+                                                     const double                       radius,
+                                                     SMDSAbs_ElementType                type,
+                                                     vector< const SMDS_MeshElement* >& foundElems)
+{
+  if ( !_ebbTree || _elementType != type )
+  {
+    if ( _ebbTree ) delete _ebbTree;
+    _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type, _meshPartIt );
+  }
+  TIDSortedElemSet suspectFaces; // elements possibly intersecting the line
+  _ebbTree->getElementsInSphere( center, radius, suspectFaces );
+  foundElems.assign( suspectFaces.begin(), suspectFaces.end() );
+}
+
 //=======================================================================
 /*!
  * \brief Return true if the point is IN or ON of the element
@@ -1325,6 +1352,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshElement* elem,
     return GetDistance( dynamic_cast<const SMDS_MeshEdge*>( elem ), point);
   case SMDSAbs_Node:
     return point.Distance( SMESH_TNodeXYZ( elem ));
+  default:;
   }
   return -1;
 }
@@ -1421,6 +1449,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
     // cout << distVec.Magnitude()  << " VERTEX " << face->GetNode(pos._index)->GetID() << endl;
     return distVec.Magnitude();
   }
+  default:;
   }
   return badDistance;
 }
@@ -1431,9 +1460,35 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
  */
 //=======================================================================
 
-double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* edge, const gp_Pnt& point )
+double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* seg, const gp_Pnt& point )
 {
-  throw SALOME_Exception(LOCALIZED("not implemented so far"));
+  double dist = Precision::Infinite();
+  if ( !seg ) return dist;
+
+  int i = 0, nbNodes = seg->NbNodes();
+
+  vector< SMESH_TNodeXYZ > xyz( nbNodes );
+  SMDS_ElemIteratorPtr nodeIt = seg->interlacedNodesElemIterator();
+  while ( nodeIt->more() )
+    xyz[ i++ ].Set( nodeIt->next() );
+
+  for ( i = 1; i < nbNodes; ++i )
+  {
+    gp_Vec edge( xyz[i-1], xyz[i] );
+    gp_Vec n1p ( xyz[i-1], point  );
+    double u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge
+    if ( u <= 0. ) {
+      dist = Min( dist, n1p.SquareMagnitude() );
+    }
+    else if ( u >= 1. ) {
+      dist = Min( dist, point.SquareDistance( xyz[i] ));
+    }
+    else {
+      gp_XYZ proj = ( 1. - u ) * xyz[i-1] + u * xyz[i]; // projection of the point on the edge
+      dist = Min( dist, point.SquareDistance( proj ));
+    }
+  }
+  return Sqrt( dist );
 }
 
 //=======================================================================
@@ -1537,7 +1592,7 @@ SMESH_MeshAlgos::FindFaceInSet(const SMDS_MeshNode*    n1,
                                int*                    n2ind)
 
 {
-  int i1, i2;
+  int i1 = 0, i2 = 0;
   const SMDS_MeshElement* face = 0;
 
   SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face);
index 9b860a6ab1150ef5169e25d1b81a6d89d27ba68b..f8ea69a6b0d60b53206cf8899ddfda1cdfd29d62 100644 (file)
@@ -88,6 +88,13 @@ struct SMESHUtils_EXPORT SMESH_ElementSearcher
   virtual void GetElementsNearLine( const gp_Ax1&                           line,
                                     SMDSAbs_ElementType                     type,
                                     std::vector< const SMDS_MeshElement* >& foundElems) = 0;
+  /*!
+   * \brief Return elements whose bounding box intersects a sphere
+   */
+  virtual void GetElementsInSphere( const gp_XYZ&                           center,
+                                    const double                            radius,
+                                    SMDSAbs_ElementType                     type,
+                                    std::vector< const SMDS_MeshElement* >& foundElems) = 0;
   /*!
    * \brief Find out if the given point is out of closed 2D mesh.
    */
index e55128eb86c8b9c1165e3df8936c12eaabc86010..3c50fa8e703f7cb3801ea18d6fde7359951cb567 100644 (file)
@@ -102,7 +102,7 @@ Bnd_B3d* SMESH_OctreeNode::buildRootBox()
     gp_XYZ p1( n1->X(), n1->Y(), n1->Z() );
     box->Add(p1);
   }
-  if ( myNodes.size() <= getMaxNbNodes() )
+  if ((int) myNodes.size() <= getMaxNbNodes() )
     myIsLeaf = true;
 
   return box;
@@ -151,7 +151,7 @@ void SMESH_OctreeNode::buildChildrenData()
   for (int i = 0; i < 8; i++)
   {
     SMESH_OctreeNode* myChild = dynamic_cast<SMESH_OctreeNode*> (myChildren[i]);
-    if ( myChild->myNodes.size() <= getMaxNbNodes() )
+    if ((int) myChild->myNodes.size() <= getMaxNbNodes() )
       myChild->myIsLeaf = true;
   }
 }
index eb7b2b864886bdf06190f7816b44535eb287da82..983aa064b924942baf611d12b3d1ccb642822683 100644 (file)
@@ -138,8 +138,8 @@ SMESH_Tree<BND_BOX,NB_CHILDREN>::SMESH_Tree (SMESH_TreeLimit* limit):
   myFather(0),
   myIsLeaf( false ),
   myLimit( limit ),
-  myLevel(0),
-  myBox(0)
+  myBox(0),
+  myLevel(0)
 {
   //if ( !myLimit ) myLimit = new SMESH_TreeLimit();
 }
index afef61b906c5ef24c1eb0a4c8e9db1aad8980281..bd5f41d12f88764bef9c5dd1dea39fdbf3ba4882 100644 (file)
@@ -80,8 +80,11 @@ namespace SMESHUtils
   struct Deleter
   {
     TOBJ* _obj;
-    Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {}
+    explicit Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {}
     ~Deleter() { delete _obj; _obj = 0; }
+    TOBJ& operator*()  const { return *_obj; }
+    TOBJ* operator->() const { return _obj; }
+    operator bool()    const { return _obj; }
   private:
     Deleter( const Deleter& );
   };
@@ -113,6 +116,16 @@ struct SMESH_TLink: public NLink
   { if ( first->GetID() < second->GetID() ) std::swap( first, second ); }
   const SMDS_MeshNode* node1() const { return first; }
   const SMDS_MeshNode* node2() const { return second; }
+
+  // methods for usage of SMESH_TLink as a hasher in NCollection maps
+  static int HashCode(const SMESH_TLink& link, int aLimit)
+  {
+    return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit );
+  }
+  static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2)
+  {
+    return ( l1.node1() == l2.node1() && l1.node2() == l2.node2() );
+  }
 };
 
 //=======================================================================
index 3ea0f6acdac068268bb55b99972634357c8fae8b..2669db47bc92347b6f1c140764e55f18ad3176b7 100644 (file)
@@ -919,7 +919,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
           Threshold = SMESH + types[ iGeom ];
 #ifdef _DEBUG_
         // is types complete? (compilation failure mains that enum GeometryType changed)
-        int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ];
+        int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1;
 #endif
       }
       if (Type == "SMESH.FT_EntityType")
@@ -939,7 +939,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
           Threshold = SMESH + types[ iGeom ];
 #ifdef _DEBUG_
         // is types complete? (compilation failure mains that enum EntityType changed)
-        int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ];
+        int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1;
 #endif
       }
     }
@@ -1930,7 +1930,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
     TCollection_AsciiString grIDs = theCommand->GetResultValue();
     list< _pyID >          idList = theCommand->GetStudyEntries( grIDs );
     list< _pyID >::iterator  grID = idList.begin();
-    const int nbGroupsBefore = myGroups.size();
+    const size_t nbGroupsBefore = myGroups.size();
     Handle(_pyObject) obj;
     for ( ; grID != idList.end(); ++grID )
     {
@@ -3133,7 +3133,7 @@ void _pyHypothesis::setCreationArg( const int argNb, const _AString& arg )
 {
   if ( myCurCrMethod )
   {
-    while ( myCurCrMethod->myArgs.size() < argNb )
+    while ( (int) myCurCrMethod->myArgs.size() < argNb )
       myCurCrMethod->myArgs.push_back( "None" );
     if ( arg.IsEmpty() )
       myCurCrMethod->myArgs[ argNb-1 ] = "None";
@@ -3200,7 +3200,7 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand)
     for ( ; type2meth != myAlgoType2CreationMethod.end(); ++type2meth )
     {
       CreationMethod& crMethod = type2meth->second;
-        while ( crMethod.myArgs.size() < i+1 )
+      while ( (int) crMethod.myArgs.size() < i+1 )
           crMethod.myArgs.push_back( "[]" );
         crMethod.myArgs[ i ] = theCommand->GetArg( 1 ); // arg value
     }
index a67e3cbca3b539c172013050d0610ea9589b1f09..ca1f78337da2172d7152d79438c044b3940ba506 100644 (file)
@@ -115,7 +115,7 @@ class _pyCommand: public Standard_Transient
 public:
   _pyCommand() {};
   _pyCommand( const _AString& theString, int theNb=-1 )
-    : myString( theString ), myOrderNb( theNb ) {};
+    : myOrderNb( theNb ), myString( theString ) {};
   _AString & GetString() { return myString; }
   int  GetOrderNb() const { return myOrderNb; }
   void SetOrderNb( int theNb ) { myOrderNb = theNb; }
index a676b7a167ff3fc0fccd19fe5d5e4dc66f3f1582..8b589ce00f224a3968cc5c765cce5eba6a7322c7 100644 (file)
@@ -98,7 +98,7 @@ namespace SMESH
       myStream << "[ ";
       for ( size_t i = 1; i <= theVarValue.myVals.size(); ++i )
       {
-        if ( myVarsCounter < varIDs.size() && varIDs[ myVarsCounter ] >= 0 )
+        if ( myVarsCounter < (int)varIDs.size() && varIDs[ myVarsCounter ] >= 0 )
           myStream << TVar::Quote() << varIDs[ myVarsCounter ] << TVar::Quote();
         else
           myStream << theVarValue.myVals[i-1];
@@ -110,7 +110,7 @@ namespace SMESH
     }
     else
     {
-      if ( myVarsCounter < varIDs.size() && varIDs[ myVarsCounter ] >= 0 )
+      if ( myVarsCounter < (int)varIDs.size() && varIDs[ myVarsCounter ] >= 0 )
         myStream << TVar::Quote() << varIDs[ myVarsCounter ] << TVar::Quote();
       else
         myStream << theVarValue.myVals[0];
@@ -247,7 +247,7 @@ namespace SMESH
     else
     {
       theStream << "[ ";
-      for (int i = 1; i <= theArray.length(); i++) {
+      for (CORBA::ULong i = 1; i <= theArray.length(); i++) {
         theStream << theArray[i-1];
         if ( i < theArray.length() )
           theStream << ", ";
@@ -281,7 +281,7 @@ namespace SMESH
   TPythonDump::operator<<(const SMESH::string_array& theArray)
   {
     myStream << "[ ";
-    for (int i = 1; i <= theArray.length(); i++) {
+    for ( CORBA::ULong i = 1; i <= theArray.length(); i++ ) {
       myStream << "'" << theArray[i-1] << "'";
       if ( i < theArray.length() )
         myStream << ", ";
@@ -564,7 +564,7 @@ namespace SMESH
       for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP )
       {
         const SMESH::FreeBorderPart& aPART = aGRP[ iP ];
-        if ( 0 <= aPART.border && aPART.border < theCFB.borders.length() )
+        if ( 0 <= aPART.border && aPART.border < (CORBA::Long)theCFB.borders.length() )
         {
           if ( iP ) myStream << ", ";
           const SMESH::FreeBorder& aBRD = theCFB.borders[ aPART.border ];
@@ -1179,9 +1179,11 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   if ( importGeom && isMultiFile )
   {
     initPart += ("\n## import GEOM dump file ## \n"
-                 "import string, os, sys, re\n"
-                 "sys.path.insert( 0, os.path.dirname(__file__) )\n"
-                 "exec(\"from \"+re.sub(\"SMESH$\",\"GEOM\",__name__)+\" import *\")\n");
+                 "import string, os, sys, re, inspect\n"
+                 "thisFile   = inspect.getfile( inspect.currentframe() )\n"
+                 "thisModule = os.path.splitext( os.path.basename( thisFile ))[0]\n"
+                 "sys.path.insert( 0, os.path.dirname( thisFile ))\n"
+                 "exec(\"from \"+re.sub(\"SMESH$\",\"GEOM\",thisModule)+\" import *\")\n\n");
   }
   // import python files corresponding to plugins if they are used in anUpdatedScript
   {
@@ -1207,7 +1209,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       initPart += importStr + "\n";
   }
 
-  if( isMultiFile )
+  if ( isMultiFile )
     initPart += "def RebuildData(theStudy):";
   initPart += "\n";
 
@@ -1271,8 +1273,18 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
 
   anUpdatedScript += removeObjPart + '\n' + setNamePart + '\n' + visualPropertiesPart;
 
-  if( isMultiFile )
-    anUpdatedScript += "\n\tpass";
+  if ( isMultiFile )
+  {
+    anUpdatedScript +=
+      "\n\tpass"
+      "\n"
+      "\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\texec('from '+re.sub('SMESH$','GEOM',thisModule)+' import * ')"
+      "\n\tSMESH_RebuildData( salome.myStudy )";
+  }
   anUpdatedScript += "\n";
 
   // no need now as we use 'tab' and 'nt' variables depending on isMultiFile
@@ -1285,7 +1297,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
 
   TCollection_AsciiString aLongString, aFunctionType;
   int where = 1;
-  set< string > functionNameSet;
+  std::set< std::string > functionNameSet;
   while ( SMESH::TPythonDump::CutoutLongString( anUpdatedScript, where, aLongString, aFunctionType ))
   {
     // make a python string literal
index 7ceeb904fac40eabe1104e54b046fe5bbadb9a00..42db79ef48fe71f1a01f00f9018a2d8dc9210228 100644 (file)
@@ -170,21 +170,21 @@ static TopoDS_Shape getShapeByID (const char* theID)
   return TopoDS_Shape();
 }
 
-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();
-      }
-    }
-  }
-  return "";
-}
+// 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();
+//       }
+//     }
+//   }
+//   return "";
+// }
 
 /*
                                 FUNCTORS
@@ -1628,7 +1628,7 @@ void ConnectedElements_i::SetThreshold ( const char*
   {
   case SMESH::ConnectedElements::POINT: // read 3 node coordinates ///////////////////
     {
-      vector< double > xyz;
+      std::vector< double > xyz;
       char* endptr;
       do
       {
@@ -1830,9 +1830,9 @@ FunctorType EqualTo_i::GetFunctorType()
   Class       : LogicalNOT_i
   Description : Logical NOT predicate
 */
-LogicalNOT_i::LogicalNOT_i()
-: myPredicate( NULL ),
-  myLogicalNOTPtr( new Controls::LogicalNOT() )
+LogicalNOT_i::LogicalNOT_i():
+  myLogicalNOTPtr( new Controls::LogicalNOT() ),
+  myPredicate( NULL )
 {
   myFunctorPtr = myPredicatePtr = myLogicalNOTPtr;
 }
@@ -4068,7 +4068,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 ) ? 1 : -1 ];
+  int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ]; _assert[0]=1;
 #endif
 
   return functName;
index e61aea50b597244139ffddd752a6fafaf66c47d2..532c9a450eae7f7bbd03badbf02eb52047eefbb8 100644 (file)
@@ -953,6 +953,34 @@ void SMESH_Gen_i::SetOption(const char* name, const char* value)
       msgToGUI = "preferences/SMESH/forget_mesh_on_hyp_modif/";
       msgToGUI += myToForgetMeshDataOnHypModif ? "true" : "false";
     }
+    else if ( strcmp(name, "default_grp_color") == 0 )
+    {
+      vector<int> color;
+      string str = value;
+      // color must be presented as a string of next form:
+      if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example)
+        str = str.substr(1);
+        for ( size_t i = 0; i < str.length()/2; i++ )
+          if ( str.at(i*2) >= '0' && str.at(i*2) <= 'f' && str.at(i*2+1) >= '0' && str.at(i*2+1) <= 'f' )
+            color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) );
+      }
+      else { // rgb color ("255,170,0", for example)
+        char* tempValue = strdup( value );
+        char* colorValue = strtok( tempValue, "," );
+        while ( colorValue != NULL ) {
+          int c_value = atoi( colorValue );
+          if ( c_value >= 0 && c_value <= 255 )
+            color.push_back( c_value );
+          colorValue = strtok( NULL, "," );
+        }
+      }
+      if ( color.size() == 3 ) { // color must have three valid component
+        SMESHDS_GroupBase::SetDefaultColor( Quantity_Color( color[0]/255., color[1]/255., color[2]/255., Quantity_TOC_RGB ) );
+        myDefaultGroupColor = value;
+        msgToGUI = "preferences/SMESH/default_grp_color/";
+        msgToGUI += value;
+      }
+    }
 
     // update preferences in case if SetOption() is invoked from python console
     if ( !msgToGUI.empty() )
@@ -983,6 +1011,10 @@ char* SMESH_Gen_i::GetOption(const char* name)
     {
       return CORBA::string_dup( myToForgetMeshDataOnHypModif ? "true" : "false" );
     }
+    if ( strcmp(name, "default_grp_color") == 0 )
+    {
+      return CORBA::string_dup( myDefaultGroupColor.c_str() );
+    }
   }
   return CORBA::string_dup( "" );
 }
@@ -1204,7 +1236,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
   aPythonDump << "], status) = " << this << "." << theCommandNameForPython << "(r'" << theFileNameForPython << "')";
   }
   // Dump creation of groups
-  for ( int i = 0; i < aResult->length(); ++i )
+  for ( CORBA::ULong  i = 0; i < aResult->length(); ++i )
     SMESH::ListOfGroups_var groups = aResult[ i ]->GetGroups();
 
   return aResult._retn();
@@ -1382,7 +1414,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName,
     aPythonDump << "], status) = " << this << ".CreateMeshesFromCGNS(r'" << theFileName << "')";
   }
   // Dump creation of groups
-  for ( int i = 0; i < aResult->length(); ++i )
+  for ( CORBA::ULong i = 0; i < aResult->length(); ++i )
     SMESH::ListOfGroups_var groups = aResult[ i ]->GetGroups();
 #else
   THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR);
@@ -1777,9 +1809,10 @@ SMESH::algo_error_array* SMESH_Gen_i::GetAlgoState( SMESH::SMESH_Mesh_ptr theMes
  */
 //=============================================================================
 
-SMESH::long_array* SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
-                                            const SMESH::object_array& theListOfSubShapeObject )
-     throw ( SALOME::SALOME_Exception )
+SMESH::long_array*
+SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr      theMainShapeObject,
+                             const SMESH::object_array& theListOfSubShapeObject )
+  throw ( SALOME::SALOME_Exception )
 {
   Unexpect aCatch(SALOME_SalomeException);
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetSubShapesId" );
@@ -1788,58 +1821,57 @@ SMESH::long_array* SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainSha
   set<int> setId;
 
   if ( CORBA::is_nil( theMainShapeObject ) )
-    THROW_SALOME_CORBA_EXCEPTION( "bad shape object reference",
-                                  SALOME::BAD_PARAM );
+    THROW_SALOME_CORBA_EXCEPTION( "bad shape object reference", SALOME::BAD_PARAM );
 
   try
-    {
-      TopoDS_Shape myMainShape = GeomObjectToShape(theMainShapeObject);
-      TopTools_IndexedMapOfShape myIndexToShape;
-      TopExp::MapShapes(myMainShape,myIndexToShape);
+  {
+    TopoDS_Shape myMainShape = GeomObjectToShape(theMainShapeObject);
+    TopTools_IndexedMapOfShape myIndexToShape;
+    TopExp::MapShapes(myMainShape,myIndexToShape);
 
-      for ( int i = 0; i < theListOfSubShapeObject.length(); i++ )
-        {
-          GEOM::GEOM_Object_var aShapeObject
-            = GEOM::GEOM_Object::_narrow(theListOfSubShapeObject[i]);
-          if ( CORBA::is_nil( aShapeObject ) )
-            THROW_SALOME_CORBA_EXCEPTION ("bad shape object reference", \
-                                        SALOME::BAD_PARAM );
-
-          TopoDS_Shape locShape  = GeomObjectToShape(aShapeObject);
-          for (TopExp_Explorer exp(locShape,TopAbs_FACE); exp.More(); exp.Next())
-            {
-              const TopoDS_Face& F = TopoDS::Face(exp.Current());
-              setId.insert(myIndexToShape.FindIndex(F));
-              if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(F));
-            }
-          for (TopExp_Explorer exp(locShape,TopAbs_EDGE); exp.More(); exp.Next())
-            {
-              const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
-              setId.insert(myIndexToShape.FindIndex(E));
-              if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(E));
-            }
-          for (TopExp_Explorer exp(locShape,TopAbs_VERTEX); exp.More(); exp.Next())
-            {
-              const TopoDS_Vertex& V = TopoDS::Vertex(exp.Current());
-              setId.insert(myIndexToShape.FindIndex(V));
-              if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(V));
-            }
-        }
-      shapesId->length(setId.size());
-      set<int>::iterator iind;
-      int i=0;
-      for (iind = setId.begin(); iind != setId.end(); iind++)
-        {
-          if(MYDEBUG) SCRUTE((*iind));
-          shapesId[i] = (*iind);
-          if(MYDEBUG) SCRUTE(shapesId[i]);
-          i++;
-        }
+    for ( CORBA::ULong i = 0; i < theListOfSubShapeObject.length(); i++ )
+    {
+      GEOM::GEOM_Object_var aShapeObject
+        = GEOM::GEOM_Object::_narrow(theListOfSubShapeObject[i]);
+      if ( CORBA::is_nil( aShapeObject ) )
+        THROW_SALOME_CORBA_EXCEPTION ("bad shape object reference",     \
+                                      SALOME::BAD_PARAM );
+
+      TopoDS_Shape locShape  = GeomObjectToShape(aShapeObject);
+      for (TopExp_Explorer exp(locShape,TopAbs_FACE); exp.More(); exp.Next())
+      {
+        const TopoDS_Face& F = TopoDS::Face(exp.Current());
+        setId.insert(myIndexToShape.FindIndex(F));
+        if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(F));
+      }
+      for (TopExp_Explorer exp(locShape,TopAbs_EDGE); exp.More(); exp.Next())
+      {
+        const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
+        setId.insert(myIndexToShape.FindIndex(E));
+        if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(E));
+      }
+      for (TopExp_Explorer exp(locShape,TopAbs_VERTEX); exp.More(); exp.Next())
+      {
+        const TopoDS_Vertex& V = TopoDS::Vertex(exp.Current());
+        setId.insert(myIndexToShape.FindIndex(V));
+        if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(V));
+      }
     }
-  catch (SALOME_Exception& S_ex)
+    shapesId->length(setId.size());
+    set<int>::iterator iind;
+    int i=0;
+    for (iind = setId.begin(); iind != setId.end(); iind++)
     {
-      THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+      if(MYDEBUG) SCRUTE((*iind));
+      shapesId[i] = (*iind);
+      if(MYDEBUG) SCRUTE(shapesId[i]);
+      i++;
     }
+  }
+  catch (SALOME_Exception& S_ex)
+  {
+    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+  }
 
   return shapesId._retn();
 }
@@ -2172,13 +2204,13 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
       MapShapeNbElemsItr anIt = aResMap.begin();
       for(; anIt!=aResMap.end(); anIt++) {
         const vector<int>& aVec = (*anIt).second;
-        for(i = SMESH::Entity_Node; i < aVec.size(); i++) {
+        for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) {
           int nbElem = aVec[i];
           if ( nbElem < 0 ) // algo failed, check that it has reported a message
           {
-            SMESH_subMesh* sm = anIt->first;
+            SMESH_subMesh*            sm = anIt->first;
             SMESH_ComputeErrorPtr& error = sm->GetComputeError();
-            const SMESH_Algo* algo = sm->GetAlgo();
+            const SMESH_Algo*       algo = sm->GetAlgo();
             if ( (algo && !error.get()) || error->IsOK() )
               error.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED,"Failed to evaluate",algo));
           }
@@ -2434,7 +2466,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
   std::vector<const SMDS_MeshNode*> aNodesArray;
 
   // loop on sub-meshes
-  for ( int i = 0; i < theMeshesArray.length(); i++)
+  for ( CORBA::ULong i = 0; i < theMeshesArray.length(); i++)
   {
     if ( CORBA::is_nil( theMeshesArray[i] )) continue;
     SMESH::SMESH_Mesh_var anInitMesh = theMeshesArray[i]->GetMesh();
@@ -2443,8 +2475,8 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
     if ( !anInitImpl ) continue;
     anInitImpl->Load();
 
-    ::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl();
-    SMESHDS_Mesh* anInitMeshDS = aInitLocMesh.GetMeshDS();
+    //::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl();
+    //SMESHDS_Mesh* anInitMeshDS = aInitLocMesh.GetMeshDS();
 
     // remember nb of elements before filling in
     SMESH::long_array_var prevState =  aNewMesh->GetNbElementsByType();
@@ -2517,7 +2549,7 @@ 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 ) ? 1 : -1 ];
+          int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 1 : -1 ]; _assert[0]=0;
         }
         string groupName = "Gr";
         SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, theMeshesArray[i] );
@@ -2558,7 +2590,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
     if ( SMESH_Mesh_i* anSrcImpl = SMESH::DownCast<SMESH_Mesh_i*>( theMeshesArray[i] ))
     {
       // copy orphan nodes
-      if ( anSrcImpl->NbNodes() > nodesMap.size() )
+      if ( anSrcImpl->NbNodes() > (int)nodesMap.size() )
       {
         SMDS_ElemIteratorPtr itNodes = anInitImpl->GetElements( theMeshesArray[i], SMESH::NODE );
         while ( itNodes->more() )
@@ -2580,11 +2612,12 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
 
       // loop on groups of a source mesh
       aListOfGroups = anSrcImpl->GetGroups();
-      for (int iG = 0; iG < aListOfGroups->length(); iG++)
+      for ( CORBA::ULong iG = 0; iG < aListOfGroups->length(); iG++ )
       {
         aGroup = aListOfGroups[iG];
         aGroupType = aGroup->GetType();
         aGroupName = aGroup->GetName();
+        string aName = aGroupName.in();
 
         // convert a list of IDs
         anNewIDs->length( aGroup->Size() );
@@ -2602,15 +2635,15 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
 
         // check a current group name and type don't have identical ones in final mesh
         aListOfNewGroups.clear();
-        TGroupsMap::iterator anIter = aGroupsMap.find( make_pair( aGroupName, aGroupType ));
+        TGroupsMap::iterator anIter = aGroupsMap.find( make_pair( aName, aGroupType ));
         if ( anIter == aGroupsMap.end() ) {
           // add a new group in the mesh
-          aNewGroup = aNewImpl->CreateGroup( aGroupType, aGroupName );
+          aNewGroup = aNewImpl->CreateGroup( aGroupType, aGroupName.in() );
           // add elements into new group
           aNewGroup->Add( anNewIDs );
 
           aListOfNewGroups.push_back(aNewGroup);
-          aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups ));
+          aGroupsMap.insert(make_pair( make_pair(aName, aGroupType), aListOfNewGroups ));
         }
 
         else if ( theUniteIdenticalGroups ) {
@@ -2621,18 +2654,18 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
 
         else {
           // rename identical groups
-          aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
+          aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName.in());
           aNewGroup->Add( anNewIDs );
 
           TListOfNewGroups& aNewGroups = anIter->second;
           string aNewGroupName;
           if (aNewGroups.size() == 1) {
-            aNewGroupName = string(aGroupName) + "_1";
+            aNewGroupName = aName + "_1";
             aNewGroups.front()->SetName(aNewGroupName.c_str());
           }
           char aGroupNum[128];
-          sprintf(aGroupNum, "%u", aNewGroups.size()+1);
-          aNewGroupName = string(aGroupName) + "_" + string(aGroupNum);
+          sprintf(aGroupNum, "%u", (unsigned int)aNewGroups.size()+1);
+          aNewGroupName = aName + "_" + string(aGroupNum);
           aNewGroup->SetName(aNewGroupName.c_str());
           aNewGroups.push_back(aNewGroup);
         }
@@ -2655,7 +2688,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
   aPythonDump << aNewMesh << " = " << this << "."
               << ( theCommonGroups ? "ConcatenateWithGroups" : "Concatenate" )
               << "([";
-  for ( int i = 0; i < theMeshesArray.length(); i++) {
+  for ( CORBA::ULong i = 0; i < theMeshesArray.length(); i++) {
     if (i > 0) aPythonDump << ", ";
     aPythonDump << theMeshesArray[i];
   }
@@ -2746,13 +2779,13 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
     SMESH::long_array_var ids = meshPart->GetIDs();
     if ( srcElemTypes->length() == 1 && srcElemTypes[0] == SMESH::NODE ) // group of nodes
     {
-      for (int i=0; i < ids->length(); i++)
+      for ( CORBA::ULong i=0; i < ids->length(); i++ )
         if ( const SMDS_MeshElement * elem = srcMeshDS->FindNode( ids[i] ))
           srcElems.insert( elem );
     }
     else
     {
-      for (int i=0; i < ids->length(); i++)
+      for ( CORBA::ULong i = 0; i < ids->length(); i++ )
         if ( const SMDS_MeshElement * elem = srcMeshDS->FindElement( ids[i] ))
           srcElems.insert( elem );
     }
@@ -3043,7 +3076,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
             TPythonDump pd; // not to dump GetGroups()
             SMESH::ListOfGroups_var groups = myMesh->GetGroups();
             pd << ""; // to avoid optimizing pd out
-            for ( int i = 0; i < groups->length(); ++i )
+            for ( CORBA::ULong i = 0; i < groups->length(); ++i )
             {
               SMESH_GroupBase_i* grImpl = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i]);
               if ( grImpl )
@@ -4863,7 +4896,7 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent,
   _CORBA_Octet* buffer = new _CORBA_Octet[real_size];
   char tmp[3];
   tmp[2]='\0';
-  int c = -1;
+  uint c = -1;
   for ( int i = 0; i < real_size; i++ )
   {
     memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 );
@@ -5046,8 +5079,8 @@ char* SMESH_Gen_i::getVersion()
 //            Is used in the drag-n-drop functionality.
 //=================================================================================
 void SMESH_Gen_i::Move( const SMESH::sobject_list& what,
-                        SALOMEDS::SObject_ptr where,
-                        CORBA::Long row )
+                        SALOMEDS::SObject_ptr      where,
+                        CORBA::Long                row )
 {
   if ( CORBA::is_nil( where ) ) return;
 
@@ -5069,7 +5102,7 @@ void SMESH_Gen_i::Move( const SMESH::sobject_list& what,
     }
   }
 
-  for ( int i = 0; i < what.length(); i++ ) {
+  for ( CORBA::ULong i = 0; i < what.length(); i++ ) {
     SALOMEDS::SObject_var sobj = what[i];
     if ( CORBA::is_nil( sobj ) ) continue; // skip bad object
     // insert the object to the use case tree
@@ -5129,9 +5162,10 @@ SMESH::long_array* SMESH_Gen_i::GetInsideSphere( SMESH::SMESH_IDSource_ptr meshP
                                                  CORBA::Double         theX,
                                                  CORBA::Double         theY,
                                                  CORBA::Double         theZ,
-                                                 CORBA::Double         theR) {
+                                                 CORBA::Double         theR)
+{
   SMESH::long_array_var aResult = new SMESH::long_array();
-  if(meshPart->_is_nil())
+  if ( meshPart->_is_nil() )
     return aResult._retn();
 
   // 1. Create geometrical object
@@ -5140,9 +5174,9 @@ SMESH::long_array* SMESH_Gen_i::GetInsideSphere( SMESH::SMESH_IDSource_ptr meshP
 
   std::vector<long> lst =_GetInside(meshPart, theElemType, aShape);
 
-  if( lst.size() > 0 ) {
+  if ( lst.size() > 0 ) {
     aResult->length( lst.size() );
-    for ( long i = 0; i < lst.size(); i++ ) {
+    for ( size_t i = 0; i < lst.size(); i++ ) {
       aResult[i] = lst[i];
     }
   }
@@ -5167,7 +5201,7 @@ SMESH::long_array* SMESH_Gen_i::GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart
 
   if( lst.size() > 0 ) {
     aResult->length( lst.size() );
-    for ( long i = 0; i < lst.size(); i++ ) {
+    for ( size_t i = 0; i < lst.size(); i++ ) {
       aResult[i] = lst[i];
     }
   }
@@ -5198,7 +5232,7 @@ SMESH::long_array* SMESH_Gen_i::GetInsideCylinder( SMESH::SMESH_IDSource_ptr mes
 
   if( lst.size() > 0 ) {
     aResult->length( lst.size() );
-    for ( long i = 0; i < lst.size(); i++ ) {
+    for ( size_t i = 0; i < lst.size(); i++ ) {
       aResult[i] = lst[i];
     }
   }
@@ -5219,7 +5253,7 @@ SMESH::long_array* SMESH_Gen_i::GetInside( SMESH::SMESH_IDSource_ptr meshPart,
 
   if( lst.size() > 0 ) {
     aResult->length( lst.size() );
-    for ( long i = 0; i < lst.size(); i++ ) {
+    for ( size_t i = 0; i < lst.size(); i++ ) {
       aResult[i] = lst[i];
     }
   }
@@ -5273,8 +5307,8 @@ std::vector<long> SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart,
   if ( !gsource->_is_nil() ) {
     if(theElemType == SMESH::NODE) {
       SMESH::long_array_var nodes = gsource->GetNodeIDs();
-      for ( int i = 0; i < nodes->length(); ++i ) {
-        if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] ) ) {
+      for ( CORBA::ULong i = 0; i < nodes->length(); ++i ) {
+        if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] )) {
           long anId = node->GetID();
           if ( anElementsOnShape->IsSatisfy( anId ) )
             res.push_back( anId );
@@ -5282,8 +5316,8 @@ std::vector<long> SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart,
       }
     } else if (gsource->GetType() == theElemType || theElemType == SMESH::ALL ) {
       SMESH::long_array_var elems = gsource->GetListOfID();
-      for ( int i = 0; i < elems->length(); ++i ) {
-        if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] ) ) {
+      for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
+        if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] )) {
           long anId = elem->GetID();
           if ( anElementsOnShape->IsSatisfy( anId ) )
             res.push_back( anId );
@@ -5294,7 +5328,7 @@ std::vector<long> SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart,
   SMESH::SMESH_subMesh_var smsource = SMESH::SMESH_subMesh::_narrow(meshPart);
   if ( !smsource->_is_nil() ) {
     SMESH::long_array_var elems = smsource->GetElementsByType( theElemType );
-    for ( int i = 0; i < elems->length(); ++i ) {
+    for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
       const SMDS_MeshElement* elem = ( theElemType == SMESH::NODE ) ? meshDS->FindNode( elems[i] ) : meshDS->FindElement( elems[i] );
       if (elem) {
         long anId = elem->GetID();
index 7f642720517fc7d3a7018437cd9877102002de74..b60ef8d242e9ae24470c192b94c24a0a39547018 100644 (file)
@@ -71,16 +71,16 @@ public:
     mapIdToId.clear();
   }
   // register object in the internal map and return its id
-  int addObject( string theIOR )
+  int addObject( std::string theIOR )
   {
     int nextId = getNextId();
     mapIdToIOR[ nextId ]  = theIOR;
     return nextId;
   }
   // find the object id in the internal map by the IOR
-  int findId( string theIOR )
+  int findId( std::string theIOR )
   {
-    map<int, string>::iterator imap;
+    std::map<int, std::string>::iterator imap;
     for ( imap = mapIdToIOR.begin(); imap != mapIdToIOR.end(); ++imap ) {
       if ( imap->second == theIOR )
         return imap->first;
@@ -88,18 +88,18 @@ public:
     return 0;
   }
   // get object's IOR by id
-  string getIORbyId( const int theId )
+  std::string getIORbyId( const int theId )
   {
     if ( mapIdToIOR.find( theId ) != mapIdToIOR.end() )
       return mapIdToIOR[ theId ];
-    return string( "" );
+    return std::string( "" );
   }
   // get object's IOR by old id
-  string getIORbyOldId( const int theOldId )
+  std::string getIORbyOldId( const int theOldId )
   {
     if ( mapIdToId.find( theOldId ) != mapIdToId.end() )
       return getIORbyId( mapIdToId[ theOldId ] );
-    return string( "" );
+    return std::string( "" );
   }
   // maps old object id to the new one (used when restoring data)
   void mapOldToNew( const int oldId, const int newId ) {
@@ -107,7 +107,7 @@ public:
   }
   // get old id by a new one
   int getOldId( const int newId ) {
-    map<int, int>::iterator imap;
+    std::map<int, int>::iterator imap;
     for ( imap = mapIdToId.begin(); imap != mapIdToId.end(); ++imap ) {
       if ( imap->second == newId )
         return imap->first;
@@ -125,8 +125,8 @@ private:
     return id;
   }
 
-  map<int, string> mapIdToIOR;      // persistent-to-transient map
-  map<int, int>    mapIdToId;       // used to translate object from persistent to transient form
+  std::map<int, std::string> mapIdToIOR; // persistent-to-transient map
+  std::map<int, int>         mapIdToId;  // to translate object from persistent to transient form
 };
 
 // ===========================================================
@@ -568,7 +568,7 @@ public:
   typename TInterface::_var_type GetObjectByOldId( const int oldID )
   {
     if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
-      string ior = myStudyContext->getIORbyOldId( oldID );
+      std::string ior = myStudyContext->getIORbyOldId( oldID );
       if ( !ior.empty() )
         return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
     }
@@ -671,13 +671,16 @@ private:
   ::SMESH_Gen                    myGen;         // SMESH_Gen local implementation
 
   // hypotheses managing
-  map<string, GenericHypothesisCreator_i*> myHypCreatorMap;
+  std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
 
-  map<int, StudyContext*>   myStudyContextMap;  // Map of study context objects
+  std::map<int, StudyContext*>   myStudyContextMap;  // Map of study context objects
 
-  GEOM_Client*              myShapeReader;      // Shape reader
-  SALOMEDS::Study_var       myCurrentStudy;     // Current study
-  CORBA::Boolean            myIsEmbeddedMode;   // Current mode
+  GEOM_Client*                   myShapeReader;      // Shape reader
+  SALOMEDS::Study_var            myCurrentStudy;     // Current study
+  CORBA::Boolean                 myIsEmbeddedMode;   // Current mode
+
+  // Default color of groups
+  std::string myDefaultGroupColor;
 
   // To load full mesh data from study at hyp modification or not
   bool myToForgetMeshDataOnHypModif;
index 76c2f35d64af727c971b07e3eb76a08226fced5d..322b13d5832903f29c26d3d256d874bb6d2928a2 100644 (file)
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
-//static int VARIABLE_DEBUG = 0;
 #else
 static int MYDEBUG = 0;
-//static int VARIABLE_DEBUG = 0;
 #endif
 
+using namespace std;
+
 //=============================================================================
 /*!
  *  Get...Tag [ static ]
@@ -281,7 +281,8 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
       SALOMEDS::SObject_wrap curObj;
       if ( theFatherObject->GetLastChildTag() > theTag )
       {
-        SALOMEDS::UseCaseIterator_wrap anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);
+        SALOMEDS::UseCaseIterator_wrap
+          anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);
         for ( ; anUseCaseIter->More(); anUseCaseIter->Next() ) {
           curObj = anUseCaseIter->Value();
           if ( curObj->Tag() > theTag  ) {
@@ -294,21 +295,29 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
   }
 
   SALOMEDS::GenericAttribute_wrap anAttr;
-  if ( !CORBA::is_nil( theIOR )) {
+  if ( !CORBA::is_nil( theIOR ))
+  {
     anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeIOR" );
     CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR );
     SALOMEDS::AttributeIOR_wrap iorAttr = anAttr;
-    iorAttr->SetValue( objStr.in() );
-    // UnRegister() !!!
-    SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
-    if ( !genObj->_is_nil() )
-      genObj->UnRegister();
+    CORBA::String_var objStrCur = iorAttr->Value();
+    bool sameIOR = ( objStrCur.in() && strcmp( objStr.in(), objStrCur.in() ) == 0 );
+    if ( !sameIOR )
+    {
+      iorAttr->SetValue( objStr.in() );
+      // UnRegister() !!!
+      SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
+      if ( !genObj->_is_nil() )
+        genObj->UnRegister();
+    }
   }
+
   if ( thePixMap ) {
     anAttr  = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
     SALOMEDS::AttributePixMap_wrap pm = anAttr;
     pm->SetPixMap( thePixMap );
   }
+
   if ( !theSelectable ) {
     anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeSelectable" );
     SALOMEDS::AttributeSelectable_wrap selAttr = anAttr;
@@ -585,7 +594,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
     // Publish global hypotheses
 
     SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( aShapeObject );
-    for ( int i = 0; i < hypList->length(); i++ )
+    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 );
@@ -710,7 +719,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
   // Publish hypothesis
 
   SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( theShapeObject );
-  for ( int i = 0; i < hypList->length(); i++ ) {
+  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 );
@@ -742,7 +751,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
       if ( aMeshSO->_is_nil())
         return SALOMEDS::SObject::_nil();
     }
-    int aType = (int)theGroup->GetType();
+    size_t aType = (int)theGroup->GetType();
     const char* aRootNames[] = {
       "Compound Groups", "Groups of Nodes", "Groups of Edges",
       "Groups of Faces", "Groups of Volumes", "Groups of 0D Elements",
index d51714ae79a7d94929cba87714c2436f2470fd34..8bae7fb5bd72c39c7e5b62894c9a1092124a77d8 100644 (file)
@@ -55,11 +55,11 @@ SMESH_GroupBase_i::SMESH_GroupBase_i( PortableServer::POA_ptr thePOA,
                                       SMESH_Mesh_i*           theMeshServant,
                                       const int               theLocalID )
 : SALOME::GenericObj_i( thePOA ),
-  myMeshServant( theMeshServant ), 
-  myLocalID( theLocalID ),
+  myPreMeshInfo(NULL),
   myNbNodes(-1),
   myGroupDSTic(0),
-  myPreMeshInfo(NULL)
+  myMeshServant( theMeshServant ), 
+  myLocalID( theLocalID )
 {
   // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i,
   // servant activation is performed by SMESH_Mesh_i::createGroup()
@@ -69,8 +69,8 @@ SMESH_GroupBase_i::SMESH_GroupBase_i( PortableServer::POA_ptr thePOA,
 SMESH_Group_i::SMESH_Group_i( PortableServer::POA_ptr thePOA,
                               SMESH_Mesh_i*           theMeshServant,
                               const int               theLocalID )
-     : SALOME::GenericObj_i( thePOA ),
-       SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
+  : SALOME::GenericObj_i( thePOA ),
+    SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
 {
   //MESSAGE("SMESH_Group_i; this = "<<this );
 }
@@ -78,8 +78,8 @@ SMESH_Group_i::SMESH_Group_i( PortableServer::POA_ptr thePOA,
 SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA,
                                           SMESH_Mesh_i*           theMeshServant,
                                           const int               theLocalID )
-     : SALOME::GenericObj_i( thePOA ),
-       SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
+  : SALOME::GenericObj_i( thePOA ),
+    SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
 {
   //MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
 }
@@ -320,9 +320,9 @@ CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs )
   SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() );
   if (aGroupDS) {
     int nbAdd = 0;
-    for (int i = 0; i < theIDs.length(); i++) {
+    for ( CORBA::ULong i = 0; i < theIDs.length(); i++) {
       int anID = (int) theIDs[i];
-      if (aGroupDS->Add(anID))
+      if ( aGroupDS->Add( anID ))
         nbAdd++;
     }
     if ( nbAdd )
@@ -335,7 +335,7 @@ CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs )
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -352,9 +352,9 @@ CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs )
   SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() );
   if (aGroupDS) {
     int nbDel = 0;
-    for (int i = 0; i < theIDs.length(); i++) {
+    for ( CORBA::ULong i = 0; i < theIDs.length(); i++ ) {
       int anID = (int) theIDs[i];
-      if (aGroupDS->Remove(anID))
+      if ( aGroupDS->Remove( anID ))
         nbDel++;
     }
     if ( nbDel )
@@ -367,7 +367,7 @@ CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs )
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -502,8 +502,8 @@ namespace
    */
   //================================================================================
 
-  void getNodesOfElements(SMDS_ElemIteratorPtr        elemIt,
-                          set<const SMDS_MeshNode* >& nodes)
+  void getNodesOfElements(SMDS_ElemIteratorPtr             elemIt,
+                          std::set<const SMDS_MeshNode* >& nodes)
   {
     while ( elemIt->more() )
     {
@@ -531,7 +531,7 @@ CORBA::Long SMESH_GroupBase_i::GetNumberOfNodes()
   {
     if ( myNbNodes < 0 || g->GetTic() != myGroupDSTic )
     {      
-      set<const SMDS_MeshNode* > nodes;
+      std::set<const SMDS_MeshNode* > nodes;
       getNodesOfElements( g->GetElements(), nodes );
       myNbNodes = nodes.size();
       myGroupDSTic = g->GetTic();
@@ -574,10 +574,10 @@ SMESH::long_array* SMESH_GroupBase_i::GetNodeIDs()
   SMESH::long_array_var aRes = new SMESH::long_array();
   if ( SMESHDS_GroupBase* g = GetGroupDS())
   {
-    set<const SMDS_MeshNode* > nodes;
+    std::set<const SMDS_MeshNode* > nodes;
     getNodesOfElements( g->GetElements(), nodes );
     aRes->length( nodes.size() );
-    set<const SMDS_MeshNode*>::iterator nIt = nodes.begin(), nEnd = nodes.end();
+    std::set<const SMDS_MeshNode*>::iterator nIt = nodes.begin(), nEnd = nodes.end();
     for ( int i = 0; nIt != nEnd; ++nIt, ++i )
       aRes[i] = (*nIt)->GetID();
   }
@@ -708,7 +708,7 @@ SMESH::long_array* SMESH_GroupBase_i::GetMeshInfo()
 
   if ( SMESHDS_GroupBase* g = GetGroupDS())
   {
-    if ( g->GetType() == SMDSAbs_Node || ( myNbNodes > -1 && g->GetTic() == myGroupDSTic))
+    if ( g->GetType() == SMDSAbs_Node /*|| ( myNbNodes > -1 && g->GetTic() == myGroupDSTic)*/)
       aRes[ SMDSEntity_Node ] = GetNumberOfNodes();
 
     if ( g->GetType() != SMDSAbs_Node )
@@ -913,12 +913,12 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetMeshInfo()
 
   if ( SMESHDS_GroupBase* g = GetGroupDS())
   {
-    if ( g->GetType() == SMDSAbs_Node || ( myNbNodes > -1 && g->GetTic() == myGroupDSTic))
+    if ( g->GetType() == SMDSAbs_Node /*|| ( myNbNodes > -1 && g->GetTic() == myGroupDSTic)*/)
       aRes[ SMDSEntity_Node ] = GetNumberOfNodes();
 
     if ( g->GetType() != SMDSAbs_Node )
     {
-      vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
+      std::vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
       for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
         if ( i < nbElems.size() )
           aRes[i] = nbElems[ i ];
index 04667edaa48fd33974ff512c62b43cff1b46f4ad..1f0517f3ab13a40b4db646a438489a74f8e3435f 100644 (file)
@@ -237,6 +237,19 @@ void SMESH_Hypothesis_i::setOldParameters (const char* theParameters)
   return myBaseImpl;
 }
 
+//================================================================================
+/*!
+ * \brief Return true if a hypothesis has parameters
+ */
+//================================================================================
+
+CORBA::Boolean SMESH_Hypothesis_i::HasParameters()
+{
+  std::ostringstream os;
+  myBaseImpl->SaveTo( os );
+  return ( !os.str().empty() );
+}
+
 //=============================================================================
 /*!
  *  SMESH_Hypothesis_i::SaveTo
index b589fd319b21da558dac86e587d3edbc25a35458..55c1e2779908af93fe5c241e4c3f5f1b85b94bfc 100644 (file)
@@ -59,31 +59,34 @@ public:
   virtual ~SMESH_Hypothesis_i();
 
   // Get type name of hypothesis
-  char* GetName();
+  virtual char* GetName();
 
   // Get plugin library name of hypothesis
-  char* GetLibName();
+  virtual char* GetLibName();
 
   // Set plugin library name of hypothesis
   void SetLibName( const char* theLibName );
 
   // Get unique id of hypothesis
-  CORBA::Long GetId();
-  
+  virtual CORBA::Long GetId();
+
+  // Return true if a hypothesis has parameters
+  virtual CORBA::Boolean HasParameters();
+
   // Set the variable parameter (a variable name or a parameter value); \a method is a name
   // of method setting this parameter.
   // This method must be called by the hypothesis creator just before calling hyp->method()
-  void SetVarParameter (const char* parameter, const char* method);
+  virtual void SetVarParameter (const char* parameter, const char* method);
 
   // Return the variable parameter used at Hypothesis Creation by the name of method
   // setting this parameter. The returned variable name is used at Hypothesis Edition.
-  char* GetVarParameter (const char* methodName);
+  virtual char* GetVarParameter (const char* methodName);
 
   // Store a hypothesis wrapping this not published one. This hyp, which has
   // no own parameters but is published, is used to store variables defining parameters
   // of this hypothesis. This method is to be called before setting parameters
   // of this hypothesis.
-  void SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp);
+  virtual void SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp);
 
   //Return true if hypothesis was published in study
   bool IsPublished();
index f078bdc10fe6c1f67188b8d756128b08b67beee6..8da1cd7cf9c4b944f293a54e1319fa537968b978 100644 (file)
@@ -132,7 +132,8 @@ static bool isNodeType (SMESH::array_of_ElementType_var theTypes)
   return theTypes->length() > 0 && theTypes[0] == SMESH::NODE;
 }
 
-static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Controls::NumericalFunctorPtr theFunctor)
+static double getNumericalValue(SMESH::SMESH_IDSource_ptr            theSource,
+                                SMESH::Controls::NumericalFunctorPtr theFunctor)
 {
   double value = 0;
 
@@ -142,7 +143,7 @@ static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Cont
       theFunctor->SetMesh( aMesh );
       
       SMESH::long_array_var anElementsId = theSource->GetIDs();
-      for (int i = 0; i < anElementsId->length(); i++) {
+      for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) {
         value += theFunctor->GetValue( anElementsId[i] );
       }
     }
@@ -220,12 +221,12 @@ static void enlargeBoundingBox(const SMDS_MeshNode* theNode,
     theMeasure.node1 = theNode->GetID();
   }
   else {
-    theMeasure.minX = min( theMeasure.minX, theNode->X() );
-    theMeasure.maxX = max( theMeasure.maxX, theNode->X() );
-    theMeasure.minY = min( theMeasure.minY, theNode->Y() );
-    theMeasure.maxY = max( theMeasure.maxY, theNode->Y() );
-    theMeasure.minZ = min( theMeasure.minZ, theNode->Z() );
-    theMeasure.maxZ = max( theMeasure.maxZ, theNode->Z() );
+    theMeasure.minX = std::min( theMeasure.minX, theNode->X() );
+    theMeasure.maxX = std::max( theMeasure.maxX, theNode->X() );
+    theMeasure.minY = std::min( theMeasure.minY, theNode->Y() );
+    theMeasure.maxY = std::max( theMeasure.maxY, theNode->Y() );
+    theMeasure.minZ = std::min( theMeasure.minZ, theNode->Z() );
+    theMeasure.maxZ = std::max( theMeasure.maxZ, theNode->Z() );
   }
 }
 
index 0b927273c4ada665a02e6ea1013ad3285fcf220a..76a5d6d166dce560ee1999a9f2e90a9d047bf800 100644 (file)
@@ -285,13 +285,13 @@ namespace MeshEditor_I {
     SMDS_MeshElement::Filter & filter = *aFilter;
 
     if ( aType == SMDSAbs_Node )
-      for (int i=0; i<IDs.length(); i++) {
+      for ( CORBA::ULong i = 0; i < IDs.length(); i++ ) {
         const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] );
         if ( filter( elem ))
           aMap.insert( aMap.end(), elem );
       }
     else
-      for (int i=0; i<IDs.length(); i++) {
+      for ( CORBA::ULong i = 0; i<IDs.length(); i++) {
         const SMDS_MeshElement * elem = aMesh->FindElement( IDs[i] );
         if ( filter( elem ))
           aMap.insert( aMap.end(), elem );
@@ -315,7 +315,7 @@ namespace MeshEditor_I {
     SMESH::long_array_var     aElementsId = theObject->GetIDs();
     if ( types->length() == 1 && types[0] == SMESH::NODE)
     {
-      for(int i = 0; i < aElementsId->length(); i++)
+      for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ )
         if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] ))
           theNodeSet.insert( theNodeSet.end(), n);
     }
@@ -323,13 +323,13 @@ namespace MeshEditor_I {
     {
       SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator();
       while ( nIt->more( ))
-        if( const SMDS_MeshElement * elem = nIt->next() )
+        if ( const SMDS_MeshElement * elem = nIt->next() )
           theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
     }
     else
     {
-      for(int i = 0; i < aElementsId->length(); i++)
-        if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
+      for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ )
+        if ( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
           theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
     }
   }
@@ -349,7 +349,7 @@ namespace MeshEditor_I {
     SMDSAbs_ElementType elemType    = (*theElements.begin())->GetType();
     bool sameElemType = ( elemType == (*theElements.rbegin())->GetType() );
     if ( sameElemType &&
-         theMeshDS->GetMeshInfo().NbElements( elemType ) == theElements.size() )
+         theMeshDS->GetMeshInfo().NbElements( elemType ) == (int) theElements.size() )
       return; // all the elements are in theElements
 
     if ( !sameElemType )
@@ -794,7 +794,7 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
 
   list< int > IdList;
 
-  for (int i = 0; i < IDsOfElements.length(); i++)
+  for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
     IdList.push_back( IDsOfElements[i] );
 
   // Update Python script
@@ -823,7 +823,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo
   initData();
 
   list< int > IdList;
-  for (int i = 0; i < IDsOfNodes.length(); i++)
+  for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++)
     IdList.push_back( IDsOfNodes[i] );
 
   // Update Python script
@@ -859,9 +859,7 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes()
   SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq );
 
   // remove orphan nodes (if there are any)
-  list< int > IdList;
-  for ( int i = 0; i < seq.size(); i++ )
-    IdList.push_back( seq[i] );
+  list< int > IdList( seq.begin(), seq.end() );
 
   int nbNodesBefore = myMesh->NbNodes();
   getEditor().Remove( IdList, true );
@@ -1584,7 +1582,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfEleme
   SMESH_TRY;
   initData();
 
-  for (int i = 0; i < IDsOfElements.length(); i++)
+  for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
   {
     CORBA::Long index = IDsOfElements[i];
     const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
@@ -2273,7 +2271,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array &              IDsOfElements,
   arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
 
   set<const SMDS_MeshNode*> fixedNodes;
-  for (int i = 0; i < IDsOfFixedNodes.length(); i++) {
+  for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) {
     CORBA::Long index = IDsOfFixedNodes[i];
     const SMDS_MeshNode * node = aMesh->FindNode(index);
     if ( node )
@@ -2866,7 +2864,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the
     idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
 
   list<double> angles;
-  for (int i = 0; i < theAngles.length(); i++) {
+  for ( CORBA::ULong i = 0; i < theAngles.length(); i++ ) {
     angles.push_back( theAngles[i] );
   }
 
@@ -4091,7 +4089,7 @@ FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr      theObject,
   TIDSortedNodeSet nodes;
   idSourceToNodeSet( theObject, getMeshDS(), nodes );
 
-  for ( int i = 0; i < theExceptSubMeshOrGroups.length(); ++i )
+  for ( CORBA::ULong i = 0; i < theExceptSubMeshOrGroups.length(); ++i )
   {
     SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( theExceptSubMeshOrGroups[i],
                                                          SMESH::NODE );
@@ -4127,7 +4125,7 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN
   aTPythonDump << this << ".MergeNodes([";
 
   TIDSortedNodeSet setOfNodesToKeep;
-  for ( int i = 0; i < NodesToKeep.length(); ++i )
+  for ( CORBA::ULong i = 0; i < NodesToKeep.length(); ++i )
   {
     prepareIdSource( NodesToKeep[i] );
     SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( NodesToKeep[i], SMESH::NODE );
@@ -4136,12 +4134,12 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN
   }
 
   ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
-  for (int i = 0; i < GroupsOfNodes.length(); i++)
+  for ( CORBA::ULong i = 0; i < GroupsOfNodes.length(); i++ )
   {
     const SMESH::long_array& aNodeGroup = GroupsOfNodes[ i ];
     aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() );
     list< const SMDS_MeshNode* >& aListOfNodes = aListOfListOfNodes.back();
-    for ( int j = 0; j < aNodeGroup.length(); j++ )
+    for ( CORBA::ULong j = 0; j < aNodeGroup.length(); j++ )
     {
       CORBA::Long index = aNodeGroup[ j ];
       if ( const SMDS_MeshNode * node = aMesh->FindNode( index ))
@@ -4227,11 +4225,11 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& GroupsO
 
   ::SMESH_MeshEditor::TListOfListOfElementsID aListOfListOfElementsID;
 
-  for (int i = 0; i < GroupsOfElementsID.length(); i++) {
+  for ( CORBA::ULong i = 0; i < GroupsOfElementsID.length(); i++ ) {
     const SMESH::long_array& anElemsIDGroup = GroupsOfElementsID[ i ];
     aListOfListOfElementsID.push_back( list< int >() );
     list< int >& aListOfElemsID = aListOfListOfElementsID.back();
-    for ( int j = 0; j < anElemsIDGroup.length(); j++ ) {
+    for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ ) {
       CORBA::Long id = anElemsIDGroup[ j ];
       aListOfElemsID.push_back( id );
     }
@@ -4456,7 +4454,7 @@ SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double      x,
                                            SMDSAbs_ElementType( type ),
                                            foundElems);
   res->length( foundElems.size() );
-  for ( int i = 0; i < foundElems.size(); ++i )
+  for ( size_t i = 0; i < foundElems.size(); ++i )
     res[i] = foundElems[i]->GetID();
 
   return res._retn();
@@ -4517,7 +4515,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID
                                            SMDSAbs_ElementType( type ),
                                            foundElems);
   res->length( foundElems.size() );
-  for ( int i = 0; i < foundElems.size(); ++i )
+  for ( size_t i = 0; i < foundElems.size(); ++i )
     res[i] = foundElems[i]->GetID();
 
   return res._retn();
@@ -4568,6 +4566,7 @@ static SMESH::SMESH_MeshEditor::Sew_Error convError( const::SMESH_MeshEditor::Se
     RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS );
     RETCASE( SEW_BAD_SIDE1_NODES );
     RETCASE( SEW_BAD_SIDE2_NODES );
+    RETCASE( SEW_INTERNAL_ERROR );
   }
   return SMESH::SMESH_MeshEditor::SEW_OK;
 }
@@ -4651,16 +4650,16 @@ SewCoincidentFreeBorders(const SMESH::CoincidentFreeBorders& freeBorders,
     for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP )
     {
       const SMESH::FreeBorderPart& aPART = aGRP[ iP ];
-      if ( aPART.border < 0 || aPART.border >= freeBorders.borders.length() )
+      if ( aPART.border < 0 || aPART.border >= (int) freeBorders.borders.length() )
         THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::border index", SALOME::BAD_PARAM);
 
       const SMESH::FreeBorder& aBRD = freeBorders.borders[ aPART.border ];
 
-      if ( aPART.node1 < 0 || aPART.node1 > aBRD.nodeIDs.length() )
+      if ( aPART.node1 < 0 || aPART.node1 > (int) aBRD.nodeIDs.length() )
         THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node1", SALOME::BAD_PARAM);
-      if ( aPART.node2 < 0 || aPART.node2 > aBRD.nodeIDs.length() )
+      if ( aPART.node2 < 0 || aPART.node2 > (int) aBRD.nodeIDs.length() )
         THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node2", SALOME::BAD_PARAM);
-      if ( aPART.nodeLast < 0 || aPART.nodeLast > aBRD.nodeIDs.length() )
+      if ( aPART.nodeLast < 0 || aPART.nodeLast > (int) aBRD.nodeIDs.length() )
         THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::nodeLast", SALOME::BAD_PARAM);
 
       // do not keep these nodes for further sewing as nodes can be removed by the sewing
@@ -5250,10 +5249,10 @@ void SMESH_MeshEditor_i::dumpGroupsList(TPythonDump &               theDumpPytho
 */
 //================================================================================
 
-string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
+std::string SMESH_MeshEditor_i::generateGroupName(const std::string& thePrefix)
 {
   SMESH::ListOfGroups_var groups = myMesh_i->GetGroups();
-  set<string> groupNames;
+  set<std::string> groupNames;
 
   // Get existing group names
   for (int i = 0, nbGroups = groups->length(); i < nbGroups; i++ ) {
@@ -5266,7 +5265,7 @@ string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
   }
 
   // Find new name
-  string name = thePrefix;
+  std::string name = thePrefix;
   int index = 0;
 
   while (!groupNames.insert(name).second)
@@ -5305,7 +5304,7 @@ bool SMESH_MeshEditor_i::idSourceToSet(SMESH::SMESH_IDSource_ptr  theIDSource,
 {
   if ( error ) *error = IDSource_OK;
 
-  if ( CORBA::is_nil( theIDSource ) )
+  if ( CORBA::is_nil( theIDSource ))
   {
     if ( error ) *error = IDSource_INVALID;
     return false;
@@ -5574,8 +5573,8 @@ SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
     // Create group with newly created nodes
     SMESH::long_array_var anIds = GetLastCreatedNodes();
     if (anIds->length() > 0) {
-      string anUnindexedName (theNodes->GetName());
-      string aNewName = generateGroupName(anUnindexedName + "_double");
+      std::string anUnindexedName (theNodes->GetName());
+      std::string aNewName = generateGroupName(anUnindexedName + "_double");
       aNewGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str());
       aNewGroup->Add(anIds);
       pyDump << aNewGroup << " = ";
@@ -5673,8 +5672,8 @@ SMESH_MeshEditor_i::DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
     // Create group with newly created nodes
     SMESH::long_array_var anIds = GetLastCreatedNodes();
     if (anIds->length() > 0) {
-      string anUnindexedName (theNodes[0]->GetName());
-      string aNewName = generateGroupName(anUnindexedName + "_double");
+      std::string anUnindexedName (theNodes[0]->GetName());
+      std::string aNewName = generateGroupName(anUnindexedName + "_double");
       aNewGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str());
       aNewGroup->Add(anIds);
       pyDump << aNewGroup << " = ";
@@ -5898,7 +5897,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
   {
     // Create group with newly created elements
     CORBA::String_var elemGroupName = theElems->GetName();
-    string aNewName = generateGroupName( string(elemGroupName.in()) + "_double");
+    std::string aNewName = generateGroupName( std::string(elemGroupName.in()) + "_double");
     if ( !getEditor().GetLastCreatedElems().IsEmpty() && theElemGroupNeeded )
     {
       SMESH::long_array_var anIds = GetLastCreatedElems();
@@ -6130,7 +6129,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems
   {
     // Create group with newly created elements
     CORBA::String_var elemGroupName = theElems[0]->GetName();
-    string aNewName = generateGroupName( string(elemGroupName.in()) + "_double");
+    std::string aNewName = generateGroupName( std::string(elemGroupName.in()) + "_double");
     if ( !getEditor().GetLastCreatedElems().IsEmpty() && theElemGroupNeeded )
     {
       SMESH::long_array_var anIds = GetLastCreatedElems();
@@ -6500,7 +6499,7 @@ void SMESH_MeshEditor_i::CreateHoleSkin(CORBA::Double                  radius,
     theNodeSearcher = SMESH_MeshAlgos::GetNodeSearcher( *getMeshDS() );
 
   vector<double> nodesCoords;
-  for (int i = 0; i < theNodesCoords.length(); i++)
+  for ( CORBA::ULong i = 0; i < theNodesCoords.length(); i++)
   {
     nodesCoords.push_back( theNodesCoords[i] );
   }
@@ -6666,7 +6665,7 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim,
   groupsOfThisMesh ->length( groups.length() );
   groupsOfOtherMesh->length( groups.length() );
   int nbGroups = 0, nbGroupsOfOtherMesh = 0;
-  for ( int i = 0; i < groups.length(); ++i )
+  for ( CORBA::ULong i = 0; i < groups.length(); ++i )
   {
     SMESH::SMESH_Mesh_var m = groups[i]->GetMesh();
     if ( myMesh_i != SMESH::DownCast<SMESH_Mesh_i*>( m ))
index 3c36508b84597492b031d77762214bdbf76464a6..e657c5f610fd20a34c4949fa5f7a1a6df0a8ff6f 100644 (file)
@@ -37,6 +37,7 @@
 #include "SMESH_PythonDump.hxx"
 #include "SMESH_MeshEditor.hxx"
 #include <list>
+#include <string>
 
 class SMESH_Mesh_i;
 
@@ -897,7 +898,7 @@ private: //!< private methods
   void dumpGroupsList(SMESH::TPythonDump &        theDumpPython,
                       const SMESH::ListOfGroups * theGroupList);
 
-  string generateGroupName(const string& thePrefix);
+  std::string generateGroupName(const std::string& thePrefix);
 
   void prepareIdSource(SMESH::SMESH_IDSource_ptr theObject);
 
index b521af9ebbe4f3b76a02b569cc6d58c178c1e085..b025573b9b559add0fb7ed705d7ffc70251e04ef 100644 (file)
@@ -293,7 +293,7 @@ void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
   if ( _preMeshInfo )
-    _preMeshInfo->ForgetAllData();
+    _preMeshInfo->ForgetOrLoad(); // load in case if !HasShapeToMesh()
 
   try {
     _impl->Clear();
@@ -1762,7 +1762,7 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfIDSources& theGroups,
         while ( nIt->more() )
         {
           const SMDS_MeshNode* n = nIt->next();
-          if ( n->GetID() >= isNodeInGroups.size() )
+          if ( n->GetID() >= (int) isNodeInGroups.size() )
             isNodeInGroups.resize( n->GetID() + 1, false );
           isNodeInGroups[ n->GetID() ] = true;
         }
@@ -1851,7 +1851,7 @@ void SMESH_Mesh_i::addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj,
   CORBA::String_var entry = groupSO->GetID();
   groupData._groupEntry = entry.in();
   // indices
-  for ( int i = 0; i < ids->length(); ++i )
+  for ( CORBA::ULong i = 0; i < ids->length(); ++i )
     groupData._indices.insert( ids[i] );
   // SMESH object
   groupData._smeshObject = CORBA::Object::_duplicate( theSmeshObj );
@@ -1904,7 +1904,7 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
     GEOM::GEOM_IGroupOperations_wrap groupOp =
       geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
     GEOM::ListOfLong_var   ids = groupOp->GetObjects( geomGroup );
-    for ( int i = 0; i < ids->length(); ++i )
+    for ( CORBA::ULong i = 0; i < ids->length(); ++i )
       curIndices.insert( ids[i] );
 
     if ( groupData._indices == curIndices )
@@ -3398,7 +3398,7 @@ void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field&        fieldWriter,
         {
           const SMDS_MeshElement* e = elemIt->next();
           const int shapeID = e->getshapeId();
-          if ( shapeID < 1 || shapeID >= dblVals.size() )
+          if ( shapeID < 1 || shapeID >= (int) dblVals.size() )
             fieldWriter.AddValue( noneDblValue );
           else
             fieldWriter.AddValue( dblVals[ shapeID ]);
@@ -3408,7 +3408,7 @@ void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field&        fieldWriter,
         {
           const SMDS_MeshElement* e = elemIt->next();
           const int shapeID = e->getshapeId();
-          if ( shapeID < 1 || shapeID >= intVals.size() )
+          if ( shapeID < 1 || shapeID >= (int) intVals.size() )
             fieldWriter.AddValue( (double) noneIntValue );
           else
             fieldWriter.AddValue( (double) intVals[ shapeID ]);
@@ -4673,7 +4673,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long  elemId,
       {
         aResult->length( vtool.NbFaceNodes( faceIndex ));
         const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex );
-        for ( int i = 0; i < aResult->length(); ++i )
+        for ( CORBA::ULong i = 0; i < aResult->length(); ++i )
           aResult[ i ] = nn[ i ]->GetID();
       }
     }
@@ -4722,7 +4722,7 @@ CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes)
   if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
   {
     vector< const SMDS_MeshNode * > nn( nodes.length() );
-    for ( int i = 0; i < nodes.length(); ++i )
+    for ( CORBA::ULong i = 0; i < nodes.length(); ++i )
       if ( !( nn[i] = mesh->FindNode( nodes[i] )))
         return elemID;
 
@@ -5111,11 +5111,11 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
     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(int i = 0;i < aVars.length();i++)
-          aResult[i] = CORBA::string_dup( aVars[i]);
+      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] );
       }
     }
   }
@@ -5407,7 +5407,7 @@ SMDS_ElemIteratorPtr SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_ptr theObje
                                                SMESH::ElementType        theType)
 {
   SMDS_ElemIteratorPtr  elemIt;
-  bool                  typeOK = false;
+  bool                  typeOK = ( theType == SMESH::ALL );
   SMDSAbs_ElementType elemType = SMDSAbs_ElementType( theType );
 
   SMESH::SMESH_Mesh_var meshVar = theObject->GetMesh();
@@ -5637,7 +5637,7 @@ class SMESH_DimHyp
       if ( find( theOther->_hypotheses.begin(), otheEndIt, *hypIt ) != otheEndIt )
         nbSame++;
     // the submeshes are concurrent if their algorithms has different parameters
-    return nbSame != theOther->_hypotheses.size() - 1;
+    return nbSame != (int)theOther->_hypotheses.size() - 1;
   }
 
   // Return true if algorithm of this SMESH_DimHyp is used if no
@@ -6070,14 +6070,14 @@ SMESH_MeshPartDS::SMESH_MeshPartDS(SMESH::SMESH_IDSource_ptr meshPart):
     SMESH::array_of_ElementType_var types = meshPart->GetTypes();
     if ( types->length() == 1 && types[0] == SMESH::NODE ) // group of nodes
     {
-      for (int i=0; i < anIDs->length(); i++)
-        if ( const SMDS_MeshNode * n = _meshDS->FindNode(anIDs[i]))
+      for ( CORBA::ULong i=0; i < anIDs->length(); i++ )
+        if ( const SMDS_MeshNode * n = _meshDS->FindNode( anIDs[i] ))
           if ( _elements[ SMDSAbs_Node ].insert( n ).second )
             tmpInfo.Add( n );
     }
     else
     {
-      for (int i=0; i < anIDs->length(); i++)
+      for ( CORBA::ULong i=0; i < anIDs->length(); i++ )
         if ( const SMDS_MeshElement * e = _meshDS->FindElement(anIDs[i]))
           if ( _elements[ e->GetType() ].insert( e ).second )
           {
index 943a1b76738ae4c9d42e335936b3a649a0f27322..75297f2dbfa217a62c1151882b93175399515e62 100644 (file)
@@ -53,7 +53,7 @@ namespace
    */
   void SetVariable(Handle(_pyCommand) theCommand,
                    const SMESH_ObjectStates* theStates,
-                   int position, int theArgNb)
+                   size_t position, int theArgNb)
   {
     if(theStates->GetCurrectState().size() > position)
       if(!theStates->GetCurrectState().at(position).IsEmpty())
@@ -100,7 +100,7 @@ void SMESH_ObjectStates::AddState(const TState &theState)
 //================================================================================
 TState SMESH_ObjectStates::GetCurrectState() const
 {
-  if(_states.size() > _dumpstate)
+  if ( (int) _states.size() > _dumpstate)
     return _states[_dumpstate];
   TState empty;
   return empty;
@@ -236,7 +236,7 @@ SMESH_NoteBook::~SMESH_NoteBook()
 //================================================================================
 void SMESH_NoteBook::ReplaceVariables()
 {
-  for(int i=0;i<_commands.size();i++)
+  for ( size_t i = 0 ; i < _commands.size(); i++ )
   {
     Handle(_pyCommand) aCmd = _commands[i];
     TCollection_AsciiString aMethod      = aCmd->GetMethod();
@@ -714,7 +714,7 @@ void SMESH_NoteBook::ReplaceVariables()
         {
           TState aCurrentState = aStates->GetCurrectState();
           int         argIndex = h->getParamIndex( aMethod, aCurrentState.size() );
-          if ( 0 <= argIndex && argIndex < aCurrentState.size() &&
+          if ( 0 <= argIndex && argIndex < (int)aCurrentState.size() &&
                !aCurrentState[argIndex].IsEmpty() )
             aCmd->SetArg( 1, aCurrentState[argIndex] );
 
@@ -790,10 +790,10 @@ void SMESH_NoteBook::InitObjectMap()
       else
         aState = new SMESH_ObjectStates(anObjType);
 
-      for(int i = 0; i < aSections->length(); i++) {
+      for ( size_t i = 0; i < aSections->length(); i++ ) {
         TState aVars;
         SALOMEDS::ListOfStrings aListOfVars = aSections[i];
-        for ( int j = 0; j<aListOfVars.length(); j++)
+        for ( size_t j = 0; j < aListOfVars.length(); j++)
         {
           TCollection_AsciiString aVar(aListOfVars[j].in());
           if(!aVar.IsEmpty() && aStudy->IsVariable(aVar.ToCString())) {
@@ -859,8 +859,8 @@ void SMESH_NoteBook::ProcessLayerDistribution()
     return;
   
   // 2) Initialize all type of 1D Distribution hypothesis
-  for(int i=0;i<_commands.size();i++){
-    for(int j =0;j < aLDS.size();j++){
+  for ( size_t i = 0; i < _commands.size(); i++ ) {
+    for ( size_t j = 0; j < aLDS.size(); j++ ) {
       TCollection_AsciiString aResultValue = _commands[i]->GetResultValue();
       if(_commands[i]->GetMethod() == "CreateHypothesis" &&
          aLDS[j]->HasDistribution(aResultValue)){
@@ -872,8 +872,8 @@ void SMESH_NoteBook::ProcessLayerDistribution()
   }
   // 3) ... and replase variables ...
 
-  for(int i=0;i<_commands.size();i++){
-    for(int j =0;j < aLDS.size();j++){
+  for ( size_t i = 0; i < _commands.size(); i++ ) {
+    for ( size_t j = 0; j < aLDS.size(); j++ ) {
       TCollection_AsciiString anObject = _commands[i]->GetObject();
 
       if(aLDS[j]->HasDistribution(anObject)) {
@@ -929,8 +929,8 @@ void SMESH_NoteBook::ProcessLayerDistribution()
 TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
 {
   TCollection_AsciiString aResult;
-  for(int i=0;i<_commands.size();i++)
-    aResult+=_commands[i]->GetString()+"\n";
+  for ( size_t i = 0; i < _commands.size(); i++ )
+    aResult += _commands[i]->GetString() + "\n";
   return aResult;
 }
 
@@ -941,7 +941,7 @@ TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
 //================================================================================
 void SMESH_NoteBook::GetResultLines(std::list< TCollection_AsciiString >& lines) const
 {
-  for(int i=0;i<_commands.size();i++)
+  for ( size_t i = 0; i < _commands.size(); i++ )
     lines.push_back( _commands[i]->GetString() );
 }
 
index f7fcbb49308fd8db9482530e24e9856eae853c7c..40d68e5b9b9e620b86daaa7b9c7cfe1bdc39cfe1 100644 (file)
@@ -45,6 +45,8 @@
 #include <sstream>
 #include <set>
 
+using namespace std;
+
 using SMESH::TPythonDump;
 using SMESH::TVar;
 
@@ -284,7 +286,7 @@ SMESH::point_array*
 
   list<const gp_XYZ *> xyzList;
   set<const SMDS_MeshFace*> fset;
-  for (int i = 0; i < theFacesIDs.length(); i++)
+  for ( CORBA::ULong i = 0; i < theFacesIDs.length(); i++)
   {
     CORBA::Long index = theFacesIDs[i];
     const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index);
@@ -345,7 +347,7 @@ SMESH::point_array*
 
   list<const gp_XYZ *> xyzList;
   set<const SMDS_MeshVolume*> vset;
-  for (int i = 0; i < theVolumesIDs.length(); i++)
+  for ( CORBA::ULong i = 0; i < theVolumesIDs.length(); i++)
   {
     CORBA::Long index = theVolumesIDs[i];
     const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index);
index 130330c1ca12d76a3a172b01ad19222489389003..0621ed9f1db69f72dcd23f813bbf9a37dbc1065b 100644 (file)
@@ -54,6 +54,7 @@
 
 #include CORBA_SERVER_HEADER(SALOME_Session)
 
+using namespace std;
 
 #define MYDEBUGOUT(msg) //std::cout << msg << std::endl;
 
@@ -62,7 +63,7 @@ namespace
   enum {  GroupOnFilter_OutOfDate = -1 };
 
   // a map to count not yet loaded meshes 
-  static map< int, int > theStudyIDToMeshCounter;
+  static std::map< int, int > theStudyIDToMeshCounter;
 
   //================================================================================
   /*!
@@ -72,8 +73,8 @@ namespace
 
   void meshInfoLoaded( SMESH_Mesh_i* mesh )
   {
-    map< int, int >::iterator id2counter =
-      theStudyIDToMeshCounter.insert( make_pair( (int) mesh->GetStudyId(), 0 )).first;
+    std::map< int, int >::iterator id2counter =
+      theStudyIDToMeshCounter.insert( std::make_pair( (int) mesh->GetStudyId(), 0 )).first;
     id2counter->second++;
   }
   //================================================================================
@@ -88,7 +89,7 @@ namespace
   {
     if ( --theStudyIDToMeshCounter[ (int) mesh->GetStudyId() ] == 0 )
     {
-      string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
+      std::string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
 
       SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
       aFiles->length(2);
@@ -109,7 +110,7 @@ namespace
 
   class SignalToGUI
   {
-    string              _messagePrefix;
+    std::string         _messagePrefix;
     SALOME::Session_var _session;
   public:
     SignalToGUI( SMESH_Mesh_i* mesh )
@@ -127,7 +128,7 @@ namespace
           _messagePrefix = "SMESH/mesh_loading/";
           _messagePrefix += meshEntry.in();
 
-          string msgToGUI = _messagePrefix + "/";
+          std::string msgToGUI = _messagePrefix + "/";
           msgToGUI += SMESH_Comment( mesh->NbNodes() );
           msgToGUI += "/";
           msgToGUI += SMESH_Comment( mesh->NbElements() );
@@ -140,7 +141,7 @@ namespace
     {
       if ( !_messagePrefix.empty() )
       {
-        string msgToGUI = _messagePrefix + "/stop";
+        std::string msgToGUI = _messagePrefix + "/stop";
         _session->emitMessageOneWay( msgToGUI.c_str());
         _messagePrefix.clear();
       }
@@ -173,7 +174,7 @@ namespace
     SMDS_PositionPtr vertexPosition()  const { return SMDS_PositionPtr( new SMDS_VertexPosition); }
     SMDS_PositionPtr defaultPosition() const { return SMDS_SpacePosition::originSpacePosition();  }
     typedef SMDS_PositionPtr (PositionCreator:: * FmakePos)() const;
-    vector<FmakePos> myFuncTable;
+    std::vector<FmakePos> myFuncTable;
   };
 
   //================================================================================
@@ -182,12 +183,12 @@ namespace
    */
   //================================================================================
 
-  vector<int> getSimpleSubMeshIds( SMESHDS_Mesh* meshDS, int shapeId )
+  std::vector<int> getSimpleSubMeshIds( SMESHDS_Mesh* meshDS, int shapeId )
   {
-    vector<int> ids;
+    std::vector<int> ids;
 
-    list<TopoDS_Shape> shapeQueue( 1, meshDS->IndexToShape( shapeId ));
-    list<TopoDS_Shape>::iterator shape = shapeQueue.begin();
+    std::list<TopoDS_Shape> shapeQueue( 1, meshDS->IndexToShape( shapeId ));
+    std::list<TopoDS_Shape>::iterator shape = shapeQueue.begin();
     for ( ; shape != shapeQueue.end(); ++shape )
     {
       if ( shape->IsNull() ) continue;
@@ -222,10 +223,10 @@ namespace
    */
   //================================================================================
 
-  typedef map< MED::EGeometrieElement, SMDSAbs_EntityType > Tmed2smeshElemTypeMap;
+  typedef std::map< MED::EGeometrieElement, SMDSAbs_EntityType > Tmed2smeshElemTypeMap;
   const Tmed2smeshElemTypeMap& med2smeshElemTypeMap()
   {
-    static map< MED::EGeometrieElement, SMDSAbs_EntityType> med2smeshTypes;
+    static Tmed2smeshElemTypeMap med2smeshTypes;
     if ( med2smeshTypes.empty() )
     {
       for  ( int iG = 0; iG < SMDSEntity_Last; ++iG )
@@ -233,7 +234,7 @@ namespace
         SMDSAbs_EntityType    smdsType = (SMDSAbs_EntityType) iG;
         MED::EGeometrieElement medType =
           (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
-        med2smeshTypes.insert( make_pair( medType, smdsType ));
+        med2smeshTypes.insert( std::make_pair( medType, smdsType ));
       }
     }
     return med2smeshTypes;
@@ -254,7 +255,7 @@ namespace
     // change at insertion of new items in the middle.
     //const vector<MED::EGeometrieElement>& medTypes = mesh2medElemType();
 
-    vector<int> data;
+    std::vector<int> data;
 
     for ( size_t i = 0; i < meshInfo->length(); ++i )
       if ( meshInfo[i] > 0 )
@@ -298,7 +299,7 @@ void SMESH_PreMeshInfo::hdf2meshInfo( const std::string& name,
     // // array->GetDim( datasetSize );
     // int size = dataset->GetSize();
 
-    vector<int> info( SMDSEntity_Last * 2, 0 );
+    std::vector<int> info( SMDSEntity_Last * 2, 0 );
     dataset->ReadFromDisk( &info[0] );
     dataset->CloseOnDisk();
 
@@ -429,7 +430,7 @@ bool SMESH_PreMeshInfo::readPreInfoFromHDF()
         group_i->changePreMeshInfo() = newInstance();
         if ( SMESHDS_GroupBase* group = group_i->GetGroupDS() )
         {
-          const string name = group->GetStoreName();
+          const std::string name = group->GetStoreName();
           group_i->changePreMeshInfo()->hdf2meshInfo( name, infoHdfGroup );
         }
       }
@@ -499,7 +500,7 @@ void SMESH_PreMeshInfo::readGroupInfo()
   if ( _mesh->_mapGroups.empty() ) return;
 
   // make SMESH_PreMeshInfo of groups
-  map< string, SMESH_PreMeshInfo* > name2GroupInfo;
+  map< std::string, SMESH_PreMeshInfo* > name2GroupInfo;
   map<int, SMESH::SMESH_GroupBase_ptr>::const_iterator i2group = _mesh->_mapGroups.begin();
   for ( ; i2group != _mesh->_mapGroups.end(); ++i2group )
   {
@@ -510,8 +511,8 @@ void SMESH_PreMeshInfo::readGroupInfo()
       group_i->changePreMeshInfo() = info;
       if ( SMESHDS_Group* group = dynamic_cast< SMESHDS_Group* >( group_i->GetGroupDS() ))
       {
-        string name = group->GetStoreName();
-        name2GroupInfo.insert( make_pair( name, info ));
+        std::string name = group->GetStoreName();
+        name2GroupInfo.insert( std::make_pair( name, info ));
         info->_isInfoOk = true;
       }
     }
@@ -534,8 +535,8 @@ void SMESH_PreMeshInfo::readGroupInfo()
     vector< SMESH_PreMeshInfo* >& grInfoVec = famId2grInfo[ medFamInfo->GetId() ];
     for ( int iG = 0; iG < nbGroups; ++iG )
     {
-      const string grName = medFamInfo->GetGroupName( iG );
-      map< string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.find( grName );
+      const std::string grName = medFamInfo->GetGroupName( iG );
+      map< std::string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.find( grName );
       if ( n2i != name2GroupInfo.end() )
         grInfoVec.push_back( n2i->second );
     }
@@ -560,14 +561,14 @@ void SMESH_PreMeshInfo::readGroupInfo()
         f2infos = famId2grInfo.find( famNums[i] );
         if ( f2infos == famId2grInfo.end() )
           f2infos = famId2grInfo.insert
-            ( make_pair( famNums[i], vector< SMESH_PreMeshInfo*>())).first;
+            ( std::make_pair( famNums[i], vector< SMESH_PreMeshInfo*>())).first;
       }
       vector< SMESH_PreMeshInfo* >& infoVec = f2infos->second ;
       for ( size_t j = 0; j < infoVec.size(); ++j )
         infoVec[j]->_elemCounter++;
     }
     // pass _elemCounter to a real elem type
-    map< string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.begin();
+    map< std::string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.begin();
     for ( ; n2i != name2GroupInfo.end(); ++n2i )
     {
       SMESH_PreMeshInfo* info = n2i->second;
@@ -618,7 +619,7 @@ void SMESH_PreMeshInfo::readSubMeshInfo()
 
       for ( int isNode = 0; isNode < 2; ++isNode )
       {
-        string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
+        std::string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
         if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() ))
         {
           // read sub-mesh id of all nodes or elems
@@ -893,13 +894,13 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
       SMDS_ElemIteratorPtr eIt = meshDS->elementsIterator();
       for ( int isNode = 0; isNode < 2; ++isNode )
       {
-        string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
+        std::string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
         if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() ))
         {
           HDFdataset* aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup );
           aDataset->OpenOnDisk();
           // read submesh IDs for all elements sorted by ID
-          int nbElems = aDataset->GetSize();
+          size_t nbElems = aDataset->GetSize();
           int* smIDs = new int [ nbElems ];
           aDataset->ReadFromDisk( smIDs );
           aDataset->CloseOnDisk();
@@ -921,7 +922,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
           }
           // add elements to submeshes
           TIDSortedElemSet::iterator iE = elemSet.begin();
-          for ( int i = 0; i < nbElems; ++i, ++iE )
+          for ( size_t i = 0; i < nbElems; ++i, ++iE )
           {
             int smID = smIDs[ i ];
             if ( smID == 0 ) continue;
index 02c2664f0807b56dfc86344d499473ab5a34c96d..ee9117e2cae0528bd925a1dbe019ea5f7e8151b5 100644 (file)
@@ -95,7 +95,7 @@ typedef list<SMESHDS_SubMesh*> TListOfSubMeshes;
 bool getSubMeshes(::SMESH_subMesh*  theSubMesh,
                   TListOfSubMeshes& theSubMeshList)
 {
-  int size = theSubMeshList.size();
+  size_t size = theSubMeshList.size();
 
   SMESH_Mesh*      aMesh      = theSubMesh->GetFather();
   SMESHDS_Mesh*    aMeshDS    = aMesh->GetMeshDS();
index 98acce5f6d38b3d3943984d5619d1d0ecf475b8b..6dd91e28875d897a6c5f0a6025d70ff08f96a216 100644 (file)
@@ -1417,10 +1417,13 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
     #  @param UseExisting if ==true - searches for the existing hypothesis created with
     #                     the same parameters, else (default) - creates a new one
     def SourceFaces(self, groups, toCopyMesh=False, toCopyGroups=False, UseExisting=False):
+        import SMESH
         compFun = lambda hyp, args: ( hyp.GetSourceFaces() == args[0] and \
                                       hyp.GetCopySourceMesh() == args[1], args[2] )
         hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups],
                               UseExisting=UseExisting, CompareMethod=compFun, toAdd=False)
+        if groups and isinstance( groups, SMESH._objref_SMESH_GroupBase ):
+            groups = [groups]
         hyp.SetSourceFaces(groups)
         hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
         self.mesh.AddHypothesis(hyp, self.geom)
index 22ea69d836f27507b247dc6893f7b63a9adf056b..2c98e16531d3c1bfe36890986f53e22cb43d70a6 100644 (file)
@@ -1424,8 +1424,10 @@ class Mesh:
 
             # Treat compute errors
             computeErrors = self.smeshpyD.GetComputeErrors( self.mesh, geom )
+            shapeText = ""
             for err in computeErrors:
-                shapeText = " on %s" % self.GetSubShapeName( err.subShapeID )
+                if self.mesh.HasShapeToMesh():
+                    shapeText = " on %s" % self.GetSubShapeName( err.subShapeID )
                 errText = ""
                 stdErrors = ["OK",                   #COMPERR_OK
                              "Invalid input mesh",   #COMPERR_BAD_INPUT_MESH
@@ -1680,9 +1682,10 @@ class Mesh:
         if self.mesh.HasShapeToMesh():
             hyp_type     = hyp.GetName()
             lib_name     = hyp.GetLibName()
-            checkAll    = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
-            if checkAll and geom:
-                checkAll = geom.GetType() == 37
+            # checkAll    = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
+            # if checkAll and geom:
+            #     checkAll = geom.GetType() == 37
+            checkAll     = False
             isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll)
         if isApplicable:
             AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())
index 05af0db649eb9c848b2c21650ca2e10dcb1316be..6327d5d21a12e7280b4b3115f2a7a859d14eb930 100644 (file)
@@ -62,6 +62,7 @@ SET(_link_LIBRARIES
   ${CAS_TKAdvTools}
   ${CAS_TKTopAlgo}
   ${CAS_TKG3d}
+  ${CAS_TKOffset}
   ${GEOM_GEOMUtils}
   SMESHimpl
   SMESHDS
index 946c200df7c2343ba9436b324580d40fb3dba664..8ffcc0ce255b21818cd42c9fc905a41763123887 100644 (file)
@@ -535,7 +535,7 @@ namespace // internal utils
         for ( int i = 0; i < 3; ++i )
         {
           const gp_Pnt& pn = myNodes->Value(n[i]);
-          if ( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 ))
+          if (( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 )))
             break;
           if ( !projectedOnly )
             minD2 = Min( minD2, pn.SquareDistance( p ));
@@ -703,7 +703,7 @@ namespace // internal utils
   void ElementBndBoxTree::buildChildrenData()
   {
     ElemTreeData* data = GetElemData();
-    for ( int i = 0; i < _elementIDs.size(); ++i )
+    for ( size_t i = 0; i < _elementIDs.size(); ++i )
     {
       const Bnd_B3d* elemBox = data->GetBox( _elementIDs[i] );
       for (int j = 0; j < 8; j++)
@@ -718,7 +718,7 @@ namespace // internal utils
     {
       ElementBndBoxTree* child = static_cast<ElementBndBoxTree*>( myChildren[j] );
       child->_elementIDs = data->myWorkIDs[ j ];
-      if ( child->_elementIDs.size() <= theMaxNbElemsInLeaf )
+      if ((int) child->_elementIDs.size() <= theMaxNbElemsInLeaf )
         child->myIsLeaf = true;
       data->myWorkIDs[ j ].clear();
     }
@@ -741,7 +741,7 @@ namespace // internal utils
       if ( isLeaf() )
       {
         ElemTreeData* data = GetElemData();
-        for ( int i = 0; i < _elementIDs.size(); ++i )
+        for ( size_t i = 0; i < _elementIDs.size(); ++i )
           if ( !data->GetBox( _elementIDs[i] )->IsOut( center, radius ))
             foundElemIDs.push_back( _elementIDs[i] );
       }
@@ -992,7 +992,7 @@ ostream & StdMeshers_Adaptive1D::SaveTo(ostream & save)
 istream & StdMeshers_Adaptive1D::LoadFrom(istream & load)
 {
   int dummyParam;
-  bool isOK = (load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
+  bool isOK = static_cast<bool>(load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
   return load;
@@ -1197,7 +1197,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
   StdMeshers_Regular_1D::_value[ DEFLECTION_IND ] = myHyp->GetDeflection();
 
   list< double > params;
-  for ( int iE = 0; iE < myEdges.size(); ++iE )
+  for ( size_t iE = 0; iE < myEdges.size(); ++iE )
   {
     EdgeData& eData = myEdges[ iE ];
     //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
@@ -1243,7 +1243,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
 
     triaSearcher->SetSizeByTrias( sizeTree, myHyp->GetDeflection() );
 
-    for ( int iE = 0; iE < myEdges.size(); ++iE )
+    for ( size_t iE = 0; iE < myEdges.size(); ++iE )
     {
       EdgeData& eData = myEdges[ iE ];
 
@@ -1260,7 +1260,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
         double maxSegSize = 0;
 
         // get points to check distance to the face
-        EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++, pItLast;
+        EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++;
         maxSegSize = pIt1->mySegSize = Min( pIt1->mySegSize, sizeTree.GetSize( pIt1->myP ));
         for ( ; pIt2 != eData.myPoints.end(); )
         {
@@ -1290,7 +1290,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
         //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
         sizeDecreased = false;
         const gp_Pnt* avoidPnt = & eData.First().myP;
-        pItLast = --eData.myPoints.end();
+        EdgeData::TPntIter pItLast = --eData.myPoints.end(), pItFirst = eData.myPoints.begin();
         for ( pIt1 = eData.myPoints.begin(); pIt1 != eData.myPoints.end();  )
         {
           double distToFace =
@@ -1308,19 +1308,16 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
               //      << "\t SetSize " << allowedSize << " at "
               //      << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<<pIt1->myP.Z() << endl;
               pIt2 = pIt1;
-              if ( --pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize )
+              if ( pIt1 != pItFirst && ( --pIt2 )->mySegSize > allowedSize )
                 sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
               pIt2 = pIt1;
-              if ( ++pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize )
+              if ( pIt1 != pItLast  && ( ++pIt2 )->mySegSize > allowedSize )
                 sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
             }
             pIt1->mySegSize = allowedSize;
           }
           ++pIt1;
-          if ( pIt1 == pItLast )
-            avoidPnt = & eData.Last().myP;
-          else
-            avoidPnt = NULL;
+          avoidPnt = ( pIt1 == pItLast ) ? & eData.Last().myP : NULL;
 
           if ( iLoop > 20 )
           {
@@ -1357,7 +1354,7 @@ bool AdaptiveAlgo::makeSegments()
 
   vector< double > nbSegs, params;
 
-  for ( int iE = 0; iE < myEdges.size(); ++iE )
+  for ( size_t iE = 0; iE < myEdges.size(); ++iE )
   {
     EdgeData& eData = myEdges[ iE ];
 
@@ -1368,13 +1365,13 @@ bool AdaptiveAlgo::makeSegments()
       edgeMinSize = Min( edgeMinSize,
                          Min( pIt1->mySegSize, mySizeTree->GetSize( pIt1->myP )));
 
-    const double f = eData.myC3d.FirstParameter(), l = eData.myC3d.LastParameter();
+    const double      f = eData.myC3d.FirstParameter(), l = eData.myC3d.LastParameter();
     const double parLen = l - f;
     const int  nbDivSeg = 5;
-    int           nbDiv = Max( 1, int ( eData.myLength / edgeMinSize * nbDivSeg ));
+    size_t        nbDiv = Max( 1, int ( eData.myLength / edgeMinSize * nbDivSeg ));
 
     // compute nb of segments
-    bool toRecompute = true;
+    bool  toRecompute = true;
     double maxSegSize = 0;
     size_t i = 1, segCount;
     //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
@@ -1432,7 +1429,7 @@ bool AdaptiveAlgo::makeSegments()
     }
 
     // compute parameters of nodes
-    int nbSegFinal = Max( 1, int(floor( nbSegs.back() + 0.5 )));
+    size_t nbSegFinal = Max( 1, int(floor( nbSegs.back() + 0.5 )));
     double fact = nbSegFinal / nbSegs.back();
     if ( maxSegSize / fact > myHyp->GetMaxSize() )
       fact = ++nbSegFinal / nbSegs.back();
@@ -1505,7 +1502,7 @@ bool AdaptiveAlgo::Evaluate(SMESH_Mesh &         theMesh,
 
   for ( ; edExp.More(); edExp.Next() )
   {
-    const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
+    //const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
     StdMeshers_Regular_1D::Evaluate( theMesh, theShape, theResMap );
   }
   return true;
index 3bf1f1be551165700dbd8d28a2bbd99915d799a7..deabddb71037f2bd1c802e22587dff7aa05f1b87 100644 (file)
@@ -144,22 +144,22 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load)
 {
   bool isOK = true;
   int intVal;
-  isOK = (load >> _begLength);
+  isOK = static_cast<bool>(load >> _begLength);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
-  isOK = (load >> _endLength);
+  isOK = static_cast<bool>(load >> _endLength);
 
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
 
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if (isOK && intVal > 0) {
     _edgeIDs.reserve( intVal );
-    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+    for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _edgeIDs.push_back( intVal );
     }
-    isOK = (load >> _objEntry);
+    isOK = static_cast<bool>(load >> _objEntry);
   }
 
   return load;
@@ -167,7 +167,7 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
index 5b03b484a75ab6345fee5204586520b66322900c..7226e4beb656deae5ac2a67643e58d55a33c4a9e 100644 (file)
@@ -240,6 +240,7 @@ bool StdMeshers_CartesianParameters3D::GetFixedPoint(double p[3]) const
   if ( Precision::IsInfinite( _fixedPoint[0] ))
     return false;
   std::copy( &_fixedPoint[0], &_fixedPoint[0]+3, &p[0] );
+  return true;
 }
 
 
@@ -371,7 +372,7 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double    x0,
   // correct coords if a forced point is too close to a neighbor node
   if ( forced )
   {
-    int iF = 0;
+    size_t iF = 0;
     double minLen = ( x1 - x0 );
     for ( size_t i = 1; i < coords.size(); ++i )
     {
@@ -522,9 +523,8 @@ ComputeOptimalAxesDirs(const TopoDS_Shape& shape,
   const TCooTriple*           norm1 = 0;
   double                      sumArea = 0;
   vector< const TCooTriple* > norms;
-  for ( int iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF )
+  for ( size_t iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF )
   {
-
     if ( !norm1 || !sameDir( *norm1, norm2a->first ))
     {
       if ( !norms.empty() )
@@ -799,51 +799,51 @@ std::istream & StdMeshers_CartesianParameters3D::LoadFrom(std::istream & load)
 {
   bool ok;
 
-  ok = ( load >> _sizeThreshold );
+  ok = static_cast<bool>( load >> _sizeThreshold );
   for ( int ax = 0; ax < 3; ++ax )
   {
     if (ok)
     {
       size_t i = 0;
-      ok = (load >> i  );
+      ok = static_cast<bool>(load >> i  );
       if ( i > 0 && ok )
       {
         _coords[ax].resize( i );
         for ( i = 0; i < _coords[ax].size() && ok; ++i )
-          ok = (load >> _coords[ax][i]  );
+          ok = static_cast<bool>(load >> _coords[ax][i]  );
       }
     }
     if (ok)
     {
       size_t i = 0;
-      ok = (load >> i  );
+      ok = static_cast<bool>(load >> i  );
       if ( i > 0 && ok )
       {
         _internalPoints[ax].resize( i );
         for ( i = 0; i < _internalPoints[ax].size() && ok; ++i )
-          ok = (load >> _internalPoints[ax][i]  );
+          ok = static_cast<bool>(load >> _internalPoints[ax][i]  );
       }
     }
     if (ok)
     {
       size_t i = 0;
-      ok = (load >> i  );
+      ok = static_cast<bool>(load >> i  );
       if ( i > 0 && ok )
       {
         _spaceFunctions[ax].resize( i );
         for ( i = 0; i < _spaceFunctions[ax].size() && ok; ++i )
-          ok = (load >> _spaceFunctions[ax][i]  );
+          ok = static_cast<bool>(load >> _spaceFunctions[ax][i]  );
       }
     }
   }
 
-  ok = ( load >> _toAddEdges );
+  ok = static_cast<bool>( load >> _toAddEdges );
 
   for ( int i = 0; i < 9 && ok; ++i )
-    ok = ( load >> _axisDirs[i]);
+    ok = static_cast<bool>( load >> _axisDirs[i]);
 
   for ( int i = 0; i < 3 && ok ; ++i )
-    ok = ( load >> _fixedPoint[i]);
+    ok = static_cast<bool>( load >> _fixedPoint[i]);
 
   return load;
 }
index 139257213412620166fa323e5e133f4dc9e4e9cd..b896de3b62f0ec672de68392e88335d9d0305fc5 100644 (file)
@@ -696,17 +696,17 @@ namespace
                            int& di, double tol )
   {
     //val += values[0]; // input \a val is measured from 0.
-    if ( i > values.size()-2 )
+    if ( i > (int) values.size()-2 )
       i = values.size()-2;
     else
-      while ( i+2 < values.size() && val > values[ i+1 ])
+      while ( i+2 < (int) values.size() && val > values[ i+1 ])
         ++i;
     while ( i > 0 && val < values[ i ])
       --i;
 
     if ( i > 0 && val - values[ i ] < tol )
       di = -1;
-    else if ( i+2 < values.size() && values[ i+1 ] - val < tol )
+    else if ( i+2 < (int) values.size() && values[ i+1 ] - val < tol )
       di = 1;
     else
       di = 0;
@@ -1776,7 +1776,7 @@ namespace
         if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon ))
           quad._eIntNodes[ iP ]->_usedInFace = 0;
 #endif
-      int nbUsedEdgeNodes = 0;
+      size_t nbUsedEdgeNodes = 0;
       _Face* prevPolyg = 0; // polygon previously created from this quad
 
       while ( nbSplits > 0 )
@@ -1839,7 +1839,7 @@ namespace
             else
             {
               _OrientedLink foundSplit;
-              for ( int i = iS; i < splits.size() && !foundSplit; ++i )
+              for ( size_t i = iS; i < splits.size() && !foundSplit; ++i )
                 if (( foundSplit = splits[ i ]) &&
                     ( n2->IsLinked( foundSplit.FirstNode()->_intPoint )))
                 {
@@ -2100,7 +2100,7 @@ namespace
             {
               sortVertexNodes( chainNodes, curNode, curFace );
             }
-            for ( int i = 0; i < chainNodes.size(); ++i )
+            for ( size_t i = 0; i < chainNodes.size(); ++i )
             {
               polygon.AddPolyLink( chainNodes[ i ], curNode );
               curNode = chainNodes[ i ];
@@ -2322,9 +2322,9 @@ namespace
             i = int(lineInd.I()) + dInd[iL][0];
             j = int(lineInd.J()) + dInd[iL][1];
             k = int(lineInd.K()) + dInd[iL][2];
-            if ( i < 0 || i >= nbCells[0] ||
-                 j < 0 || j >= nbCells[1] ||
-                 k < 0 || k >= nbCells[2] ) continue;
+            if ( i < 0 || i >= (int) nbCells[0] ||
+                 j < 0 || j >= (int) nbCells[1] ||
+                 k < 0 || k >= (int) nbCells[2] ) continue;
 
             const size_t hexIndex = _grid->CellIndex( i,j,k );
             Hexahedron *& hex = allHexa[ hexIndex ];
@@ -2436,7 +2436,7 @@ namespace
         planes._zProjs [0] = 0;
         const double       zFactor = _grid->_axes[ iDirZ ] * planes._zNorm;
         const vector< double > & u = _grid->_coords[ iDirZ ];
-        for ( int i = 1; i < planes._zProjs.size(); ++i )
+        for ( size_t i = 1; i < planes._zProjs.size(); ++i )
         {
           planes._zProjs [i] = zFactor * ( u[i] - u[0] );
         }
@@ -2731,7 +2731,7 @@ namespace
              chn.back()->IsLinked( quad._eIntNodes[ iP ]->_intPoint ))
         {
           chn.push_back( quad._eIntNodes[ iP ]);
-          found = quad._eIntNodes[ iP ]->_usedInFace = &quad;
+          found = ( quad._eIntNodes[ iP ]->_usedInFace = &quad );
           break;
         }
     } while ( found && ! chn.back()->IsLinked( n2->_intPoint ) );
@@ -2823,7 +2823,7 @@ namespace
               ( !avoidFace || quad._eIntNodes[ iP ]->IsOnFace( avoidFace )))
           {
             chn.push_back( quad._eIntNodes[ iP ]);
-            found = quad._eIntNodes[ iP ]->_usedInFace = &quad;
+            found = ( quad._eIntNodes[ iP ]->_usedInFace = &quad );
             break;
           }
       } while ( found );
@@ -2870,7 +2870,7 @@ namespace
   {
     bool isOut = false;
 
-    const bool moreIntPoints = ( iP+1 < link._fIntPoints.size() );
+    const bool moreIntPoints = ( iP+1 < (int) link._fIntPoints.size() );
 
     // get 2 _Node's
     _Node* n1 = link._fIntNodes[ iP ];
@@ -3049,7 +3049,7 @@ namespace
     // sort nodes accoring to the order of edges
     _Node*  orderNodes   [20];
     TGeomID orderShapeIDs[20];
-    int nbN = 0;
+    size_t nbN = 0;
     TGeomID id, *pID;
     for ( e = edges.begin(); e != edges.end(); ++e )
     {
@@ -3135,7 +3135,7 @@ namespace
     if ( !_vIntNodes.empty() )
       return false;
 
-    const int ijk[3] = { _i, _j, _k };
+    const size_t ijk[3] = { _i, _j, _k };
     F_IntersectPoint curIntPnt;
 
     // consider a cell to be in a hole if all links in any direction
@@ -3536,7 +3536,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh &         theMesh,
     map< TGeomID, vector< TGeomID > > edge2faceIDsMap;
     TopExp_Explorer eExp;
     Bnd_Box shapeBox;
-    for ( int i = 0; i < faceVec.size(); ++i )
+    for ( size_t i = 0; i < faceVec.size(); ++i )
     {
       facesItersectors[i]._face   = TopoDS::Face    ( faceVec[i] );
       facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] );
index 7c9dca548a82d1b0f12bd63bec0590e07ca3ecf1..e59c60886e9b2b4a4b78638f312319d48f0e99b0 100644 (file)
 #include <set>
 #include <vector>
 
+using namespace std;
 
 #ifdef _DEBUG_
 // #define DEB_FACES
 // #define DEB_GRID
-// #define DUMP_VERT(msg,V) \
-//   { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v);                  \
-//     cout << msg << "( "<< p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;}
+// #define DUMP_VERT(msg,V) { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); cout << msg << "( "<< p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl; }
 #endif
 
 #ifndef DUMP_VERT
@@ -80,6 +79,8 @@ enum EQuadSides{ Q_BOTTOM=0, Q_RIGHT, Q_TOP, Q_LEFT,   Q_CHILD, Q_PARENT };
 
 enum EBoxSides{ B_BOTTOM=0, B_RIGHT, B_TOP, B_LEFT, B_FRONT, B_BACK, B_UNDEFINED };
 
+enum EAxes{ COO_X=1, COO_Y, COO_Z };
+
 //================================================================================
 /*!
  * \brief Convertor of a pair of integers to a sole index
@@ -159,7 +160,7 @@ public: //** Methods to find and orient faces of 6 sides of the box **//
   _QuadFaceGrid* FindAdjacentForSide(int i, list<_QuadFaceGrid>& faces, EBoxSides id) const;
 
   //!< Reverse edges in order to have the bottom edge going along axes of the unit box
-  void ReverseEdges(/*int e1, int e2*/);
+  void ReverseEdges();
 
   bool IsComplex() const { return !myChildren.empty(); }
 
@@ -179,6 +180,9 @@ public: //** Loading and access to mesh **//
   //!< Load nodes of a mesh
   bool LoadGrid( SMESH_Mesh& mesh );
 
+  //!< Computes normalized parameters of nodes of myGrid
+  void ComputeIJK( int i1, int i2, double v3 );
+
   //!< Return number of segments on the hirizontal sides
   int GetNbHoriSegments(SMESH_Mesh& mesh, bool withBrothers=false) const;
 
@@ -194,6 +198,9 @@ public: //** Loading and access to mesh **//
   //!< Return node coordinates by its position
   gp_XYZ GetXYZ(int iHori, int iVert) const;
 
+  //!< Return normalized parameters of nodes within the unitary cube
+  gp_XYZ& GetIJK(int iCol, int iRow) { return myIJK[ myIndexer( iCol, iRow )]; }
+
 public: //** Access to member fields **//
 
   //!< Return i-th face side (0<i<4)
@@ -243,8 +250,9 @@ private:
   _QuadFaceGrid* myRightBrother;
   _QuadFaceGrid* myUpBrother;
 
-  _Indexer    myIndexer;
+  _Indexer                      myIndexer;
   vector<const SMDS_MeshNode*>  myGrid;
+  vector<gp_XYZ>                myIJK; // normalized parameters of nodes
 
   SMESH_ComputeErrorPtr         myError;
 
@@ -592,6 +600,14 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh&         theMesh,
   if ( !fRight ->LoadGrid( theMesh )) return error( fRight ->GetError() );
   if ( !fTop   ->LoadGrid( theMesh )) return error( fTop   ->GetError() );
 
+  // compute normalized parameters of nodes on sides (PAL23189)
+  fBottom->ComputeIJK( COO_X, COO_Y, /*z=*/0. );
+  fBack  ->ComputeIJK( COO_X, COO_Z, /*y=*/1. );
+  fLeft  ->ComputeIJK( COO_Y, COO_Z, /*x=*/0. );
+  fFront ->ComputeIJK( COO_X, COO_Z, /*y=*/0. );
+  fRight ->ComputeIJK( COO_Y, COO_Z, /*x=*/1. );
+  fTop   ->ComputeIJK( COO_X, COO_Y, /*z=*/1. );
+
   int x, xSize = fBottom->GetNbHoriSegments(theMesh) + 1, X = xSize - 1;
   int y, ySize = fBottom->GetNbVertSegments(theMesh) + 1, Y = ySize - 1;
   int z, zSize = fFront ->GetNbVertSegments(theMesh) + 1, Z = zSize - 1;
@@ -647,13 +663,14 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh&         theMesh,
   pointsOnShapes[ SMESH_Block::ID_V011 ] = fTop->GetXYZ( 0, Y );
   pointsOnShapes[ SMESH_Block::ID_V111 ] = fTop->GetXYZ( X, Y );
 
+  gp_XYZ params; // normalized parameters of an internal node within the unit box
+
   for ( x = 1; x < xSize-1; ++x )
   {
-    gp_XYZ params; // normalized parameters of internal node within a unit box
-    params.SetCoord( 1, x / double(X) );
+    const double rX = x / double(X);
     for ( y = 1; y < ySize-1; ++y )
     {
-      params.SetCoord( 2, y / double(Y) );
+      const double rY = y / double(Y);
       // column to fill during z loop
       vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )];
       // points projections on horizontal edges
@@ -670,14 +687,28 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh&         theMesh,
       pointsOnShapes[ SMESH_Block::ID_Fxy1 ] = fTop   ->GetXYZ( x, y );
       for ( z = 1; z < zSize-1; ++z ) // z loop
       {
-        params.SetCoord( 3, z / double(Z) );
+        // compute normalized parameters of an internal node within the unit box
+        const double   rZ = z / double(Z);
+        const gp_XYZ& pBo = fBottom->GetIJK( x, y );
+        const gp_XYZ& pTo = fTop   ->GetIJK( x, y );
+        const gp_XYZ& pFr = fFront ->GetIJK( x, z );
+        const gp_XYZ& pBa = fBack  ->GetIJK( x, z );
+        const gp_XYZ& pLe = fLeft  ->GetIJK( y, z );
+        const gp_XYZ& pRi = fRight ->GetIJK( y, z );
+        params.SetCoord( 1, 0.5 * ( pBo.X() * ( 1. - rZ ) + pTo.X() * rZ  +
+                                    pFr.X() * ( 1. - rY ) + pBa.X() * rY ));
+        params.SetCoord( 2, 0.5 * ( pBo.Y() * ( 1. - rZ ) + pTo.Y() * rZ  +
+                                    pLe.Y() * ( 1. - rX ) + pRi.Y() * rX ));
+        params.SetCoord( 3, 0.5 * ( pFr.Z() * ( 1. - rY ) + pBa.Z() * rY  +
+                                    pLe.Z() * ( 1. - rX ) + pRi.Z() * rX ));
+
         // point projections on vertical edges
-        pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z );    
-        pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z );    
-        pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z );    
+        pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z );
+        pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z );
+        pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z );
         pointsOnShapes[ SMESH_Block::ID_E11z ] = fBack->GetXYZ( X, z );
         // point projections on vertical faces
-        pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z );    
+        pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z );
         pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z );    
         pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z );    
         pointsOnShapes[ SMESH_Block::ID_F1yz ] = fRight->GetXYZ( y, z );
@@ -899,7 +930,7 @@ bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid&       other,
   {
     const _FaceSide& otherSide = other.GetSide( i );
     int iMyCommon;
-    if ( mySides.Contain( otherSide, &iMyCommon ) )
+    if ( mySides.Contain( otherSide, &iMyCommon ))
     {
       if ( internalEdges.Contains( otherSide.Edge( 0 )))
       {
@@ -907,13 +938,23 @@ bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid&       other,
         DUMP_VERT("Cont 2", mySides.GetSide(iMyCommon)->LastVertex());
         DUMP_VERT("Cont 3", otherSide.FirstVertex());
         DUMP_VERT("Cont 4", otherSide.LastVertex());
-        if ( myChildren.empty() ) {
+
+        if ( myChildren.empty() )
+        {
           myChildren.push_back( *this );
           myFace.Nullify();
         }
+        else // find iMyCommon in myChildren
+        {
+          for ( TChildIterator children = GetChildren(); children.more(); ) {
+            const _QuadFaceGrid& child = children.next();
+            if ( child.mySides.Contain( otherSide, &iMyCommon ))
+              break;
+          }
+        }
 
         // orient new children equally
-        int otherBottomIndex = ( 4 + i - iMyCommon + 2 ) % 4;
+        int otherBottomIndex = SMESH_MesherHelper::WrapIndex( i - iMyCommon + 2, 4 );
         if ( other.IsComplex() )
           for ( TChildIterator children = other.GetChildren(); children.more(); ) {
             myChildren.push_back( children.next() );
@@ -930,7 +971,7 @@ bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid&       other,
         if ( other.IsComplex() )
           for ( TChildIterator children = other.GetChildren(); children.more(); )
           {
-            const _QuadFaceGrid& child =  children.next();
+            const _QuadFaceGrid& child = children.next();
             for ( int i = 0; i < 4; ++i )
               mySides.AppendSide( child.GetSide(i) );
           }
@@ -972,9 +1013,9 @@ bool _QuadFaceGrid::SetBottomSide(const _FaceSide& bottom, int* sideIndex)
     {
       if ( childFace->SetBottomSide( bottom, &myBottomIndex ))
       {
-        TChildren::iterator orientedCild = childFace;
+        TChildren::iterator orientedChild = childFace;
         for ( childFace = myChildren.begin(); childFace != childEnd; ++childFace ) {
-          if ( childFace != orientedCild )
+          if ( childFace != orientedChild )
             childFace->SetBottomSide( childFace->GetSide( myBottomIndex ));
         }
         if ( sideIndex )
@@ -1046,7 +1087,7 @@ const _FaceSide& _QuadFaceGrid::GetSide(int i) const
  */
 //================================================================================
 
-void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/)
+void _QuadFaceGrid::ReverseEdges()
 {
   myReverse = !myReverse;
 
@@ -1057,8 +1098,6 @@ void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/)
 
   if ( myChildren.empty() )
   {
-//     mySides.GetSide( e1 )->Reverse();
-//     mySides.GetSide( e2 )->Reverse();
     DumpVertices();
   }
   else
@@ -1066,7 +1105,7 @@ void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/)
     DumpVertices();
     TChildren::iterator child = myChildren.begin(), childEnd = myChildren.end();
     for ( ; child != childEnd; ++child )
-      child->ReverseEdges( /*e1, e2*/ );
+      child->ReverseEdges();
   }
 }
 
@@ -1118,7 +1157,7 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
   TIDSortedElemSet emptySet, avoidSet;
   const SMDS_MeshElement* firstQuad = 0; // most left face above the last row of found nodes
 
-  int nbFoundNodes = myIndexer._xSize;
+  size_t nbFoundNodes = myIndexer._xSize;
   while ( nbFoundNodes != myGrid.size() )
   {
     // first and last nodes of the last filled row of nodes
@@ -1187,6 +1226,53 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief Fill myIJK with normalized parameters of nodes in myGrid
+ *  \param [in] i1 - coordinate index along rows of myGrid
+ *  \param [in] i2 - coordinate index along columns of myGrid
+ *  \param [in] v3 - value of the constant parameter
+ */
+//================================================================================
+
+void _QuadFaceGrid::ComputeIJK( int i1, int i2, double v3 )
+{
+  gp_XYZ ijk( v3, v3, v3 );
+  myIJK.resize( myIndexer.size(), ijk );
+
+  const size_t nbCol = myIndexer._xSize;
+  const size_t nbRow = myIndexer._ySize;
+
+  vector< double > len( nbRow );
+  len[0] = 0;
+  for ( size_t i = 0; i < nbCol; ++i )
+  {
+    gp_Pnt pPrev = GetXYZ( i, 0 );
+    for ( size_t j = 1; j < nbRow; ++j )
+    {
+      gp_Pnt p = GetXYZ( i, j );
+      len[ j ] = len[ j-1 ] + p.Distance( pPrev );
+      pPrev = p;
+    }
+    for ( size_t j = 0; j < nbRow; ++j )
+      GetIJK( i, j ).SetCoord( i2, len[ j ]/len.back() );
+  }
+
+  len.resize( nbCol );
+  for ( size_t j = 0; j < nbRow; ++j )
+  {
+    gp_Pnt pPrev = GetXYZ( 0, j );
+    for ( size_t i = 1; i < nbCol; ++i )
+    {
+      gp_Pnt p = GetXYZ( i, j );
+      len[ i ] = len[ i-1 ] + p.Distance( pPrev );
+      pPrev = p;
+    }
+    for ( size_t i = 0; i < nbCol; ++i )
+      GetIJK( i, j ).SetCoord( i1, len[ i ]/len.back() );
+  }
+}
+
 //================================================================================
 /*!
  * \brief Find out mutual location of children: find their right and up brothers
@@ -1443,8 +1529,8 @@ const SMDS_MeshNode* _QuadFaceGrid::GetNode(int iHori, int iVert) const
 
 gp_XYZ _QuadFaceGrid::GetXYZ(int iHori, int iVert) const
 {
-  const SMDS_MeshNode* n = myGrid[ myIndexer( iHori, iVert )];
-  return gp_XYZ( n->X(), n->Y(), n->Z() );
+  SMESH_TNodeXYZ xyz = myGrid[ myIndexer( iHori, iVert )];
+  return xyz;
 }
 
 //================================================================================
@@ -1595,8 +1681,6 @@ _FaceSide::_FaceSide(const list<TopoDS_Edge>& edges):
   for ( ; edge != eEnd; ++edge ) {
     myChildren.push_back( _FaceSide( *edge ));
     myNbChildren++;
-//     myVertices.insert( myChildren.back().myVertices.begin(),
-//                        myChildren.back().myVertices.end() );
     myVertices.Add( myChildren.back().FirstVertex() );
     myVertices.Add( myChildren.back().LastVertex() );
     myChildren.back().SetID( Q_CHILD ); // not to splice them
@@ -1605,7 +1689,7 @@ _FaceSide::_FaceSide(const list<TopoDS_Edge>& edges):
 
 //=======================================================================
 //function : GetSide
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 _FaceSide* _FaceSide::GetSide(const int i)
index 5545f781a7ff9655a4e5f882176ca84cefde6780..ac251c03dd970d3792c360f7ca531add41e4b628 100644 (file)
@@ -57,15 +57,15 @@ public:
 
 private:
 
-  bool findBoxFaces( const TopoDS_Shape&    shape,
-                     list< _QuadFaceGrid >& boxFaceContainer,
-                     SMESH_Mesh&            mesh,
-                     _QuadFaceGrid * &      fBottom,
-                     _QuadFaceGrid * &      fTop,
-                     _QuadFaceGrid * &      fFront,
-                     _QuadFaceGrid * &      fBack,
-                     _QuadFaceGrid * &      fLeft,
-                     _QuadFaceGrid * &      fRight);
+  bool findBoxFaces( const TopoDS_Shape&         shape,
+                     std::list< _QuadFaceGrid >& boxFaceContainer,
+                     SMESH_Mesh&                 mesh,
+                     _QuadFaceGrid * &           fBottom,
+                     _QuadFaceGrid * &           fTop,
+                     _QuadFaceGrid * &           fFront,
+                     _QuadFaceGrid * &           fBack,
+                     _QuadFaceGrid * &           fLeft,
+                     _QuadFaceGrid * &           fRight);
 };
 
 #endif
index 53e6d1c3ff9d3a6198d81ad9759fb2f6ccd47f60..bc1516f5b8d36198b6138aad3adaa3f58f06c56a 100644 (file)
 //  Module : SMESH
 //
 #include "StdMeshers_CompositeSegment_1D.hxx"
-#include "StdMeshers_FaceSide.hxx"
-#include "StdMeshers_AutomaticLength.hxx"
 
+#include "SMDS_MeshElement.hxx"
+#include "SMDS_MeshNode.hxx"
+#include "SMESH_Comment.hxx"
 #include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
 #include "SMESH_HypoFilter.hxx"
+#include "SMESH_Mesh.hxx"
+#include "SMESH_TypeDefs.hxx"
 #include "SMESH_subMesh.hxx"
 #include "SMESH_subMeshEventListener.hxx"
-#include "SMESH_Comment.hxx"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
+#include "StdMeshers_AutomaticLength.hxx"
+#include "StdMeshers_FaceSide.hxx"
 
 #include "utilities.h"
 
@@ -173,7 +173,7 @@ namespace {
               // check if an edge is a part of a complex side
               TopoDS_Face face;
               TopoDS_Edge edge = TopoDS::Edge( subMesh->GetSubShape() );
-              auto_ptr< StdMeshers_FaceSide > side
+              SMESHUtils::Deleter< StdMeshers_FaceSide > side
                 ( StdMeshers_CompositeSegment_1D::GetFaceSide(*subMesh->GetFather(),
                                                               edge, face, false ));
               if ( side->NbEdges() > 1 && side->NbSegments() )
@@ -287,21 +287,21 @@ void StdMeshers_CompositeSegment_1D::SetEventListener(SMESH_subMesh* subMesh)
     // check if an edge is a part of a complex side
     TopoDS_Face face;
     TopoDS_Edge edge = TopoDS::Edge( subMesh->GetSubShape() );
-    auto_ptr< StdMeshers_FaceSide > side
-      ( StdMeshers_CompositeSegment_1D::GetFaceSide(*subMesh->GetFather(),edge, face, false ));
+    SMESHUtils::Deleter< StdMeshers_FaceSide > side
+      ( StdMeshers_CompositeSegment_1D::GetFaceSide( *subMesh->GetFather(), edge, face, false ));
     if ( side->NbEdges() > 1 ) { // complex
 
       // set _alwaysComputed to vertices
       for ( int iE = 1; iE < side->NbEdges(); ++iE )
       {
-        TopoDS_Vertex V = side->FirstVertex( iE );
+        TopoDS_Vertex   V = side->FirstVertex( iE );
         SMESH_subMesh* sm = side->GetMesh()->GetSubMesh( V );
         sm->SetIsAlwaysComputed( true );
       }
     }
   }
   // set listener that will remove _alwaysComputed from submeshes at algorithm change
-  subMesh->SetEventListener( new VertexNodesRestoringListener(), 0, subMesh);
+  subMesh->SetEventListener( new VertexNodesRestoringListener(), 0, subMesh );
   StdMeshers_Regular_1D::SetEventListener( subMesh );
 }
 
@@ -368,7 +368,7 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh &         aMesh,
 
   // Get edges to be discretized as a whole
   TopoDS_Face nullFace;
-  auto_ptr< StdMeshers_FaceSide > side( GetFaceSide(aMesh, edge, nullFace, true ));
+  SMESHUtils::Deleter< StdMeshers_FaceSide > side( GetFaceSide(aMesh, edge, nullFace, true ));
   //side->dump("IN COMPOSITE SEG");
 
   if ( side->NbEdges() < 2 )
@@ -384,7 +384,7 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh &         aMesh,
   }
 
   // Compute node parameters
-  auto_ptr< BRepAdaptor_CompCurve > C3d ( side->GetCurve3d() );
+  SMESHUtils::Deleter< BRepAdaptor_CompCurve > C3d ( side->GetCurve3d() );
   double f = C3d->FirstParameter(), l = C3d->LastParameter();
   list< double > params;
   if ( !computeInternalParameters ( aMesh, *C3d, side->Length(), f, l, params, false ))
index 5d2cfe8899e40f96203a35583a6d51f4a61d6f2b..d2bc5501cbe047c592be4aa451a151976e87dfe6 100644 (file)
@@ -119,7 +119,7 @@ ostream & StdMeshers_Deflection1D::SaveTo(ostream & save)
 
 istream & StdMeshers_Deflection1D::LoadFrom(istream & load)
 {
-  bool isOK = (load >> _value);
+  bool isOK = static_cast<bool>(load >> _value);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
   return load;
@@ -212,7 +212,7 @@ bool StdMeshers_Deflection1D::SetParametersByMesh(const SMESH_Mesh*   theMesh,
       if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
       {
         nbEdges++;
-        for ( int i = 1; i < params.size(); ++i )
+        for ( size_t i = 1; i < params.size(); ++i )
           _value = Max( _value, deflection( AdaptCurve, params[ i-1 ], params[ i ]));
       }
     }
index 455f82baeb9c78cade280b6f710ffbf322c36920..574466cc7ef1ba00de342a8b69f53ff2d9c32f5b 100644 (file)
@@ -132,8 +132,8 @@ bool FunctionTable::value( const double t, double& f ) const
 
 double FunctionTable::integral( const int i ) const
 {
-  if( i>=0 && i<myData.size()-1 )
-    return integral( i, myData[2*(i+1)]-myData[2*i] );
+  if ( i >= 0  &&  i < (int)myData.size()-1 )
+    return integral( i, myData[2*(i+1)] - myData[2*i] );
   else
     return 0;
 }
index 2625b9fb1322eab64c256b743d3c76a64c076069..d0c2589365774ee35475a4941d080bb644a96508 100644 (file)
@@ -56,6 +56,8 @@
 
 #include "utilities.h"
 
+using namespace std;
+
 //================================================================================
 /*!
  * \brief Constructor of a side of one edge
@@ -71,7 +73,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&   theFace,
                                          const bool           theIgnoreMediumNodes,
                                          SMESH_ProxyMesh::Ptr theProxyMesh)
 {
-  list<TopoDS_Edge> edges(1,theEdge);
+  std::list<TopoDS_Edge> edges(1,theEdge);
   *this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward,
                                theIgnoreMediumNodes, theProxyMesh );
 }
@@ -82,12 +84,12 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&   theFace,
  */
 //================================================================================
 
-StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&   theFace,
-                                         list<TopoDS_Edge>&   theEdges,
-                                         SMESH_Mesh*          theMesh,
-                                         const bool           theIsForward,
-                                         const bool           theIgnoreMediumNodes,
-                                         SMESH_ProxyMesh::Ptr theProxyMesh)
+StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&      theFace,
+                                         std::list<TopoDS_Edge>& theEdges,
+                                         SMESH_Mesh*             theMesh,
+                                         const bool              theIsForward,
+                                         const bool              theIgnoreMediumNodes,
+                                         SMESH_ProxyMesh::Ptr    theProxyMesh)
 {
   int nbEdges = theEdges.size();
   myEdge.resize      ( nbEdges );
@@ -112,7 +114,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face&   theFace,
   SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
 
   int nbDegen = 0;
-  list<TopoDS_Edge>::iterator edge = theEdges.begin();
+  std::list<TopoDS_Edge>::iterator edge = theEdges.begin();
   for ( int index = 0; edge != theEdges.end(); ++index, ++edge )
   {
     int i = theIsForward ? index : nbEdges-index-1;
@@ -302,22 +304,22 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec&     theSideNodes,
  */
 //================================================================================
 
-const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
-                                                             double constValue) const
+const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
+                                                                  double constValue) const
 {
   if ( myPoints.empty() )
   {
     if ( NbEdges() == 0 ) return myPoints;
 
     StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
-    SMESHDS_Mesh*    meshDS = myProxyMesh->GetMeshDS();
+    //SMESHDS_Mesh*    meshDS = myProxyMesh->GetMeshDS();
     SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
     SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
     fHelper.SetSubShape( myFace );
     bool paramOK;
     double eps = 1e-100;
 
-    // sort nodes of all edges putting them into a map
+    // sort nodes of all edges by putting them into a map
 
     map< double, const SMDS_MeshNode*>            u2node;
     vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
@@ -428,8 +430,8 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
       u2node.insert( u2node.end(), make_pair( 1., node ));
     }
 
-    if ( u2node.size() + nbProxyNodes != myNbPonits &&
-         u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
+    if ((int) u2node.size() + nbProxyNodes != myNbPonits &&
+        (int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
     {
       MESSAGE("Wrong node parameters on edges, u2node.size():"
               <<u2node.size()<<" !=  myNbPonits:"<<myNbPonits);
@@ -513,9 +515,9 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
 
     // set <constValue>
     if ( isXConst )
-      for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].x = constValue;
+      for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].x = constValue;
     else
-      for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].y = constValue;
+      for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].y = constValue;
 
   } // if ( myPoints.empty())
 
@@ -543,7 +545,7 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::SimulateUVPtStruct(int    nbSeg,
 
     int EdgeIndex = 0;
     double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ];
-    for (int i = 0 ; i < myFalsePoints.size(); ++i ) {
+    for ( size_t i = 0 ; i < myFalsePoints.size(); ++i ) {
       double normPar = double(i) / double(nbSeg);
       UVPtStruct & uvPt = (*points)[i];
       uvPt.node = 0;
@@ -582,7 +584,7 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes(int theEd
   {
     if ( NbEdges() == 0 ) return resultNodes;
 
-    SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
+    //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
     SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
     SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
     fHelper.SetSubShape( myFace );
@@ -682,8 +684,8 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes(int theEd
     // Fill the result vector
 
     if ( theEdgeInd < 0 &&
-         u2node.size() != myNbPonits &&
-         u2node.size() != NbPoints( /*update=*/true ))
+         (int) u2node.size() != myNbPonits &&
+         (int) u2node.size() != NbPoints( /*update=*/true ))
     {
       u2node.clear();
     }
@@ -810,7 +812,7 @@ const SMDS_MeshNode* StdMeshers_FaceSide::VertexNode(std::size_t i, bool* isMove
     n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false );
 
     if (( !n ) &&
-        (( i > 0 && i < NbEdges() ) || IsClosed() ))
+        (( i > 0 && (int) i < NbEdges() ) || IsClosed() ))
     {
       iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() );
       sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]);
@@ -1051,7 +1053,7 @@ void StdMeshers_FaceSide::dump(const char* msg) const
   if (msg) MESSAGE ( std::endl << msg );
   MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
   MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
-  for ( int i=0; i<myEdge.size(); ++i)
+  for ( size_t i = 0; i < myEdge.size(); ++i )
   {
     MESSAGE_ADD ( "\t"<<i+1 );
     MESSAGE_ADD ( "\tEDGE: " );
@@ -1061,17 +1063,17 @@ void StdMeshers_FaceSide::dump(const char* msg) const
     else {
       TopAbs::Print(myEdge[i].Orientation(),cout)<<" "<<myEdge[i].TShape().operator->()<<endl;
       MESSAGE_ADD ( "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
-                 << "  V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
+                    << "  V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
     }
     MESSAGE_ADD ( "\tC2d: ");
-    
+
     if (myC2d[i].IsNull()) {
       MESSAGE_ADD ( "NULL" );
     }
     else {
       MESSAGE_ADD ( myC2d[i].operator->() );
     }
-      
+
     MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
     MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
   }
@@ -1113,7 +1115,7 @@ BRepAdaptor_CompCurve* StdMeshers_FaceSide::GetCurve3d() const
   TopoDS_Wire aWire;
   BRep_Builder aBuilder;
   aBuilder.MakeWire(aWire);
-  for ( int i=0; i<myEdge.size(); ++i )
+  for ( size_t i = 0; i < myEdge.size(); ++i )
     aBuilder.Add( aWire, myEdge[i] );
 
   if ( myEdge.size() == 2 && IsClosed() )
@@ -1157,7 +1159,7 @@ gp_Pnt2d StdMeshers_FaceSide::Value2d(double U) const
     int i = U * double( myPoints.size()-1 );
     while ( i > 0 && myPoints[ i ].normParam > U )
       --i;
-    while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U )
+    while ( i+1 < (int)myPoints.size() && myPoints[ i+1 ].normParam < U )
       ++i;
     double r = (( U - myPoints[ i ].normParam ) /
                 ( myPoints[ i+1 ].normParam - myPoints[ i ].normParam ));
index ba1f7e2d3e30f47e08956d2b91c56774b3b2db0e..83e19296b14883526b2f8e1a45b81c4cce092a75 100644 (file)
@@ -150,37 +150,37 @@ istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load)
   int intVal;
   double dblVal;
 
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if (isOK && intVal > 0) {
     _params.clear();
     _params.reserve( intVal );
-    for (int i = 0; i < _params.capacity() && isOK; i++) {
-      isOK = (load >> dblVal);
+    for ( size_t i = 0; i < _params.capacity() && isOK; i++) {
+      isOK = static_cast<bool>(load >> dblVal);
       if ( isOK ) _params.push_back( dblVal );
     }
   }
 
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if (isOK && intVal > 0) {
     _nbsegs.clear();
     _nbsegs.reserve( intVal );
-    for (int i = 0; i < _nbsegs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+    for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) {
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _nbsegs.push_back( intVal );
     }
   }
 
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if (isOK && intVal > 0) {
     _edgeIDs.clear();
     _edgeIDs.reserve( intVal );
-    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+    for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _edgeIDs.push_back( intVal );
     }
   }
 
-  isOK = (load >> _objEntry);
+  isOK = static_cast<bool>(load >> _objEntry);
 
   return load;
 }
index eb50e45a95c3e4cf6f0a97c84d3a4e5aacd049aa..031fd7ea1cf5a720d674eeab0a020f16f0b442c3 100644 (file)
@@ -132,8 +132,8 @@ ostream & StdMeshers_Geometric1D::SaveTo(ostream & save)
 istream & StdMeshers_Geometric1D::LoadFrom(istream & load)
 {
   bool isOK = true;
-  isOK = (load >> _begLength);
-  isOK = (load >> _ratio);
+  isOK = static_cast<bool>(load >> _begLength);
+  isOK = static_cast<bool>(load >> _ratio);
 
   if (isOK)
     StdMeshers_Reversible1D::LoadFrom( load );
@@ -166,7 +166,7 @@ bool StdMeshers_Geometric1D::SetParametersByMesh(const SMESH_Mesh*   theMesh,
     const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i ));
     BRepAdaptor_Curve C( edge );
 
-    vector< double > params;
+    std::vector< double > params;
     if ( SMESH_Algo::GetNodeParamOnEdge( theMesh->GetMeshDS(), edge, params ))
     {
       nbEdges++;
index 5ba63a48b1f5877411deb1e4848d9dba5ec8af74..5cd779b75f3461d8a891f41ebf06dafd32f539c8 100644 (file)
@@ -33,6 +33,8 @@
 
 #include <limits>
 
+using namespace std;
+
 // Define error message and _MYDEBUG_ if needed
 #ifdef _DEBUG_
 #define BAD_MESH_ERR \
@@ -107,14 +109,14 @@ namespace
       return true;
 
     set<const SMDS_MeshNode*> nodesInInverseFaces;
-    SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face );
+    SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator( SMDSAbs_Face );
     while ( fIt->more() )
     {
       const SMDS_MeshElement* face = fIt->next();
       nodesInInverseFaces.insert( face->begin_nodes(), face->end_nodes() );
     }
 
-    return nodesInInverseFaces.size() != ( 6 + (nbF/2-1)*3 );
+    return (int)nodesInInverseFaces.size() != ( 6 + (nbF/2-1)*3 );
   }
 
   //================================================================================
@@ -212,7 +214,7 @@ namespace
     int                          _nbBlocksFound;
 
 #ifdef _DEBUG_ // want to get SIGSEGV in case of invalid index
-#define _grid_access_(pobj, i) pobj->_grid[ ((i) < pobj->_grid.size()) ? i : int(1e100)]
+#define _grid_access_(pobj, i) pobj->_grid[ ((i) < (int)pobj->_grid.size()) ? i : int(1e100)]
 #else
 #define _grid_access_(pobj, i) pobj->_grid[ i ]
 #endif
@@ -269,8 +271,8 @@ namespace
     //!< safely return a node by XY
     const SMDS_MeshNode* node(int x, int y) const
     {
-      int i = _index( x, y );
-      return ( i < 0 || i >= _side->_grid.size()) ? 0 : _side->_grid[i];
+      size_t i = _index( x, y );
+      return ( i >= _side->_grid.size() ) ? 0 : _side->_grid[i];
     }
     //!< Return an edge
     SMESH_OrientedLink edge(EQuadEdge edge) const
@@ -372,7 +374,7 @@ namespace
 
   //================================================================================
   /*!
-   * \brief Find and return number of submeshes corresponding to blocks
+   * \brief Find blocks and return their number
    */
   //================================================================================
 
@@ -421,7 +423,7 @@ namespace
           _allSides.push_back( _BlockSide() );
 
         _BlockSide& side = _allSides.back();
-        if ( !fillSide( side, face, *corner ) )
+        if ( !fillSide( side, face, *corner ))
         {
           if ( !_error.empty() )
             return false;
@@ -522,7 +524,7 @@ namespace
             ok = block.setSide( i, findBlockSide( B_FRONT, edgeOfFront[i], edgeOfAdj[i],
                                                   advAnalys, sidesAround));
         // try to find a BACK side by a TOP one
-        if ( ok || !advAnalys)
+        if ( ok || !advAnalys )
           if ( !block._side[B_BACK] && block._side[B_TOP] )
             ok = block.setSide( B_BACK, findBlockSide( B_TOP, Q_TOP, Q_TOP,
                                                        advAnalys, sidesAround ));
@@ -533,7 +535,7 @@ namespace
       {
         // check if just found block is same as one of previously found blocks
         bool isSame = false;
-        for ( int i = 1; i < _blocks.size() && !isSame; ++i )
+        for ( size_t i = 1; i < _blocks.size() && !isSame; ++i )
           isSame = ( block._corners == _blocks[i-1]._corners );
         ok = !isSame;
       }
@@ -606,12 +608,12 @@ namespace
       side._index._ySize = verRow1.size();
       side._grid.resize( side._index.size(), NULL );
 
-      for ( x = 0; x < horRow1.size(); ++x )
+      for ( x = 0; x < nbX; ++x )
       {
         side.setNode( x, 0, horRow1[x] );
         side.setNode( x, 1, horRow2[x] );
       }
-      for ( y = 0; y < verRow1.size(); ++y )
+      for ( y = 0; y < nbY; ++y )
       {
         side.setNode( 0, y, verRow1[y] );
         side.setNode( 1, y, verRow2[y] );
@@ -725,7 +727,9 @@ namespace
       if ( !n ) return false;
 
       prevSide = nextSide;
-      nbChainLinks++;
+
+      if ( ++nbChainLinks > NB_QUAD_SIDES )
+        return false;
     }
 
     return ( n == n2 && nbChainLinks == NB_QUAD_SIDES );
@@ -1003,6 +1007,9 @@ namespace
       SMESH_OrientedLink eAdja = _side[ adjacent[i] ].edge( edgeAdj[i] );
       ok = ( eBack == eAdja );
     }
+    ok = ok && ( _side[ B_BOTTOM ]._index.size() == _side[ B_TOP  ]._index.size() &&
+                 _side[ B_RIGHT  ]._index.size() == _side[ B_LEFT ]._index.size() &&
+                 _side[ B_FRONT  ]._index.size() == _side[ B_BACK ]._index.size() );
     return ok;
   }
 
@@ -1250,7 +1257,7 @@ bool StdMeshers_HexaFromSkin_3D::Evaluate(SMESH_Mesh &         aMesh,
 
   int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa;
   vector<int>& nbByType = aResMap[ aMesh.GetSubMesh( aShape )];
-  if ( entity >= nbByType.size() )
+  if ( entity >= (int) nbByType.size() )
     nbByType.resize( SMDSEntity_Last, 0 );
 
   for ( int i = 0; i < nbBlocks; ++i )
index 1ad459448f597df5017c01702262aefa2abc70ff..34af3a6fd2375d1ac84df8f34e1a5589ba5e9ced 100644 (file)
@@ -144,6 +144,7 @@ namespace
   //=============================================================================
 
   typedef boost::shared_ptr< FaceQuadStruct > FaceQuadStructPtr;
+  typedef std::vector<gp_XYZ>                 TXYZColumn;
 
   // symbolic names of box sides
   enum EBoxSides{ B_BOTTOM=0, B_RIGHT, B_TOP, B_LEFT, B_FRONT, B_BACK, B_NB_SIDES };
@@ -151,6 +152,8 @@ namespace
   // symbolic names of sides of quadrangle
   enum EQuadSides{ Q_BOTTOM=0, Q_RIGHT, Q_TOP, Q_LEFT, Q_NB_SIDES };
 
+  enum EAxes{ COO_X=1, COO_Y, COO_Z };
+
   //=============================================================================
   /*!
    * \brief Container of nodes of structured mesh on a qudrangular geom FACE
@@ -166,6 +169,9 @@ namespace
     // node column's taken form _u2nodesMap taking into account sub-shape orientation
     vector<TNodeColumn> _columns;
 
+    // columns of normalized parameters of nodes within the unitary cube
+    vector<TXYZColumn> _ijkColumns;
+
     // geometry of a cube side
     TopoDS_Face _sideF;
 
@@ -177,6 +183,10 @@ namespace
     {
       return SMESH_TNodeXYZ( GetNode( iCol, iRow ));
     }
+    gp_XYZ& GetIJK(int iCol, int iRow)
+    {
+      return _ijkColumns[iCol][iRow];
+    }
   };
 
   //================================================================================
@@ -276,6 +286,56 @@ namespace
     }
     return ( n == n00 || n == n01 || n == n10 || n == n11 );
   }
+
+  //================================================================================
+  /*!
+   * \brief Fill in _FaceGrid::_ijkColumns
+   *  \param [in,out] fg - a _FaceGrid
+   *  \param [in] i1 - coordinate index along _columns
+   *  \param [in] i2 - coordinate index along _columns[i]
+   *  \param [in] v3 - value of the constant parameter
+   */
+  //================================================================================
+
+  void computeIJK( _FaceGrid& fg, int i1, int i2, double v3 )
+  {
+    gp_XYZ ijk( v3, v3, v3 );
+    const size_t nbCol = fg._columns.size();
+    const size_t nbRow = fg._columns[0].size();
+
+    fg._ijkColumns.resize( nbCol );
+    for ( size_t i = 0; i < nbCol; ++i )
+      fg._ijkColumns[ i ].resize( nbRow, ijk );
+
+    vector< double > len( nbRow );
+    len[0] = 0;
+    for ( size_t i = 0; i < nbCol; ++i )
+    {
+      gp_Pnt pPrev = fg.GetXYZ( i, 0 );
+      for ( size_t j = 1; j < nbRow; ++j )
+      {
+        gp_Pnt p = fg.GetXYZ( i, j );
+        len[ j ] = len[ j-1 ] + p.Distance( pPrev );
+        pPrev = p;
+      }
+      for ( size_t j = 0; j < nbRow; ++j )
+        fg.GetIJK( i, j ).SetCoord( i2, len[ j ]/len.back() );
+    }
+
+    len.resize( nbCol );
+    for ( size_t j = 0; j < nbRow; ++j )
+    {
+      gp_Pnt pPrev = fg.GetXYZ( 0, j );
+      for ( size_t i = 1; i < nbCol; ++i )
+      {
+        gp_Pnt p = fg.GetXYZ( i, j );
+        len[ i ] = len[ i-1 ] + p.Distance( pPrev );
+        pPrev = p;
+      }
+      for ( size_t i = 0; i < nbCol; ++i )
+        fg.GetIJK( i, j ).SetCoord( i1, len[ i ]/len.back() );
+    }
+  }
 }
 
 //=============================================================================
@@ -444,15 +504,15 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   {
     aCubeSide[i]._columns.resize( aCubeSide[i]._u2nodesMap.size() );
 
-    int iFwd = 0, iRev = aCubeSide[i]._columns.size()-1;
-    int* pi = isReverse[i] ? &iRev : &iFwd;
+    size_t iFwd = 0, iRev = aCubeSide[i]._columns.size()-1;
+    size_t*  pi = isReverse[i] ? &iRev : &iFwd;
     TParam2ColumnMap::iterator u2nn = aCubeSide[i]._u2nodesMap.begin();
     for ( ; iFwd < aCubeSide[i]._columns.size(); --iRev, ++iFwd, ++u2nn )
       aCubeSide[i]._columns[ *pi ].swap( u2nn->second );
 
     aCubeSide[i]._u2nodesMap.clear();
   }
-  
+
   if ( proxymesh )
     for ( int i = 0; i < 6; ++i )
       for ( unsigned j = 0; j < aCubeSide[i]._columns.size(); ++j)
@@ -476,6 +536,14 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   _FaceGrid* fFront  = & aCubeSide[ B_FRONT  ];
   _FaceGrid* fBack   = & aCubeSide[ B_BACK   ];
 
+  // compute normalized parameters of nodes on sides (PAL23189)
+  computeIJK( *fBottom, COO_X, COO_Y, /*z=*/0. );
+  computeIJK( *fRight,  COO_Y, COO_Z, /*x=*/1. );
+  computeIJK( *fTop,    COO_X, COO_Y, /*z=*/1. );
+  computeIJK( *fLeft,   COO_Y, COO_Z, /*x=*/0. );
+  computeIJK( *fFront,  COO_X, COO_Z, /*y=*/0. );
+  computeIJK( *fBack,   COO_X, COO_Z, /*y=*/1. );
+
   // cube size measured in nb of nodes
   int x, xSize = fBottom->_columns.size() , X = xSize - 1;
   int y, ySize = fLeft->_columns.size()   , Y = ySize - 1;
@@ -531,13 +599,14 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   pointsOnShapes[ SMESH_Block::ID_V011 ] = fTop->GetXYZ( 0, Y );
   pointsOnShapes[ SMESH_Block::ID_V111 ] = fTop->GetXYZ( X, Y );
 
+  gp_XYZ params; // normalized parameters of an internal node within the unit box
   for ( x = 1; x < xSize-1; ++x )
   {
-    gp_XYZ params; // normalized parameters of internal node within a unit box
-    params.SetCoord( 1, x / double(X) );
+    const double rX = x / double(X);
     for ( y = 1; y < ySize-1; ++y )
     {
-      params.SetCoord( 2, y / double(Y) );
+      const double rY = y / double(Y);
+
       // a column to fill in during z loop
       vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )];
       // projection points on horizontal edges
@@ -554,23 +623,36 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
       pointsOnShapes[ SMESH_Block::ID_Fxy1 ] = fTop   ->GetXYZ( x, y );
       for ( z = 1; z < zSize-1; ++z ) // z loop
       {
-        params.SetCoord( 3, z / double(Z) );
+        const double rZ = z / double(Z);
+
+        const gp_XYZ& pBo = fBottom->GetIJK( x, y );
+        const gp_XYZ& pTo = fTop   ->GetIJK( x, y );
+        const gp_XYZ& pFr = fFront ->GetIJK( x, z );
+        const gp_XYZ& pBa = fBack  ->GetIJK( x, z );
+        const gp_XYZ& pLe = fLeft  ->GetIJK( y, z );
+        const gp_XYZ& pRi = fRight ->GetIJK( y, z );
+        params.SetCoord( 1, 0.5 * ( pBo.X() * ( 1. - rZ ) + pTo.X() * rZ  +
+                                    pFr.X() * ( 1. - rY ) + pBa.X() * rY ));
+        params.SetCoord( 2, 0.5 * ( pBo.Y() * ( 1. - rZ ) + pTo.Y() * rZ  +
+                                    pLe.Y() * ( 1. - rX ) + pRi.Y() * rX ));
+        params.SetCoord( 3, 0.5 * ( pFr.Z() * ( 1. - rY ) + pBa.Z() * rY  +
+                                    pLe.Z() * ( 1. - rX ) + pRi.Z() * rX ));
+
         // projection points on vertical edges
-        pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z );    
-        pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z );    
-        pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z );    
+        pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z );
+        pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z );
+        pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z );
         pointsOnShapes[ SMESH_Block::ID_E11z ] = fBack->GetXYZ( X, z );
         // projection points on vertical faces
-        pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z );    
-        pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z );    
-        pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z );    
+        pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z );
+        pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z );
+        pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z );
         pointsOnShapes[ SMESH_Block::ID_F1yz ] = fRight->GetXYZ( y, z );
 
         // compute internal node coordinates
         gp_XYZ coords;
         SMESH_Block::ShellPoint( params, pointsOnShapes, coords );
         column[ z ] = helper.AddNode( coords.X(), coords.Y(), coords.Z() );
-
       }
     }
   }
index 7ed56e3315980c13353a7c13349f80c79481f1a8..de6bfc0471f68744834cfde562434ab52d970448 100644 (file)
@@ -125,14 +125,14 @@ namespace
                                       bool                        loaded=false)
   {
     vector<SMESH_Group*> okGroups;
-    for ( int i = 0; i < groups.size(); ++i )
+    for ( size_t i = 0; i < groups.size(); ++i )
     {
       try
       {
         // we expect SIGSEGV on a dead group
         OCC_CATCH_SIGNALS;
         SMESH_Group* okGroup = 0;
-        map<int, SMESH_Mesh*>::iterator itm = itm = studyContext->mapMesh.begin();
+        map<int, SMESH_Mesh*>::iterator itm = studyContext->mapMesh.begin();
         for ( ; !okGroup && itm != studyContext->mapMesh.end(); itm++)
         {
           SMESH_Mesh::GroupIteratorPtr gIt = itm->second->GetGroups();
@@ -174,7 +174,7 @@ namespace
   {
     int tgtID = resMapKey.second;
     SMESH_Mesh* tgtMesh = 0;
-    map<int, SMESH_Mesh*>::iterator itm = itm = studyContext->mapMesh.begin();
+    map<int, SMESH_Mesh*>::iterator itm = studyContext->mapMesh.begin();
     for ( ; !tgtMesh && itm != studyContext->mapMesh.end(); itm++)
     {
       tgtMesh = (*itm).second;
@@ -250,7 +250,7 @@ std::vector<SMESH_Mesh*> StdMeshers_ImportSource1D::GetSourceMeshes() const
     StudyContextStruct* studyContext = _gen->GetStudyContext(_studyId);
     for ( set<int>::iterator id = meshIDs.begin(); id != meshIDs.end(); ++id )
     {
-      map<int, SMESH_Mesh*>::iterator itm = itm = studyContext->mapMesh.begin();
+      map<int, SMESH_Mesh*>::iterator itm = studyContext->mapMesh.begin();
       for ( ; itm != studyContext->mapMesh.end(); itm++)
       {
         SMESH_Mesh* mesh = (*itm).second;
@@ -394,7 +394,7 @@ void StdMeshers_ImportSource1D::RestoreGroups(const std::vector<SMESH_Group*>& g
   _groups = groups;
 
   _resultGroups.clear();
-  int i = 0;
+  size_t i = 0;
   while ( i < _resultGroupsStorage.size() )
   {
     int key1 = _resultGroupsStorage[i++];
index 083f055f206ae815ae7e4390036d253865b929c6..f53b60edeae7d2d4211390a16325eeb8b2341faf 100644 (file)
@@ -685,7 +685,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th
   // import edges from groups
   TNodeNodeMap* n2n;
   TElemElemMap* e2e;
-  for ( int iG = 0; iG < srcGroups.size(); ++iG )
+  for ( size_t iG = 0; iG < srcGroups.size(); ++iG )
   {
     const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
 
@@ -711,7 +711,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th
       double mytol = a.Distance(edge->GetNode(edge->NbNodes()-1))/25;
       //mytol = max(1.E-5, 10*edgeTol); // too strict and not necessary
       //MESSAGE("mytol = " << mytol);
-      for ( unsigned i = 0; i < newNodes.size(); ++i, ++node )
+      for ( size_t i = 0; i < newNodes.size(); ++i, ++node )
       {
         TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first;
         if ( n2nIt->second )
@@ -810,7 +810,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th
 
   // copy meshes
   vector<SMESH_Mesh*> srcMeshes = _sourceHyp->GetSourceMeshes();
-  for ( unsigned i = 0; i < srcMeshes.size(); ++i )
+  for ( size_t i = 0; i < srcMeshes.size(); ++i )
     importMesh( srcMeshes[i], theMesh, _sourceHyp, theShape );
 
   return true;
@@ -873,7 +873,7 @@ void StdMeshers_Import_1D::importMesh(const SMESH_Mesh*          srcMesh,
       (*e2eIt).second = newElem;
   }
   // copy free nodes
-  if ( srcMeshDS->NbNodes() > n2n->size() )
+  if ( srcMeshDS->NbNodes() > (int) n2n->size() )
   {
     SMDS_NodeIteratorPtr nIt = srcMeshDS->nodesIterator();
     while( nIt->more() )
@@ -1028,7 +1028,7 @@ bool StdMeshers_Import_1D::Evaluate(SMESH_Mesh &         theMesh,
 
     // count edges imported from groups
     int nbEdges = 0, nbQuadEdges = 0;
-    for ( int iG = 0; iG < srcGroups.size(); ++iG )
+    for ( size_t iG = 0; iG < srcGroups.size(); ++iG )
     {
       const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
       SMDS_ElemIteratorPtr srcElems = srcGroup->GetElements();
@@ -1057,7 +1057,7 @@ bool StdMeshers_Import_1D::Evaluate(SMESH_Mesh &         theMesh,
   }
 
   SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
-  aResMap.insert(make_pair(sm,aVec));
+  aResMap.insert( make_pair( sm, aVec ));
 
   return true;
 }
index 60b776254489ad854f7f7dd9452386aa3491ceb2..df7f8c0655a6348b1dd87382e2b0fa2c1485b27a 100644 (file)
@@ -824,7 +824,7 @@ bool StdMeshers_Import_1D2D::Evaluate(SMESH_Mesh &         theMesh,
     set<const SMDS_MeshNode* > allNodes;
     gp_XY uv;
     double minGroupTol = 1e100;
-    for ( int iG = 0; iG < srcGroups.size(); ++iG )
+    for ( size_t iG = 0; iG < srcGroups.size(); ++iG )
     {
       const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
       const double groupTol = 0.5 * sqrt( getMinElemSize2( srcGroup ));
index a31944c644543e7e20ec47dc8a38752613efebb1..340271d55b0a16bacd2dc1362569a8a6c9f97559 100644 (file)
@@ -106,7 +106,7 @@ istream & StdMeshers_LengthFromEdges::LoadFrom(istream & load)
 {
   bool isOK = true;
   int a;
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK) 
     this->_mode = a;
   else 
index c5c824e1840d67b26a6513551736e09c2b577e3c..d86e9becb4a8c0d3bfba489670a559e7adc04150 100644 (file)
@@ -148,13 +148,13 @@ istream & StdMeshers_LocalLength::LoadFrom(istream & load)
   bool isOK = true;
   double a;
 
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     this->_length = a;
   else
     load.clear(ios::badbit | load.rdstate());
 
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     this->_precision = a;
   else
@@ -224,7 +224,7 @@ bool StdMeshers_LocalLength::SetParametersByMesh(const SMESH_Mesh*   theMesh,
     SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
     if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
     {
-      for ( int i = 1; i < params.size(); ++i )
+      for ( size_t i = 1; i < params.size(); ++i )
         _length += GCPnts_AbscissaPoint::Length( AdaptCurve, params[ i-1 ], params[ i ]);
       nbEdges += params.size() - 1;
     }
index 26418917007451c92c6f2788c778fe902fdad063..e7daf5ace19e9eee80a158662c1f1274be05cd0a 100644 (file)
@@ -587,7 +587,7 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(TWireVector &                 wires,
     F = TopoDS::Face( _helper->GetSubShape() );
     TopExp::MapShapesAndAncestors( F, TopAbs_VERTEX, TopAbs_WIRE, VWMap );
     int nbVertices = 0;
-    for ( int iW = 0; iW < wires.size(); ++iW )
+    for ( size_t iW = 0; iW < wires.size(); ++iW )
       nbVertices += wires[ iW ]->NbEdges();
     if ( nbVertices == VWMap.Extent() )
       VWMap.Clear(); // wires have no common vertices
@@ -595,10 +595,10 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(TWireVector &                 wires,
 
   int m = 0;
 
-  for ( int iW = 0; iW < wires.size(); ++iW )
+  for ( size_t iW = 0; iW < wires.size(); ++iW )
   {
     const vector<UVPtStruct>& uvPtVec = wires[ iW ]->GetUVPtStruct();
-    if ( uvPtVec.size() != wires[ iW ]->NbPoints() ) {
+    if ((int) uvPtVec.size() != wires[ iW ]->NbPoints() ) {
       return error(COMPERR_BAD_INPUT_MESH,SMESH_Comment("Unexpected nb of points on wire ")
                    << iW << ": " << uvPtVec.size()<<" != "<<wires[ iW ]->NbPoints()
                    << ", probably because of invalid node parameters on geom edges");
index 726909c3dcc7af0329d65f4cb68d67e9aa2217af..ed2d53fb22910709884be0e4f0db327b4cc1d11c 100644 (file)
@@ -114,7 +114,7 @@ istream & StdMeshers_MaxElementArea::LoadFrom(istream & load)
 {
   bool isOK = true;
   double a;
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK) 
     this->_maxArea = a;
   else 
index 4ece1400800dae7c94d2ef7fe96fd9cbc2fa70e4..21a4d78a9197b7cbf6386b7a48ad3af8e59127bd 100644 (file)
@@ -116,7 +116,7 @@ istream & StdMeshers_MaxElementVolume::LoadFrom(istream & load)
 {
   bool isOK = true;
   double a;
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     this->_maxVolume = a;
   else 
index 0e7e9f6171c4eaa3c2a76afe27d8b0af58a0adc3..75ca617c851d32d07ddf69e6b1d2d46aa9c518a2 100644 (file)
@@ -158,20 +158,20 @@ istream & StdMeshers_MaxLength::LoadFrom(istream & load)
   bool isOK = true;
   double a;
 
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     _length = a;
   else
     load.clear(ios::badbit | load.rdstate());
 
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     _preestimated = a;
   else
     load.clear(ios::badbit | load.rdstate());
 
   bool pre;
-  isOK = (load >> pre);
+  isOK = static_cast<bool>(load >> pre);
   if ( isOK )
     _preestimation = pre;
   else
@@ -213,7 +213,7 @@ bool StdMeshers_MaxLength::SetParametersByMesh(const SMESH_Mesh*   theMesh,
     SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
     if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
     {
-      for ( int i = 1; i < params.size(); ++i )
+      for ( size_t i = 1; i < params.size(); ++i )
         _length += GCPnts_AbscissaPoint::Length( AdaptCurve, params[ i-1 ], params[ i ]);
       nbEdges += params.size() - 1;
     }
index d3e0b5277df28cda7d9bb1db6e5793a767477b23..0e245845d08d4ce14a1640f37d2d7e0d3b8d44fe 100644 (file)
@@ -77,7 +77,7 @@ void StdMeshers_NumberOfLayers::SetNumberOfLayers(int numberOfLayers)
 {
   if ( _nbLayers != numberOfLayers ) {
     if ( numberOfLayers <= 0 )
-      throw SALOME_Exception(LOCALIZED("numberOfLayers must be positive"));
+      throw SALOME_Exception(LOCALIZED("numberOfLayers must be more than zero"));
     _nbLayers = numberOfLayers;
 
     NotifySubMeshesHypothesisModification();
@@ -118,7 +118,7 @@ ostream & StdMeshers_NumberOfLayers::SaveTo(ostream & save)
 istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load)
 {
   bool isOK = true;
-  isOK = (load >> _nbLayers);
+  isOK = static_cast<bool>(load >> _nbLayers);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
   return load;
index 2f0d05b9d75e8aee3d1c903434f830bfd71da973..2fec858ef786ca860ef903aefcfde26ddd466c7d 100644 (file)
@@ -180,15 +180,17 @@ StdMeshers_NumberOfSegments::DistrType StdMeshers_NumberOfSegments::GetDistrType
 void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor)
   throw(SALOME_Exception)
 {
-  if (_distrType != DT_Scale)
-    _distrType = DT_Scale;
-    //throw SALOME_Exception(LOCALIZED("not a scale distribution"));
   if (scaleFactor < PRECISION)
     throw SALOME_Exception(LOCALIZED("scale factor must be positive"));
-  if (fabs(scaleFactor - 1.0) < PRECISION)
-    _distrType = DT_Regular;
 
-  if (fabs(_scaleFactor - scaleFactor) > PRECISION)
+  if (_distrType != DT_Scale)
+    _distrType = DT_Scale;
+
+//  commented by mpa for IPAL 52986
+//  if ( fabs(scaleFactor - 1.0) < PRECISION )
+//    _distrType = DT_Regular;
+
+  if ( fabs(_scaleFactor - scaleFactor) > PRECISION )
   {
     _scaleFactor = scaleFactor;
     NotifySubMeshesHypothesisModification();
@@ -197,7 +199,7 @@ void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor)
 
 //================================================================================
 /*!
- * 
+ *
  */
 //================================================================================
 
@@ -211,7 +213,7 @@ double StdMeshers_NumberOfSegments::GetScaleFactor() const
 
 //================================================================================
 /*!
- * 
+ *
  */
 //================================================================================
 
@@ -224,12 +226,12 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
   if ( (table.size() % 2) != 0 )
     throw SALOME_Exception(LOCALIZED("odd size of vector of table function"));
 
-  int i;
   double prev = -PRECISION;
   bool isSame = table.size() == _table.size();
 
   bool pos = false;
-  for (i=0; i < table.size()/2; i++) {
+  for ( size_t i = 0; i < table.size() / 2; i++ )
+  {
     double par = table[i*2];
     double val = table[i*2+1];
     if( _convMode==0 )
@@ -239,7 +241,8 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
         OCC_CATCH_SIGNALS;
 #endif
         val = pow( 10.0, val );
-      } catch(Standard_Failure) {
+      }
+      catch(Standard_Failure) {
         Handle(Standard_Failure) aFail = Standard_Failure::Caught();
         throw SALOME_Exception( LOCALIZED( "invalid value"));
         return;
@@ -248,19 +251,19 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
     else if( _convMode==1 && val<0.0 )
       val = 0.0;
 
-    if ( par<0 || par > 1)
+    if ( par < 0 || par > 1)
       throw SALOME_Exception(LOCALIZED("parameter of table function is out of range [0,1]"));
-    if ( fabs(par-prev)<PRECISION )
+    if ( fabs(par-prev) < PRECISION )
       throw SALOME_Exception(LOCALIZED("two parameters are the same"));
     if ( val < 0 )
       throw SALOME_Exception(LOCALIZED("value of table function is not positive"));
-    if( val>PRECISION )
+    if( val > PRECISION )
       pos = true;
     if (isSame)
     {
       double oldpar = _table[i*2];
       double oldval = _table[i*2+1];
-      if (fabs(par - oldpar) > PRECISION || fabs(val - oldval) > PRECISION)
+      if ( fabs(par - oldpar) > PRECISION || fabs(val - oldval) > PRECISION )
         isSame = false;
     }
     prev = par;
@@ -269,7 +272,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
   if( !pos )
     throw SALOME_Exception(LOCALIZED("value of table function is not positive"));
 
-  if( pos && !isSame )
+  if ( pos && !isSame )
   {
     _table = table;
     NotifySubMeshesHypothesisModification();
@@ -278,7 +281,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
 
 //================================================================================
 /*!
- * 
+ *
  */
 //================================================================================
 
@@ -394,7 +397,6 @@ void StdMeshers_NumberOfSegments::SetExpressionFunction(const char* expr)
 {
   if (_distrType != DT_ExprFunc)
     _distrType = DT_ExprFunc;
-    //throw SALOME_Exception(LOCALIZED("not an expression function distribution"));
 
   string func = CheckExpressionFunction( expr, _convMode );
   if( _func != func )
@@ -509,9 +511,8 @@ ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save)
     save << " " << _scaleFactor;
     break;
   case DT_TabFunc:
-    int i;
     save << " " << _table.size();
-    for (i=0; i < _table.size(); i++)
+    for ( size_t i = 0; i < _table.size(); i++ )
       save << " " << _table[i];
     break;
   case DT_ExprFunc:
@@ -547,7 +548,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   int a;
 
   // read number of segments
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     _numberOfSegments = a;
   else
@@ -560,7 +561,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   //    (nb.segments, distr.type, some other params.),
   //    we wait here the ditribution type, which is integer
   double scale_factor;
-  isOK = (load >> scale_factor);
+  isOK = static_cast<bool>(load >> scale_factor);
   a = (int)scale_factor;
 
   // try to interprete ditribution type,
@@ -581,7 +582,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   {
   case DT_Scale:
     {
-      isOK = (load >> b);
+      isOK = static_cast<bool>(load >> b);
       if (isOK)
         _scaleFactor = b;
       else
@@ -595,14 +596,13 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
     break;
   case DT_TabFunc:
     {
-      isOK = (load >> a);
+      isOK = static_cast<bool>(load >> a);
       if (isOK)
       {
         _table.resize(a, 0.);
-        int i;
-        for (i=0; i < _table.size(); i++)
+        for ( size_t i=0; i < _table.size(); i++ )
         {
-          isOK = (load >> b);
+          isOK = static_cast<bool>(load >> b);
           if (isOK)
             _table[i] = b;
           else
@@ -621,7 +621,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   case DT_ExprFunc:
     {
       string str;
-      isOK = (load >> str);
+      isOK = static_cast<bool>(load >> str);
       if (isOK)
         _func = str;
       else
@@ -640,7 +640,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
 
   if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc)
   {
-    isOK = (load >> a);
+    isOK = static_cast<bool>(load >> a);
     if (isOK)
       _convMode = a;
     else
@@ -649,14 +649,14 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
 
   // load reversed edges IDs
   int intVal;
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if ( isOK && _distrType != DT_Regular && intVal > 0 ) {
     _edgeIDs.reserve( intVal );
-    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+    for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _edgeIDs.push_back( intVal );
     }
-    isOK = (load >> _objEntry);
+    isOK = static_cast<bool>(load >> _objEntry);
   }
 
   return load;
@@ -664,7 +664,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
index 6d99a44de3a3ef1a2e3f19bf12a2f1d08d480af7..bb4f491b15a559477a6d55e08e92132d335d0d5e 100644 (file)
@@ -674,7 +674,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
     int nbFaceNodes = pE0->NbNodes();
     if(myCreateQuadratic)
       nbFaceNodes = nbFaceNodes/2;
-    if ( aN.size() < nbFaceNodes * 2 )
+    if ( (int) aN.size() < nbFaceNodes * 2 )
       aN.resize( nbFaceNodes * 2 );
     //
     for ( k=0; k<nbFaceNodes; ++k ) {
@@ -806,7 +806,7 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1()
     aNbNodes = pE0->NbNodes();
     if(myCreateQuadratic)
       aNbNodes = aNbNodes/2;
-    if ( aNodes1.size() < aNbNodes )
+    if ( (int) aNodes1.size() < aNbNodes )
       aNodes1.resize( aNbNodes );
     //
     k = aNbNodes-1; // reverse a face
@@ -1476,7 +1476,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
     nVec.resize( vsize, nullNode );
     loadedNodes.insert( nVec[ 0 ] = node );
   }
-  if ( theIJNodes.size() != hsize ) {
+  if ( (int) theIJNodes.size() != hsize ) {
     MESSAGE( "Wrong node positions on theBaseEdge" );
     return false;
   }
index 6e58555e1828b93af54789620d6b29eb236fe3ab..645bad1e2fe5c47a251bef2637fe531d34f09998 100644 (file)
@@ -62,6 +62,7 @@
 #include <gp_Ax3.hxx>
 
 #include <limits>
+#include <numeric>
 
 using namespace std;
 
@@ -71,8 +72,7 @@ using namespace std;
 #ifdef _DEBUG_
 #define DBGOUT(msg) //cout << msg << endl;
 #define SHOWYXZ(msg, xyz)                                               \
-  // { gp_Pnt p (xyz);                                                     \
-  //   cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
+  //{ gp_Pnt p (xyz); cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
 #else
 #define DBGOUT(msg)
 #define SHOWYXZ(msg, xyz)
@@ -340,7 +340,7 @@ namespace {
     // gravity center of a layer
     gp_XYZ O(0,0,0);
     int vertexCol = -1;
-    for ( int i = 0; i < columns.size(); ++i )
+    for ( size_t i = 0; i < columns.size(); ++i )
     {
       O += gpXYZ( (*columns[ i ])[ z ]);
       if ( vertexCol < 0 &&
@@ -352,7 +352,7 @@ namespace {
     // Z axis
     gp_Vec Z(0,0,0);
     int iPrev = columns.size()-1;
-    for ( int i = 0; i < columns.size(); ++i )
+    for ( size_t i = 0; i < columns.size(); ++i )
     {
       gp_Vec v1( O, gpXYZ( (*columns[ iPrev ])[ z ]));
       gp_Vec v2( O, gpXYZ( (*columns[ i ]    )[ z ]));
@@ -364,11 +364,11 @@ namespace {
     {
       O = gpXYZ( (*columns[ vertexCol ])[ z ]);
     }
-    if ( xColumn < 0 || xColumn >= columns.size() )
+    if ( xColumn < 0 || xColumn >= (int) columns.size() )
     {
       // select a column for X dir
       double maxDist = 0;
-      for ( int i = 0; i < columns.size(); ++i )
+      for ( size_t i = 0; i < columns.size(); ++i )
       {
         double dist = ( O - gpXYZ((*columns[ i ])[ z ])).SquareModulus();
         if ( dist > maxDist )
@@ -408,8 +408,8 @@ namespace {
       if ( nbQuads > 0 )
         toRemove = helper->IsStructured( faceSm );
       else
-        toRemove = quadAlgo->CheckNbEdges( *helper->GetMesh(),
-                                           faceSm->GetSubShape() );
+        toRemove = quadAlgo->CheckNbEdges( *helper->GetMesh(),
+                                             faceSm->GetSubShape() ) != NULL );
       nbRemoved += toRemove;
       if ( toRemove )
         smIt = notQuadSubMesh.erase( smIt );
@@ -455,9 +455,9 @@ namespace {
     std::advance( edgeIt, nbEdges-1 );
     TopoDS_Edge   prevE = *edgeIt;
     // bool isPrevStraight = SMESH_Algo::IsStraight( prevE );
-    int           iPrev = nbEdges - 1;
+    // int           iPrev = nbEdges - 1;
 
-    int iUnite = -1; // the first of united EDGEs
+    // int iUnite = -1; // the first of united EDGEs
 
     // analyse angles between EDGEs
     int nbCorners = 0;
@@ -525,7 +525,7 @@ namespace {
   void pointsToPython(const std::vector<gp_XYZ>& p)
   {
 #ifdef _DEBUG_
-    for ( int i = SMESH_Block::ID_V000; i < p.size(); ++i )
+    for ( size_t i = SMESH_Block::ID_V000; i < p.size(); ++i )
     {
       cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ;
       SMESH_Block::DumpShapeID( i, cout ) << endl;
@@ -934,6 +934,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;
   double f,l;
   while ( edge != thePrism.myBottomEdges.end() )
@@ -977,6 +978,8 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
     {
       iE = 0;
       ++nbE;
+      int nbQuadPrev = std::accumulate( nbQuadsPerWire.begin(), nbQuadsPerWire.end(), 0 );
+      nbQuadsPerWire.push_back( thePrism.myWallQuads.size() - nbQuadPrev );
     }
   }
 
@@ -988,12 +991,14 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
   // that is not so evident in case of several WIREs in the bottom FACE
   thePrism.myRightQuadIndex.clear();
   for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
-    thePrism.myRightQuadIndex.push_back( i+1 );
-  list< int >::iterator nbEinW = thePrism.myNbEdgesInWires.begin();
-  for ( int iLeft = 0; nbEinW != thePrism.myNbEdgesInWires.end(); ++nbEinW )
   {
-    thePrism.myRightQuadIndex[ iLeft + *nbEinW - 1 ] = iLeft; // 1st EDGE index of a current WIRE
-    iLeft += *nbEinW;
+    thePrism.myRightQuadIndex.push_back( i+1 ); // OK for all but the last EDGE of a WIRE
+  }
+  list< int >::iterator nbQinW = nbQuadsPerWire.begin();
+  for ( int iLeft = 0; nbQinW != nbQuadsPerWire.end(); ++nbQinW )
+  {
+    thePrism.myRightQuadIndex[ iLeft + *nbQinW - 1 ] = iLeft; // for the last EDGE of a WIRE
+    iLeft += *nbQinW;
   }
 
   while ( totalNbFaces - faceMap.Extent() > 2 )
@@ -1073,7 +1078,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
   {
     // now only top and bottom FACEs are not in the faceMap
     faceMap.Add( thePrism.myBottom );
-    for ( TopExp_Explorer f( thePrism.myShape3D, TopAbs_FACE );f.More(); f.Next() )
+    for ( TopExp_Explorer f( thePrism.myShape3D, TopAbs_FACE ); f.More(); f.Next() )
       if ( !faceMap.Contains( f.Current() )) {
         thePrism.myTop = TopoDS::Face( f.Current() );
         break;
@@ -1287,6 +1292,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
   if ( !smDS ) return toSM( error(COMPERR_BAD_INPUT_MESH, "Null submesh"));
 
   // loop on bottom mesh faces
+  vector< const TNodeColumn* > columns;
   SMDS_ElemIteratorPtr faceIt = smDS->GetElements();
   while ( faceIt->more() )
   {
@@ -1296,7 +1302,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
 
     // find node columns for each node
     int nbNodes = face->NbCornerNodes();
-    vector< const TNodeColumn* > columns( nbNodes );
+    columns.resize( nbNodes );
     for ( int i = 0; i < nbNodes; ++i )
     {
       const SMDS_MeshNode* n = face->GetNode( i );
@@ -1313,7 +1319,8 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
       }
     }
     // create prisms
-    AddPrisms( columns, myHelper );
+    if ( !AddPrisms( columns, myHelper ))
+      return toSM( error("Different 'vertical' discretization"));
 
   } // loop on bottom mesh faces
 
@@ -1811,17 +1818,20 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh&         theMesh,
  */
 //================================================================================
 
-void StdMeshers_Prism_3D::AddPrisms( vector<const TNodeColumn*> & columns,
+bool StdMeshers_Prism_3D::AddPrisms( vector<const TNodeColumn*> & columns,
                                      SMESH_MesherHelper*          helper)
 {
-  int nbNodes = columns.size();
-  int nbZ     = columns[0]->size();
-  if ( nbZ < 2 ) return;
+  size_t nbNodes = columns.size();
+  size_t nbZ     = columns[0]->size();
+  if ( nbZ < 2 ) return false;
+  for ( size_t i = 1; i < nbNodes; ++i )
+    if ( columns[i]->size() != nbZ )
+      return false;
 
   // find out orientation
   bool isForward = true;
   SMDS_VolumeTool vTool;
-  int z = 1;
+  size_t z = 1;
   switch ( nbNodes ) {
   case 3: {
     SMDS_VolumeOfNodes tmpPenta ( (*columns[0])[z-1], // bottom
@@ -1907,7 +1917,7 @@ void StdMeshers_Prism_3D::AddPrisms( vector<const TNodeColumn*> & columns,
     vector<const SMDS_MeshNode*> nodes( 2*nbNodes + 4*nbNodes);
     for ( z = 1; z < nbZ; ++z )
     {
-      for ( int i = 0; i < nbNodes; ++i ) {
+      for ( size_t i = 0; i < nbNodes; ++i ) {
         nodes[ i             ] = (*columns[ i ])[z+iBase1]; // bottom or top
         nodes[ 2*nbNodes-i-1 ] = (*columns[ i ])[z+iBase2]; // top or bottom
         // side
@@ -1921,6 +1931,8 @@ void StdMeshers_Prism_3D::AddPrisms( vector<const TNodeColumn*> & columns,
     }
 
   } // switch ( nbNodes )
+
+  return true;
 }
 
 //================================================================================
@@ -1976,7 +1988,7 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top( const gp_Trsf & bottomToTopTrsf
     n2nMapPtr = & TProjction2dAlgo::instance( this )->GetNodesMap();
   }
 
-  if ( !n2nMapPtr || n2nMapPtr->size() < botSMDS->NbNodes() )
+  if ( !n2nMapPtr || (int) n2nMapPtr->size() < botSMDS->NbNodes() )
   {
     // associate top and bottom faces
     NSProjUtils::TShapeShapeMap shape2ShapeMap;
@@ -2511,6 +2523,8 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
     int                         _nbCheckedEdges; // nb of EDGEs whose location is defined
     PrismSide                  *_leftSide;
     PrismSide                  *_rightSide;
+    void SetExcluded() { _leftSide = _rightSide = NULL; }
+    bool IsExcluded() const { return !_leftSide; }
     const TopoDS_Edge& Edge( int i ) const
     {
       return (*_edges)[ i ]._edge;
@@ -2572,16 +2586,34 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
   /*!
    * \brief Return another faces sharing an edge
    */
-  const TopoDS_Shape & getAnotherFace( const TopoDS_Face& face,
-                                       const TopoDS_Edge& edge,
-                                       TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge)
+  const TopoDS_Face & getAnotherFace( const TopoDS_Face& face,
+                                      const TopoDS_Edge& edge,
+                                      TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge)
   {
     TopTools_ListIteratorOfListOfShape faceIt( facesOfEdge.FindFromKey( edge ));
     for ( ; faceIt.More(); faceIt.Next() )
       if ( !face.IsSame( faceIt.Value() ))
-        return faceIt.Value();
+        return TopoDS::Face( faceIt.Value() );
     return face;
   }
+
+  //--------------------------------------------------------------------------------
+  /*!
+   * \brief Return number of faces sharing given edges
+   */
+  int nbAdjacentFaces( const std::vector< EdgeWithNeighbors >&          edges,
+                       const TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge )
+  {
+    TopTools_MapOfShape adjFaces;
+
+    for ( size_t i = 0; i < edges.size(); ++i )
+    {
+      TopTools_ListIteratorOfListOfShape faceIt( facesOfEdge.FindFromKey( edges[i]._edge ));
+      for ( ; faceIt.More(); faceIt.Next() )
+        adjFaces.Add( faceIt.Value() );
+    }
+    return adjFaces.Extent();
+  }
 }
 
 //================================================================================
@@ -2647,11 +2679,13 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA
 
     typedef vector< EdgeWithNeighbors > TEdgeWithNeighborsVec;
     vector< TEdgeWithNeighborsVec > faceEdgesVec( allFaces.Extent() + 1 );
-    TopTools_IndexedMapOfShape* facesOfSide = new TopTools_IndexedMapOfShape[ faceEdgesVec.size() ];
+    const size_t nbEdgesMax = facesOfEdge.Extent() * 2; // there can be seam EDGES
+    TopTools_IndexedMapOfShape* facesOfSide = new TopTools_IndexedMapOfShape[ nbEdgesMax ];
     SMESHUtils::ArrayDeleter<TopTools_IndexedMapOfShape> delFacesOfSide( facesOfSide );
 
     // try to use each face as a bottom one
     bool prismDetected = false;
+    vector< PrismSide > sides;
     for ( int iF = 1; iF < allFaces.Extent() && !prismDetected; ++iF )
     {
       const TopoDS_Face& botF = TopoDS::Face( allFaces( iF ));
@@ -2664,11 +2698,12 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA
         continue; // all faces are adjacent to botF - no top FACE
 
       // init data of side FACEs
-      vector< PrismSide > sides( botEdges.size() );
-      for ( int iS = 0; iS < botEdges.size(); ++iS )
+      sides.clear();
+      sides.resize( botEdges.size() );
+      for ( size_t iS = 0; iS < botEdges.size(); ++iS )
       {
-        sides[ iS ]._topEdge = botEdges[ iS ]._edge;
-        sides[ iS ]._face    = botF;
+        sides[ iS ]._topEdge   = botEdges[ iS ]._edge;
+        sides[ iS ]._face      = botF;
         sides[ iS ]._leftSide  = & sides[ botEdges[ iS ]._iR ];
         sides[ iS ]._rightSide = & sides[ botEdges[ iS ]._iL ];
         sides[ iS ]._faces = & facesOfSide[ iS ];
@@ -2700,8 +2735,8 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA
                 if ( side._isCheckedEdge[ iE ] ) continue;
                 const TopoDS_Edge&      vertE = side.Edge( iE );
                 const TopoDS_Shape& neighborF = getAnotherFace( side._face, vertE, facesOfEdge );
-                bool isEdgeShared = adjSide->IsSideFace( neighborF );
-                if ( isEdgeShared )
+                bool             isEdgeShared = adjSide->IsSideFace( neighborF );
+                if ( isEdgeShared )               // vertE is shared with adjSide
                 {
                   isAdvanced = true;
                   side._isCheckedEdge[ iE ] = true;
@@ -2812,7 +2847,7 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA
           const TopoDS_Shape& topFace = sides[0]._faces->FindKey( nbFaces );
           size_t iS;
           for ( iS = 1; iS < sides.size(); ++iS )
-            if ( !sides[ iS ]._faces->Contains( topFace ))
+            if ( ! sides[ iS ]._faces->Contains( topFace ))
               break;
           prismDetected = ( iS == sides.size() );
         }
@@ -3286,7 +3321,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper*         helper,
       if ( nbUnitePerEdge[ iE ] < 0 )
         continue;
       // look for already united faces
-      for ( int i = iE; i < iE + nbExraFaces; ++i )
+      for ( size_t i = iE; i < iE + nbExraFaces; ++i )
       {
         if ( nbUnitePerEdge[ i ] > 0 ) // a side including nbUnitePerEdge[i]+1 edge
           nbExraFaces += nbUnitePerEdge[ i ];
@@ -3325,7 +3360,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper*         helper,
     else if ( nbExraFaces > 1 ) // unite
     {
       double u0 = 0, sumLen = 0;
-      for ( int i = iE; i < iE + nbExraFaces; ++i )
+      for ( size_t i = iE; i < iE + nbExraFaces; ++i )
         sumLen += edgeLength[ i ];
 
       vector< TSideFace* >        components( nbExraFaces );
@@ -3476,10 +3511,8 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper*         helper,
     }
   }
 
-// #define SHOWYXZ(msg, xyz) {                     \
-//     gp_Pnt p (xyz);                                                     \
-//     cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; \
-//   }
+// #define SHOWYXZ(msg, xyz) { gp_Pnt p(xyz); cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
+
 //   double _u[]={ 0.1, 0.1, 0.9, 0.9 };
 //   double _v[]={ 0.1, 0.9, 0.1, 0.9 };
 //   for ( int z = 0; z < 2; ++z )
@@ -3571,7 +3604,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> &
   double tol2;
   {
     Bnd_B3d bndBox;
-    for ( int i = 0; i < columns.size(); ++i )
+    for ( size_t i = 0; i < columns.size(); ++i )
       bndBox.Add( gpXYZ( columns[i]->front() ));
     tol2 = bndBox.SquareExtent() * 1e-5;
   }
@@ -3594,7 +3627,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> &
     //t.SetScaleFactor( distZ/dist0 ); - it does not work properly, wrong base point
 
     // check a transformation
-    for ( int i = 0; i < columns.size(); ++i )
+    for ( size_t i = 0; i < columns.size(); ++i )
     {
       gp_Pnt p0 = gpXYZ( (*columns[i])[0] );
       gp_Pnt pz = gpXYZ( (*columns[i])[z] );
@@ -3798,7 +3831,7 @@ StdMeshers_PrismAsBlock::TSideFace::TSideFace( const TSideFace& other ):
   myComponents       ( other.myComponents.size() ),
   myHelper           ( *other.myHelper.GetMesh() )
 {
-  for (int i = 0 ; i < myComponents.size(); ++i )
+  for ( size_t i = 0 ; i < myComponents.size(); ++i )
     myComponents[ i ] = new TSideFace( *other.myComponents[ i ]);
 }
 
@@ -3810,7 +3843,7 @@ StdMeshers_PrismAsBlock::TSideFace::TSideFace( const TSideFace& other ):
 
 StdMeshers_PrismAsBlock::TSideFace::~TSideFace()
 {
-  for (int i = 0 ; i < myComponents.size(); ++i )
+  for ( size_t i = 0 ; i < myComponents.size(); ++i )
     if ( myComponents[ i ] )
       delete myComponents[ i ];
 }
@@ -3910,7 +3943,7 @@ StdMeshers_PrismAsBlock::TSideFace::GetComponent(const double U,double & localU)
   if ( myComponents.empty() )
     return const_cast<TSideFace*>( this );
 
-  int i;
+  size_t i;
   for ( i = 0; i < myComponents.size(); ++i )
     if ( U < myParams[ i ].second )
       break;
@@ -4349,9 +4382,9 @@ gp_Pnt StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::Value(const Standard_Real
 void StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::dumpNodes(int nbNodes) const
 {
 #ifdef _DEBUG_
-  for ( int i = 0; i < nbNodes && i < myNodeColumn->size(); ++i )
+  for ( int i = 0; i < nbNodes && i < (int)myNodeColumn->size(); ++i )
     cout << (*myNodeColumn)[i]->GetID() << " ";
-  if ( nbNodes < myNodeColumn->size() )
+  if ( nbNodes < (int) myNodeColumn->size() )
     cout << myNodeColumn->back()->GetID();
 #endif
 }
index 708a92ca9226a29e0cf948b76d84266fc737812c..9788b64a115e45cf279cd02b4ac9364f3600bd6e 100644 (file)
@@ -270,7 +270,7 @@ private:
     TParam2ColumnMap*               myParamToColumnMap;
     PSurface                        mySurface;
     TopoDS_Edge                     myBaseEdge;
-    map< int, PSurface >            myShapeID2Surf;
+    std::map< int, PSurface >       myShapeID2Surf;
     // first and last normalized params and orientaion for each component or it-self
     std::vector< std::pair< double, double> > myParams; // select my columns in myParamToColumnMap
     bool                            myIsForward;
@@ -472,7 +472,7 @@ public:
     * \param nodeColumns - columns of nodes generated from nodes of a mesh face
     * \param helper - helper initialized by mesh and shape to add prisms to
    */
-  static void AddPrisms( std::vector<const TNodeColumn*> & nodeColumns,
+  static bool AddPrisms( std::vector<const TNodeColumn*> & nodeColumns,
                          SMESH_MesherHelper*               helper);
 
   static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
index a2f1047fee303e3cd02dd641433547b4cd75b82e..51a6398690b0a87fddc2df6443ec7cd0dc8019a6 100644 (file)
@@ -79,23 +79,9 @@ using namespace std;
 #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
 #define CONT_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); continue; }
 #define SHOW_SHAPE(v,msg) \
-// { \
-//  if ( (v).IsNull() ) cout << msg << " NULL SHAPE" << endl; \
-// else if ((v).ShapeType() == TopAbs_VERTEX) {\
-//   gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( (v) ));\
-//   cout<<msg<<" "<<shapeIndex((v))<<" ( "<<p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;} \
-// else {\
-//   cout << msg << " "; TopAbs::Print((v).ShapeType(),cout) <<" "<<shapeIndex((v))<<endl;}\
-// }
+  // { show_shape((v),(msg)); }
 #define SHOW_LIST(msg,l) \
-// { \
-//     cout << msg << " ";\
-//     list< TopoDS_Edge >::const_iterator e = l.begin();\
-//     for ( int i = 0; e != l.end(); ++e, ++i ) {\
-//       cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") "\
-//            << i << "E (" << e->TShape().operator->() << "); "; }\
-//     cout << endl;\
-//   }
+  // { show_list((msg),(l)); }
 
 namespace HERE = StdMeshers_ProjectionUtils;
 
@@ -108,7 +94,24 @@ namespace {
       return max(theMeshDS[0]->ShapeToIndex(S), theMeshDS[1]->ShapeToIndex(S) );
     return long(S.TShape().operator->());
   }
-
+  void show_shape( TopoDS_Shape v, const char* msg ) // debug
+  {
+    if ( v.IsNull() ) cout << msg << " NULL SHAPE" << endl;
+    else if (v.ShapeType() == TopAbs_VERTEX) {
+      gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( v ));
+      cout<<msg<<" "<<shapeIndex((v))<<" ( "<<p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;}
+    else {
+      cout << msg << " "; TopAbs::Print((v).ShapeType(),cout) <<" "<<shapeIndex((v))<<endl;}
+  }
+  void show_list( const char* msg, const list< TopoDS_Edge >& l ) // debug
+  {
+    cout << msg << " ";
+    list< TopoDS_Edge >::const_iterator e = l.begin();
+    for ( int i = 0; e != l.end(); ++e, ++i ) {
+      cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") "
+           << i << "E (" << e->TShape().operator->() << "); "; }
+    cout << endl;
+  }
   //================================================================================
   /*!
    * \brief Write shape for debug purposes
@@ -2180,7 +2183,7 @@ FindMatchingNodesOnFaces( const TopoDS_Face&     face1,
           static_cast<const SMDS_EdgePosition*>(node->GetPosition());
         pos2nodes.insert( make_pair( pos->GetUParameter(), node ));
       }
-      if ( pos2nodes.size() != edgeSM->NbNodes() )
+      if ((int) pos2nodes.size() != edgeSM->NbNodes() )
         RETURN_BAD_RESULT("Equal params of nodes on edge "
                           << smDS->ShapeToIndex( edge ) << " of face " << is2 );
     }
index 87572c18f40434ceaa3e70cdc6b57de13e21dd5b..66c8936280fb7271407aa60b095616cb84c763ae 100644 (file)
@@ -423,15 +423,13 @@ namespace {
                   TAssocTool::TNodeNodeMap&          src2tgtNodes,
                   bool&                              is1DComputed)
   {
-    SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS();
-    SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS();
-
     src2tgtNodes.clear();
 
     // get ordered src EDGEs
     TError err;
     srcWires = StdMeshers_FaceSide::GetFaceWires( srcFace, *srcMesh,/*skipMediumNodes=*/0, err);
-    if ( err && !err->IsOK() || srcWires.empty() )
+    if (( err && !err->IsOK() ) ||
+        ( srcWires.empty() ))
       return err;
 
     SMESH_MesherHelper srcHelper( *srcMesh );
@@ -591,7 +589,7 @@ namespace {
         const double minSegLen = srcWires[iW]->Length() / totNbSeg;
         for ( int iE = 0; iE < srcWires[iW]->NbEdges(); ++iE )
         {
-          int nbSeg    = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
+          size_t nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
           double srcU  = srcWires[iW]->FirstParameter( iE );
           double tgtU  = tgtWires[iW]->FirstParameter( iE );
           double srcDu = ( srcWires[iW]->LastParameter( iE )- srcU ) / nbSeg;
@@ -830,7 +828,7 @@ namespace {
           const double minSegLen = srcWires[iW]->Length() / totNbSeg;
           for ( int iE = 0; iE < srcWires[iW]->NbEdges(); ++iE )
           {
-            int nbSeg    = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
+            size_t nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
             double srcU  = srcWires[iW]->FirstParameter( iE );
             double tgtU  = tgtWires[iW]->FirstParameter( iE );
             double srcDu = ( srcWires[iW]->LastParameter( iE )- srcU ) / nbSeg;
@@ -920,6 +918,7 @@ namespace {
             tgtMeshDS->SetNodeOnVertex( n, TopoDS::Vertex( tgtV ));
             break;
           }
+          default:;
           }
           srcN_tgtN->second = n;
         }
@@ -952,7 +951,7 @@ namespace {
   {
     SMESH_Mesh * tgtMesh = tgtWires[0]->GetMesh();
     SMESH_Mesh * srcMesh = srcWires[0]->GetMesh();
-    SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS();
+    //SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS();
     SMESHDS_Mesh * srcMeshDS = srcMesh->GetMeshDS();
 
     if ( srcWires[0]->NbEdges() != 4 )
index 1dc3ace8d998cd48c6ab58b41cf27121eaad05fa..f260a2d6ff12910a6beea50bfc04d7fdf5e05eea 100644 (file)
 
 #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
 #define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
-#define SHOWYXZ(msg, xyz) // {\
-// gp_Pnt p (xyz); \
-// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
-// }
+#define SHOWYXZ(msg, xyz)                                               \
+  //{gp_Pnt p(xyz); cout<<msg<< " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
 
 namespace TAssocTool = StdMeshers_ProjectionUtils;
 
+using namespace std;
 
 //=======================================================================
 //function : StdMeshers_Projection_3D
@@ -295,7 +294,7 @@ bool StdMeshers_Projection_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aS
       shape2ShapeMap.Clear();
       vector< int > edgeIdVec;
       SMESH_Block::GetFaceEdgesIDs( fId, edgeIdVec );
-      for ( int i = 0; i < edgeIdVec.size(); ++i ) {
+      for ( size_t i = 0; i < edgeIdVec.size(); ++i ) {
         int eID = edgeIdVec[ i ];
         shape2ShapeMap.Bind( scrShapes( eID ), tgtShapes( eID ));
         if ( i < 2 ) {
index 5a6c9ade0841ca01ee4b03fc922fe60e8af2bf76..bf67b7a0a416096db3444d72a3695f698519d7e9 100644 (file)
@@ -304,7 +304,7 @@ namespace {
         // Get ordered edges and find index of anE in a sequence
         edges.clear();
         BRepTools_WireExplorer aWE (TopoDS::Wire(itA.Value()));
-        int edgeIndex = 0;
+        size_t edgeIndex = 0;
         for (; aWE.More(); aWE.Next()) {
           TopoDS_Edge edge = aWE.Current();
           edge.Orientation( aWE.Orientation() );
@@ -325,8 +325,8 @@ namespace {
         else {
           // count nb sides
           TopoDS_Edge prevEdge = anE;
-          int nbSide = 0, eIndex = edgeIndex + 1;
-          for ( int i = 0; i < edges.size(); ++i, ++eIndex )
+          size_t nbSide = 0, eIndex = edgeIndex + 1;
+          for ( size_t i = 0; i < edges.size(); ++i, ++eIndex )
           {
             if ( eIndex == edges.size() )
               eIndex = 0;
@@ -633,7 +633,11 @@ namespace {
       }
       return;
     }
+    case MEANINGLESS_LAST: {
+      break;
+    }
     } // switch by SubMeshState
-  }
+
+  } // ProcessEvent()
 
 } // namespace
index a9b924724f4a96cb424121fd43a45c17b7d0a993..acd20284680a90ed6ab0b414249abb79a788b20c 100644 (file)
@@ -61,6 +61,8 @@
 #include <list>
 #include <vector>
 
+using namespace std;
+
 //================================================================================
 /*!
  * \brief 1D algo
@@ -551,7 +553,7 @@ namespace
                                allEdges, theShortEdges[ nbBranchPoints > 0 ] ))
         return false;
 
-      for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints ].size(); ++iS )
+      for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints > 0 ].size(); ++iS )
         shortMap.Add( theShortEdges[ nbBranchPoints ][ iS ]);
 
       ++nbBranchPoints;
@@ -949,7 +951,7 @@ namespace
   {
     const SMDS_MeshNode* _node;
     double               _u;
-    int                  _edgeInd; // index in theSinuEdges vector
+    size_t               _edgeInd; // index in theSinuEdges vector
 
     NodePoint(): _node(0), _u(0), _edgeInd(-1) {}
     NodePoint(const SMDS_MeshNode* n, double u, size_t iEdge ): _node(n), _u(u), _edgeInd(iEdge) {}
@@ -1251,8 +1253,8 @@ namespace
     const vector<TopoDS_Edge>&    theSinuEdges = theSinuFace._sinuEdges;
     const vector< Handle(Geom_Curve) >& curves = theSinuFace._sinuCurves;
 
-    SMESH_MAT2d::BoundaryPoint bp[2];
-    const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0);
+    //SMESH_MAT2d::BoundaryPoint bp[2];
+    //const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0);
 
     typedef TMAPar2NPoints::iterator TIterator;
 
@@ -1292,7 +1294,7 @@ namespace
         {
           // find an existing node on VERTEX among sameU2NP and get underlying EDGEs
           const SMDS_MeshNode* existingNode = 0;
-          set< int > edgeInds;
+          set< size_t > edgeInds;
           NodePoint* np;
           for ( size_t i = 0; i < sameU2NP.size(); ++i )
           {
@@ -1309,7 +1311,7 @@ namespace
           if ( u2NPprev->first < 0. ) ++u2NPprev;
           if ( u2NPnext->first > 1. ) --u2NPnext;
 
-          set< int >::iterator edgeID = edgeInds.begin();
+          set< size_t >::iterator edgeID = edgeInds.begin();
           for ( ; edgeID != edgeInds.end(); ++edgeID )
           {
             // get U range on iEdge within which the equal points will be distributed
@@ -1844,12 +1846,12 @@ namespace
     const double dksi = 0.5, deta = 0.5;
     const double  dksi2 = dksi*dksi, deta2 = deta*deta;
     double err = 0., g11, g22, g12;
-    int nbErr = 0;
+    //int nbErr = 0;
 
     FaceQuadStruct& q = *quad;
     UVPtStruct pNew;
 
-    double refArea = area( q.UVPt(0,0), q.UVPt(1,0), q.UVPt(1,1) );
+    //double refArea = area( q.UVPt(0,0), q.UVPt(1,0), q.UVPt(1,1) );
 
     for ( int iLoop = 0; iLoop < nbLoops; ++iLoop )
     {
index 1832f48e778e815474a8a009c5aaccce10350bfb..5eaaf6609340ca5b5087e9051187002d39a491b5 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "StdMeshers_QuadToTriaAdaptor.hxx"
 
+#include "SMDS_IteratorOnIterators.hxx"
 #include "SMDS_SetIterator.hxx"
 #include "SMESHDS_GroupBase.hxx"
 #include "SMESH_Algo.hxx"
@@ -33,9 +34,9 @@
 
 #include <IntAna_IntConicQuad.hxx>
 #include <IntAna_Quadric.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <TColgp_HArray1OfVec.hxx>
-#include <TColgp_HSequenceOfPnt.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColgp_Array1OfVec.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 #include <gp_Lin.hxx>
@@ -115,20 +116,20 @@ namespace
     gp_Vec nJ = baseVec.Crossed( baJ );
 
     // Check angle between normals
-    double angle = nI.Angle( nJ );
+    double  angle = nI.Angle( nJ );
     bool tooClose = ( angle < 15. * M_PI / 180. );
 
     // Check if pyramids collide
     if ( !tooClose && ( baI * baJ > 0 ) && ( nI * nJ > 0 ))
     {
       // find out if nI points outside of PrmI or inside
-      int dInd = baseNodesIndI[1] - baseNodesIndI[0];
+      int    dInd = baseNodesIndI[1] - baseNodesIndI[0];
       bool isOutI = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
 
-      // find out sign of projection of nJ to baI
+      // find out sign of projection of baI to nJ
       double proj = baI * nJ;
 
-      tooClose = isOutI ? proj > 0 : proj < 0;
+      tooClose = ( isOutI ? proj > 0 : proj < 0 );
     }
 
     // Check if PrmI and PrmJ are in same domain
@@ -170,8 +171,9 @@ namespace
           continue; // f is a base quadrangle
 
         // check projections of face direction (baOFN) to triange normals (nI and nJ)
-        gp_Vec baOFN( base1, SMESH_TNodeXYZ( otherFaceNode ));
-        if ( nI * baOFN > 0 && nJ * baOFN > 0 )
+        gp_Vec baOFN( base2, SMESH_TNodeXYZ( otherFaceNode ));
+        if ( nI * baOFN > 0 && nJ * baOFN > 0 &&
+             baI* baOFN > 0 && baJ* baOFN > 0 ) // issue 0023212
         {
           tooClose = false; // f is between pyramids
           break;
@@ -253,7 +255,6 @@ namespace
       }
     }
   }
-
 }
 
 //================================================================================
@@ -266,6 +267,8 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement*     Pr
                                                   const SMDS_MeshElement*     PrmJ,
                                                   set<const SMDS_MeshNode*> & nodesToMove)
 {
+  // cout << endl << "Merge " << PrmI->GetID() << " " << PrmJ->GetID() << " "
+  //      << PrmI->GetNode(4) << PrmJ->GetNode(4) << endl;
   const SMDS_MeshNode* Nrem = PrmJ->GetNode(4); // node to remove
   //int nbJ = Nrem->NbInverseElements( SMDSAbs_Volume );
   SMESH_TNodeXYZ Pj( Nrem );
@@ -288,7 +291,7 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement*     Pr
   vector< const SMDS_MeshElement* > inverseElems
     // copy inverse elements to avoid iteration on changing container
     ( TStdElemIterator( CommonNode->GetInverseElementIterator(SMDSAbs_Face)), itEnd);
-  for ( unsigned i = 0; i < inverseElems.size(); ++i )
+  for ( size_t i = 0; i < inverseElems.size(); ++i )
   {
     const SMDS_MeshElement* FI = inverseElems[i];
     const SMDS_MeshElement* FJEqual = 0;
@@ -309,11 +312,12 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement*     Pr
   }
 
   // set the common apex node to pyramids and triangles merged with J
+  vector< const SMDS_MeshNode* > nodes;
   inverseElems.assign( TStdElemIterator( Nrem->GetInverseElementIterator()), itEnd );
-  for ( unsigned i = 0; i < inverseElems.size(); ++i )
+  for ( size_t i = 0; i < inverseElems.size(); ++i )
   {
     const SMDS_MeshElement* elem = inverseElems[i];
-    vector< const SMDS_MeshNode* > nodes( elem->begin_nodes(), elem->end_nodes() );
+    nodes.assign( elem->begin_nodes(), elem->end_nodes() );
     nodes[ elem->GetType() == SMDSAbs_Volume ? PYRAM_APEX : TRIA_APEX ] = CommonNode;
     GetMeshDS()->ChangeElementNodes( elem, &nodes[0], nodes.size());
   }
@@ -330,33 +334,34 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement*     Pr
 //================================================================================
 
 void StdMeshers_QuadToTriaAdaptor::MergeAdjacent(const SMDS_MeshElement*    PrmI,
-                                                 set<const SMDS_MeshNode*>& nodesToMove)
+                                                 set<const SMDS_MeshNode*>& nodesToMove,
+                                                 const bool                 isRecursion)
 {
   TIDSortedElemSet adjacentPyrams;
   bool mergedPyrams = false;
-  for(int k=0; k<4; k++) // loop on 4 base nodes of PrmI
+  for ( int k=0; k<4; k++ ) // loop on 4 base nodes of PrmI
   {
-    const SMDS_MeshNode* n = PrmI->GetNode(k);
+    const SMDS_MeshNode*   n = PrmI->GetNode(k);
     SMDS_ElemIteratorPtr vIt = n->GetInverseElementIterator( SMDSAbs_Volume );
     while ( vIt->more() )
     {
       const SMDS_MeshElement* PrmJ = vIt->next();
-      if ( PrmJ->NbCornerNodes() != 5 || !adjacentPyrams.insert( PrmJ ).second  )
+      if ( PrmJ == PrmI || PrmJ->NbCornerNodes() != 5 || !adjacentPyrams.insert( PrmJ ).second  )
         continue;
-      if ( PrmI != PrmJ && TooCloseAdjacent( PrmI, PrmJ, GetMesh()->HasShapeToMesh() ))
+      if ( TooCloseAdjacent( PrmI, PrmJ, GetMesh()->HasShapeToMesh() ))
       {
         MergePiramids( PrmI, PrmJ, nodesToMove );
         mergedPyrams = true;
         // container of inverse elements can change
-        vIt = n->GetInverseElementIterator( SMDSAbs_Volume );
+        // vIt = n->GetInverseElementIterator( SMDSAbs_Volume ); -- iterator re-implemented
       }
     }
   }
-  if ( mergedPyrams )
+  if ( mergedPyrams && !isRecursion )
   {
     TIDSortedElemSet::iterator prm;
     for (prm = adjacentPyrams.begin(); prm != adjacentPyrams.end(); ++prm)
-      MergeAdjacent( *prm, nodesToMove );
+      MergeAdjacent( *prm, nodesToMove, true );
   }
 }
 
@@ -414,79 +419,58 @@ static gp_Pnt FindBestPoint(const gp_Pnt& P1, const gp_Pnt& P2,
 
 //=======================================================================
 //function : HasIntersection3
-//purpose  : Auxilare for HasIntersection()
-//           find intersection point between triangle (P1,P2,P3)
-//           and segment [PC,P]
+//purpose  : Find intersection point between a triangle (P1,P2,P3)
+//           and a segment [PC,P]
 //=======================================================================
 
 static bool HasIntersection3(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
                              const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3)
 {
-  //cout<<"HasIntersection3"<<endl;
-  //cout<<"  PC("<<PC.X()<<","<<PC.Y()<<","<<PC.Z()<<")"<<endl;
-  //cout<<"  P("<<P.X()<<","<<P.Y()<<","<<P.Z()<<")"<<endl;
-  //cout<<"  P1("<<P1.X()<<","<<P1.Y()<<","<<P1.Z()<<")"<<endl;
-  //cout<<"  P2("<<P2.X()<<","<<P2.Y()<<","<<P2.Z()<<")"<<endl;
-  //cout<<"  P3("<<P3.X()<<","<<P3.Y()<<","<<P3.Z()<<")"<<endl;
-  gp_Vec VP1(P1,P2);
-  gp_Vec VP2(P1,P3);
-  IntAna_Quadric IAQ(gp_Pln(P1,VP1.Crossed(VP2)));
-  IntAna_IntConicQuad IAICQ(gp_Lin(PC,gp_Dir(gp_Vec(PC,P))),IAQ);
-  if(IAICQ.IsDone()) {
-    if( IAICQ.IsInQuadric() )
-      return false;
-    if( IAICQ.NbPoints() == 1 ) {
-      gp_Pnt PIn = IAICQ.Point(1);
-      const double preci = 1.e-10 * P.Distance(PC);
-      // check if this point is internal for segment [PC,P]
-      bool IsExternal =
-        ( (PC.X()-PIn.X())*(P.X()-PIn.X()) > preci ) ||
-        ( (PC.Y()-PIn.Y())*(P.Y()-PIn.Y()) > preci ) ||
-        ( (PC.Z()-PIn.Z())*(P.Z()-PIn.Z()) > preci );
-      if(IsExternal) {
-        return false;
-      }
-      // check if this point is internal for triangle (P1,P2,P3)
-      gp_Vec V1(PIn,P1);
-      gp_Vec V2(PIn,P2);
-      gp_Vec V3(PIn,P3);
-      if( V1.Magnitude()<preci ||
-          V2.Magnitude()<preci ||
-          V3.Magnitude()<preci ) {
-        Pint = PIn;
-        return true;
-      }
-      const double angularTol = 1e-6;
-      gp_Vec VC1 = V1.Crossed(V2);
-      gp_Vec VC2 = V2.Crossed(V3);
-      gp_Vec VC3 = V3.Crossed(V1);
-      if(VC1.Magnitude()<gp::Resolution()) {
-        if(VC2.IsOpposite(VC3,angularTol)) {
-          return false;
-        }
-      }
-      else if(VC2.Magnitude()<gp::Resolution()) {
-        if(VC1.IsOpposite(VC3,angularTol)) {
-          return false;
-        }
-      }
-      else if(VC3.Magnitude()<gp::Resolution()) {
-        if(VC1.IsOpposite(VC2,angularTol)) {
-          return false;
-        }
-      }
-      else {
-        if( VC1.IsOpposite(VC2,angularTol) || VC1.IsOpposite(VC3,angularTol) ||
-            VC2.IsOpposite(VC3,angularTol) ) {
-          return false;
-        }
-      }
-      Pint = PIn;
-      return true;
-    }
-  }
+  const double EPSILON = 1e-6;
+  double segLen = P.Distance( PC );
 
-  return false;
+  gp_XYZ  orig = PC.XYZ();
+  gp_XYZ   dir = ( P.XYZ() - PC.XYZ() ) / segLen;
+  gp_XYZ vert0 = P1.XYZ();
+  gp_XYZ vert1 = P2.XYZ();
+  gp_XYZ vert2 = P3.XYZ();
+
+  /* calculate distance from vert0 to ray origin */
+  gp_XYZ  tvec = orig - vert0;
+
+  gp_XYZ edge1 = vert1 - vert0;
+  gp_XYZ edge2 = vert2 - vert0;
+
+  /* begin calculating determinant - also used to calculate U parameter */
+  gp_XYZ pvec = dir ^ edge2;
+
+  /* if determinant is near zero, ray lies in plane of triangle */
+  double det = edge1 * pvec;
+
+  if (det > -EPSILON && det < EPSILON)
+    return false;
+
+  /* calculate U parameter and test bounds */
+  double u = ( tvec * pvec ) / det;
+  //if (u < 0.0 || u > 1.0)
+  if (u < -EPSILON || u > 1.0 + EPSILON)
+    return false;
+
+  /* prepare to test V parameter */
+  gp_XYZ qvec = tvec ^ edge1;
+
+  /* calculate V parameter and test bounds */
+  double v = (dir * qvec) / det;
+  //if ( v < 0.0 || u + v > 1.0 )
+  if ( v < -EPSILON || u + v > 1.0 + EPSILON)
+    return false;
+
+  /* calculate t, ray intersects triangle */
+  double t = (edge2 * qvec) / det;
+
+  Pint = orig + dir * t;
+
+  return ( t > 0.  &&  t < segLen );
 }
 
 //=======================================================================
@@ -495,26 +479,23 @@ static bool HasIntersection3(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
 //=======================================================================
 
 static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
-                            Handle(TColgp_HSequenceOfPnt)& aContour)
+                            TColgp_SequenceOfPnt& aContour)
 {
-  if(aContour->Length()==3) {
-    return HasIntersection3( P, PC, Pint, aContour->Value(1),
-                             aContour->Value(2), aContour->Value(3) );
+  if ( aContour.Length() == 3 ) {
+    return HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) );
   }
   else {
     bool check = false;
-    if( (aContour->Value(1).Distance(aContour->Value(2)) > 1.e-6) &&
-        (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) &&
-        (aContour->Value(2).Distance(aContour->Value(3)) > 1.e-6) ) {
-      check = HasIntersection3( P, PC, Pint, aContour->Value(1),
-                                aContour->Value(2), aContour->Value(3) );
+    if( (aContour(1).Distance(aContour(2)) > 1.e-6) &&
+        (aContour(1).Distance(aContour(3)) > 1.e-6) &&
+        (aContour(2).Distance(aContour(3)) > 1.e-6) ) {
+      check = HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) );
     }
     if(check) return true;
-    if( (aContour->Value(1).Distance(aContour->Value(4)) > 1.e-6) &&
-        (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) &&
-        (aContour->Value(4).Distance(aContour->Value(3)) > 1.e-6) ) {
-      check = HasIntersection3( P, PC, Pint, aContour->Value(1),
-                                aContour->Value(3), aContour->Value(4) );
+    if( (aContour(1).Distance(aContour(4)) > 1.e-6) &&
+        (aContour(1).Distance(aContour(3)) > 1.e-6) &&
+        (aContour(4).Distance(aContour(3)) > 1.e-6) ) {
+      check = HasIntersection3( P, PC, Pint, aContour(1), aContour(3), aContour(4) );
     }
     if(check) return true;
   }
@@ -524,55 +505,99 @@ static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
 
 //================================================================================
 /*!
- * \brief Checks if a line segment (P,PC) intersects any mesh face.
- *  \param P - first segment end
- *  \param PC - second segment end (it is a gravity center of quadrangle)
- *  \param Pint - (out) intersection point
+ * \brief Return allowed height of a pyramid
+ *  \param Papex - optimal pyramid apex
+ *  \param PC - gravity center of a quadrangle
+ *  \param PN - four nodes of the quadrangle
  *  \param aMesh - mesh
- *  \param aShape - shape to check faces on
- *  \param NotCheckedFace - mesh face not to check
- *  \retval bool - true if there is an intersection
+ *  \param NotCheckedFace - the quadrangle face
+ *  \retval double - pyramid height
  */
 //================================================================================
 
-bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt&       P,
-                                                      const gp_Pnt&       PC,
-                                                      gp_Pnt&             Pint,
-                                                      SMESH_Mesh&         aMesh,
-                                                      const TopoDS_Shape& aShape,
-                                                      const SMDS_MeshElement* NotCheckedFace)
+void StdMeshers_QuadToTriaAdaptor::LimitHeight (gp_Pnt&                             Papex,
+                                                const gp_Pnt&                       PC,
+                                                const TColgp_Array1OfPnt&           PN,
+                                                const vector<const SMDS_MeshNode*>& FNodes,
+                                                SMESH_Mesh&                         aMesh,
+                                                const SMDS_MeshElement*             NotCheckedFace,
+                                                const bool                          UseApexRay)
 {
   if ( !myElemSearcher )
     myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() );
   SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
 
-  //SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
-  //cout<<"    CheckIntersection: meshDS->NbFaces() = "<<meshDS->NbFaces()<<endl;
-  bool res = false;
-  double dist = RealLast(); // find intersection closest to the segment
-  gp_Pnt Pres;
+  // Find intersection of faces with (P,PC) segment elongated 3 times
 
-  gp_Ax1 line( P, gp_Vec(P,PC));
-  vector< const SMDS_MeshElement* > suspectElems;
-  searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
+  double height = Papex.Distance( PC );
+  gp_Ax1 line( PC, gp_Vec( PC, Papex ));
+  gp_Pnt Pint, Ptest;
+  vector< const SMDS_MeshElement* > suspectFaces;
+  TColgp_SequenceOfPnt aContour;
 
-  for ( int i = 0; i < suspectElems.size(); ++i )
+  if ( UseApexRay )
   {
-    const SMDS_MeshElement* face = suspectElems[i];
+    // find intersection closest to PC
+    Ptest = PC.XYZ() + line.Direction().XYZ() * height * 3;
+
+    searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces );
+    for ( size_t iF = 0; iF < suspectFaces.size(); ++iF )
+    {
+      const SMDS_MeshElement* face = suspectFaces[iF];
+      if ( face == NotCheckedFace ) continue;
+
+      aContour.Clear();
+      for ( int i = 0, nb = face->NbCornerNodes(); i < nb; ++i )
+        aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) ));
+
+      if ( HasIntersection( Ptest, PC, Pint, aContour ))
+      {
+        double dInt = PC.Distance( Pint );
+        height = Min( height, dInt / 3. );
+      }
+    }
+  }
+
+  // Find faces intersecting triangular facets of the pyramid (issue 23212)
+
+  gp_XYZ center   = PC.XYZ() + line.Direction().XYZ() * height * 0.5;
+  double diameter = Max( PN(1).Distance(PN(3)), PN(2).Distance(PN(4)));
+  suspectFaces.clear();
+  searcher->GetElementsInSphere( center, diameter * 0.6, SMDSAbs_Face, suspectFaces);
+
+  const double upShift = 1.5;
+  Ptest = PC.XYZ() + line.Direction().XYZ() * height * upShift; // tmp apex
+
+  for ( size_t iF = 0; iF < suspectFaces.size(); ++iF )
+  {
+    const SMDS_MeshElement* face = suspectFaces[iF];
     if ( face == NotCheckedFace ) continue;
-    Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
-    for ( int i = 0; i < face->NbCornerNodes(); ++i )
-      aContour->Append( SMESH_TNodeXYZ( face->GetNode(i) ));
-    if( HasIntersection(P, PC, Pres, aContour) ) {
-      res = true;
-      double tmp = PC.Distance(Pres);
-      if(tmp<dist) {
-        Pint = Pres;
-        dist = tmp;
+    if ( face->GetNodeIndex( FNodes[0] ) >= 0 ||
+         face->GetNodeIndex( FNodes[1] ) >= 0 ||
+         face->GetNodeIndex( FNodes[2] ) >= 0 ||
+         face->GetNodeIndex( FNodes[3] ) >= 0 )
+      continue; // neighbor face of the quadrangle
+
+    // limit height using points of intersection of face links with pyramid facets
+    int   nbN = face->NbCornerNodes();
+    gp_Pnt P1 = SMESH_TNodeXYZ( face->GetNode( nbN-1 )); // 1st link end
+    for ( int i = 0; i < nbN; ++i )
+    {
+      gp_Pnt P2 = SMESH_TNodeXYZ( face->GetNode(i) );    // 2nd link end
+
+      for ( int iN = 1; iN <= 4; ++iN ) // loop on pyramid facets
+      {
+        if ( HasIntersection3( P1, P2, Pint, PN(iN), PN(iN+1), Ptest ))
+        {
+          height = Min( height, gp_Vec( PC, Pint ) * line.Direction() );
+          //Ptest = PC.XYZ() + line.Direction().XYZ() * height * upShift; // new tmp apex
+        }
       }
+      P1 = P2;
     }
   }
-  return res;
+
+  Papex  = PC.XYZ() + line.Direction().XYZ() * height;
 }
 
 //================================================================================
@@ -591,8 +616,8 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt&       P,
 //================================================================================
 
 int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement*       face,
-                                              Handle(TColgp_HArray1OfPnt)&  PN,
-                                              Handle(TColgp_HArray1OfVec)&  VN,
+                                              TColgp_Array1OfPnt&           PN,
+                                              TColgp_Array1OfVec&           VN,
                                               vector<const SMDS_MeshNode*>& FNodes,
                                               gp_Pnt&                       PC,
                                               gp_Vec&                       VNorm,
@@ -608,7 +633,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement*       face
   for ( i = 0; i < 4; ++i )
   {
     gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) );
-    PN->SetValue( i+1, p );
+    PN.SetValue( i+1, p );
     xyzC += p;
   }
   PC = xyzC/4;
@@ -619,7 +644,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement*       face
   for(i=1; i<4; i++) {
     j = i+1;
     for(; j<=4; j++) {
-      if( PN->Value(i).Distance(PN->Value(j)) < 1.e-6 )
+      if( PN(i).Distance(PN(j)) < 1.e-6 )
         break;
     }
     if(j<=4) break;
@@ -630,7 +655,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement*       face
   if(i<4) {
     //cout<<"find degeneration"<<endl;
     hasdeg = true;
-    gp_Pnt Pdeg = PN->Value(i);
+    gp_Pnt Pdeg = PN(i);
 
     list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin();
     const SMDS_MeshNode* DegNode = 0;
@@ -651,24 +676,24 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement*       face
       FNodes[i-1] = DegNode;
     }
     for(i=j; i<4; i++) {
-      PN->SetValue(i,PN->Value(i+1));
+      PN.SetValue(i,PN.Value(i+1));
       FNodes[i-1] = FNodes[i];
     }
     nbp = 3;
   }
 
-  PN->SetValue(nbp+1,PN->Value(1));
+  PN.SetValue(nbp+1,PN(1));
   FNodes[nbp] = FNodes[0];
   // find normal direction
-  gp_Vec V1(PC,PN->Value(nbp));
-  gp_Vec V2(PC,PN->Value(1));
+  gp_Vec V1(PC,PN(nbp));
+  gp_Vec V2(PC,PN(1));
   VNorm = V1.Crossed(V2);
-  VN->SetValue(nbp,VNorm);
+  VN.SetValue(nbp,VNorm);
   for(i=1; i<nbp; i++) {
-    V1 = gp_Vec(PC,PN->Value(i));
-    V2 = gp_Vec(PC,PN->Value(i+1));
+    V1 = gp_Vec(PC,PN(i));
+    V2 = gp_Vec(PC,PN(i+1));
     gp_Vec Vtmp = V1.Crossed(V2);
-    VN->SetValue(i,Vtmp);
+    VN.SetValue(i,Vtmp);
     VNorm += Vtmp;
   }
 
@@ -724,25 +749,36 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh&         aMesh,
 
   vector<const SMDS_MeshElement*> myPyramids;
 
+  const SMESHDS_SubMesh * aSubMeshDSFace;
   SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
   SMESH_MesherHelper helper(aMesh);
   helper.IsQuadraticSubMesh(aShape);
   helper.SetElementsOnShape( true );
 
   if ( myElemSearcher ) delete myElemSearcher;
+  vector< SMDS_ElemIteratorPtr > itVec;
   if ( aProxyMesh )
-    myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, aProxyMesh->GetFaces(aShape));
+  {
+    itVec.push_back( aProxyMesh->GetFaces( aShape ));
+  }
   else
-    myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
+  {
+    for ( TopExp_Explorer exp(aShape,TopAbs_FACE); exp.More(); exp.Next() )
+      if (( aSubMeshDSFace = meshDS->MeshElements( exp.Current() )))
+        itVec.push_back( aSubMeshDSFace->GetElements() );
+  }
+  typedef
+    SMDS_IteratorOnIterators< const SMDS_MeshElement*, vector< SMDS_ElemIteratorPtr > > TIter;
+  SMDS_ElemIteratorPtr faceIt( new TIter( itVec ));
+  myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, faceIt );
 
-  const SMESHDS_SubMesh * aSubMeshDSFace;
-  Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
-  Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
+  TColgp_Array1OfPnt PN(1,5);
+  TColgp_Array1OfVec VN(1,4);
   vector<const SMDS_MeshNode*> FNodes(5);
   gp_Pnt PC;
   gp_Vec VNorm;
 
-  for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
+  for ( TopExp_Explorer exp(aShape,TopAbs_FACE); exp.More(); exp.Next() )
   {
     const TopoDS_Shape& aShapeFace = exp.Current();
     if ( aProxyMesh )
@@ -796,9 +832,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh&         aMesh,
             for(; i<=4; i++) {
               gp_Pnt Pbest;
               if(!isRev)
-                Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i).Reversed());
+                Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i).Reversed());
               else
-                Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i));
+                Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i));
               xc += Pbest.X();
               yc += Pbest.Y();
               zc += Pbest.Z();
@@ -807,33 +843,13 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh&         aMesh,
 
             // check PCbest
             double height = PCbest.Distance(PC);
-            if(height<1.e-6) {
+            if ( height < 1.e-6 ) {
               // create new PCbest using a bit shift along VNorm
               PCbest = PC.XYZ() + VNorm.XYZ() * 0.001;
             }
             else {
               // check possible intersection with other faces
-              gp_Pnt Pint;
-              bool check = CheckIntersection(PCbest, PC, Pint, aMesh, aShape, face);
-              if(check) {
-                //cout<<"--PC("<<PC.X()<<","<<PC.Y()<<","<<PC.Z()<<")"<<endl;
-                //cout<<"  PCbest("<<PCbest.X()<<","<<PCbest.Y()<<","<<PCbest.Z()<<")"<<endl;
-                double dist = PC.Distance(Pint)/3.;
-                gp_Dir aDir(gp_Vec(PC,PCbest));
-                PCbest = PC.XYZ() + aDir.XYZ() * dist;
-              }
-              else {
-                gp_Vec VB(PC,PCbest);
-                gp_Pnt PCbestTmp = PC.XYZ() + VB.XYZ() * 3.0;
-                check = CheckIntersection(PCbestTmp, PC, Pint, aMesh, aShape, face);
-                if(check) {
-                  double dist = PC.Distance(Pint)/3.;
-                  if(dist<height) {
-                    gp_Dir aDir(gp_Vec(PC,PCbest));
-                    PCbest = PC.XYZ() + aDir.XYZ() * dist;
-                  }
-                }
-              }
+              LimitHeight( PCbest, PC, PN, FNodes, aMesh, face, /*UseApexRay=*/true );
             }
             // create node for PCbest
             SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
@@ -945,15 +961,17 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
   SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
 
+  TColgp_Array1OfPnt PN(1,5);
+  TColgp_Array1OfVec VN(1,4);
+  vector<const SMDS_MeshNode*> FNodes(5);
+  TColgp_SequenceOfPnt aContour;
+
   SMDS_FaceIteratorPtr fIt = meshDS->facesIterator(/*idInceasingOrder=*/true);
   while( fIt->more())
   {
     const SMDS_MeshElement* face = fIt->next();
     if ( !face ) continue;
     // retrieve needed information about a face
-    Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
-    Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
-    vector<const SMDS_MeshNode*> FNodes(5);
     gp_Pnt PC;
     gp_Vec VNorm;
     const SMDS_MeshElement* volumes[2];
@@ -970,7 +988,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
       SMDS_MeshFace* NewFace;
 
       // check orientation
-      double tmp = PN->Value(1).Distance(PN->Value(2)) + PN->Value(2).Distance(PN->Value(3));
+      double tmp = PN(1).Distance(PN(2)) + PN(2).Distance(PN(3));
       // far points in VNorm direction
       gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6;
       gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6;
@@ -983,28 +1001,28 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
       gp_Pnt Pres1,Pres2;
 
       gp_Ax1 line( PC, VNorm );
-      vector< const SMDS_MeshElement* > suspectElems;
-      searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
+      vector< const SMDS_MeshElement* > suspectFaces;
+      searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces);
 
-      for ( int iF = 0; iF < suspectElems.size(); ++iF ) {
-        const SMDS_MeshElement* F = suspectElems[iF];
-        if(F==face) continue;
-        Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
+      for ( size_t iF = 0; iF < suspectFaces.size(); ++iF ) {
+        const SMDS_MeshElement* F = suspectFaces[iF];
+        if ( F == face ) continue;
+        aContour.Clear();
         for ( int i = 0; i < 4; ++i )
-          aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
+          aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) ));
         gp_Pnt PPP;
-        if( !volumes[0] && HasIntersection(Ptmp1, PC, PPP, aContour) ) {
+        if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) {
           IsOK1 = true;
           double tmp = PC.Distance(PPP);
-          if(tmp<dist1) {
+          if ( tmp < dist1 ) {
             Pres1 = PPP;
             dist1 = tmp;
           }
         }
-        if( !volumes[1] && HasIntersection(Ptmp2, PC, PPP, aContour) ) {
+        if ( !volumes[1] && HasIntersection( Ptmp2, PC, PPP, aContour )) {
           IsOK2 = true;
           double tmp = PC.Distance(PPP);
-          if(tmp<dist2) {
+          if ( tmp < dist2 ) {
             Pres2 = PPP;
             dist2 = tmp;
           }
@@ -1038,14 +1056,16 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
       continue;
     }
 
+    // -----------------------------------
     // Case of non-degenerated quadrangle
+    // -----------------------------------
 
     // Find pyramid peak
 
     gp_XYZ PCbest(0., 0., 0.); // pyramid peak
     int i = 1;
-    for(; i<=4; i++) {
-      gp_Pnt Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i));
+    for ( ; i <= 4; i++ ) {
+      gp_Pnt Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i));
       PCbest += Pbest.XYZ();
     }
     PCbest /= 4;
@@ -1061,7 +1081,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
 
     // Restrict pyramid height by intersection with other faces
     gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize();
-    double tmp = PN->Value(1).Distance(PN->Value(3)) + PN->Value(2).Distance(PN->Value(4));
+    double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4));
     // far points: in (PC, PCbest) direction and vice-versa
     gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6,
                          PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 };
@@ -1071,17 +1091,17 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     gp_Pnt intPnt[2];
 
     gp_Ax1 line( PC, tmpDir );
-    vector< const SMDS_MeshElement* > suspectElems;
-    searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
+    vector< const SMDS_MeshElement* > suspectFaces;
+    searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces);
 
-    for ( int iF = 0; iF < suspectElems.size(); ++iF )
+    for ( size_t iF = 0; iF < suspectFaces.size(); ++iF )
     {
-      const SMDS_MeshElement* F = suspectElems[iF];
-      if(F==face) continue;
-      Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
-      int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 );
+      const SMDS_MeshElement* F = suspectFaces[iF];
+      if ( F == face ) continue;
+      aContour.Clear();
+      int nbN = F->NbCornerNodes();
       for ( i = 0; i < nbN; ++i )
-        aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
+        aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) ));
       gp_Pnt intP;
       for ( int isRev = 0; isRev < 2; ++isRev )
       {
@@ -1121,13 +1141,15 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     {
       if( !intersected[isRev] ) continue;
       double pyramidH = Min( height, PC.Distance(intPnt[isRev])/3.);
-      PCbest = PC.XYZ() + tmpDir.XYZ() * (isRev ? -pyramidH : pyramidH);
+      gp_Pnt Papex = PC.XYZ() + tmpDir.XYZ() * (isRev ? -pyramidH : pyramidH);
+
+      LimitHeight( Papex, PC, PN, FNodes, aMesh, face, /*UseApexRay=*/false );
 
-      // create node for PCbest
-      SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
+      // create node for Papex
+      SMDS_MeshNode* NewNode = helper.AddNode( Papex.X(), Papex.Y(), Papex.Z() );
 
       // add triangles to result map
-      for(i=0; i<4; i++) {
+      for ( i = 0; i < 4; i++) {
         SMDS_MeshFace* NewFace;
         if(isRev)
           NewFace = meshDS->AddFace( NewNode, FNodes[i], FNodes[i+1] );
@@ -1158,15 +1180,19 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
 bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh&                            aMesh,
                                                   const vector<const SMDS_MeshElement*>& myPyramids)
 {
-  if(myPyramids.empty())
+  if ( myPyramids.empty() )
     return true;
 
   SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
-  int i, j, k, myShapeID = myPyramids[0]->GetNode(4)->getshapeId();
-
-  if ( myElemSearcher ) delete myElemSearcher;
-  myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
-  SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
+  size_t i, j, k;
+  //int myShapeID = myPyramids[0]->GetNode(4)->getshapeId();
+  {
+    SMDS_ElemIteratorPtr
+      pyramIt( new SMDS_ElementVectorIterator( myPyramids.begin(), myPyramids.end() ));
+    if ( myElemSearcher ) delete myElemSearcher;
+    myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, pyramIt );
+  }
+  SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>( myElemSearcher );
 
   set<const SMDS_MeshNode*> nodesToMove;
 
@@ -1178,17 +1204,19 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh&
     MergeAdjacent( PrmI, nodesToMove );
   }
 
-  // iterate on all pyramids
+  // iterate on all new pyramids
+  vector< const SMDS_MeshElement* > suspectPyrams;
   for ( i = 0; i <  myPyramids.size(); ++i )
   {
-    const SMDS_MeshElement* PrmI = myPyramids[i];
+    const SMDS_MeshElement*  PrmI = myPyramids[i];
+    const SMDS_MeshNode*    apexI = PrmI->GetNode( PYRAM_APEX );
 
     // compare PrmI with all the rest pyramids
 
     // collect adjacent pyramids and nodes coordinates of PrmI
     set<const SMDS_MeshElement*> checkedPyrams;
-    vector<gp_Pnt> PsI(5);
-    for(k=0; k<5; k++) // loop on 4 base nodes of PrmI
+    gp_Pnt PsI[5];
+    for ( k = 0; k < 5; k++ )
     {
       const SMDS_MeshNode* n = PrmI->GetNode(k);
       PsI[k] = SMESH_TNodeXYZ( n );
@@ -1201,70 +1229,77 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh&
       }
     }
 
+    // get pyramids to check
+    gp_XYZ       PC = ( PsI[0].XYZ() + PsI[1].XYZ() + PsI[2].XYZ() + PsI[3].XYZ() ) / 4.;
+    gp_XYZ      ray = PsI[4].XYZ() - PC;
+    gp_XYZ   center = PC + 0.5 * ray;
+    double diameter = Max( PsI[0].Distance(PsI[2]), PsI[1].Distance(PsI[3]));
+    suspectPyrams.clear();
+    searcher->GetElementsInSphere( center, diameter * 0.6, SMDSAbs_Volume, suspectPyrams);
+
     // check intersection with distant pyramids
-    for(k=0; k<4; k++) // loop on 4 base nodes of PrmI
+    for ( j = 0; j < suspectPyrams.size(); ++j )
     {
-      gp_Vec Vtmp(PsI[k],PsI[4]);
-      gp_Ax1 line( PsI[k], Vtmp );
-      vector< const SMDS_MeshElement* > suspectPyrams;
-      searcher->GetElementsNearLine( line, SMDSAbs_Volume, suspectPyrams);
+      const SMDS_MeshElement* PrmJ = suspectPyrams[j];
+      if ( PrmJ == PrmI )
+        continue;
+      if ( apexI == PrmJ->GetNode( PYRAM_APEX ))
+        continue; // pyramids PrmI and PrmJ already merged
+      if ( !checkedPyrams.insert( PrmJ ).second )
+        continue; // already checked
 
-      for ( j = 0; j < suspectPyrams.size(); ++j )
-      {
-        const SMDS_MeshElement* PrmJ = suspectPyrams[j];
-        if ( PrmJ == PrmI || PrmJ->NbCornerNodes() != 5 )
-          continue;
-        if ( myShapeID != PrmJ->GetNode(4)->getshapeId())
-          continue; // pyramid from other SOLID
-        if ( PrmI->GetNode(4) == PrmJ->GetNode(4) )
-          continue; // pyramids PrmI and PrmJ already merged
-        if ( !checkedPyrams.insert( PrmJ ).second )
-          continue; // already checked
-
-        TXyzIterator xyzIt( PrmJ->nodesIterator() );
-        vector<gp_Pnt> PsJ( xyzIt, TXyzIterator() );
+      gp_Pnt PsJ[5];
+      for ( k = 0; k < 5; k++ )
+        PsJ[k] = SMESH_TNodeXYZ( PrmJ->GetNode(k) );
 
+      if ( ray * ( PsJ[4].XYZ() - PC ) < 0. )
+        continue; // PrmJ is below PrmI
+
+      for ( k = 0; k < 4; k++ ) // loop on 4 base nodes of PrmI
+      {
         gp_Pnt Pint;
         bool hasInt=false;
-        for(k=0; k<4 && !hasInt; k++) {
-          gp_Vec Vtmp(PsI[k],PsI[4]);
+        for ( k = 0; k < 4  &&  !hasInt; k++ )
+        {
+          gp_Vec Vtmp( PsI[k], PsI[ PYRAM_APEX ]);
           gp_Pnt Pshift = PsI[k].XYZ() + Vtmp.XYZ() * 0.01; // base node moved a bit to apex
           hasInt =
-          ( HasIntersection3( Pshift, PsI[4], Pint, PsJ[0], PsJ[1], PsJ[4]) ||
-            HasIntersection3( Pshift, PsI[4], Pint, PsJ[1], PsJ[2], PsJ[4]) ||
-            HasIntersection3( Pshift, PsI[4], Pint, PsJ[2], PsJ[3], PsJ[4]) ||
-            HasIntersection3( Pshift, PsI[4], Pint, PsJ[3], PsJ[0], PsJ[4]) );
+          ( HasIntersection3( Pshift, PsI[4], Pint, PsJ[0], PsJ[1], PsJ[PYRAM_APEX]) ||
+            HasIntersection3( Pshift, PsI[4], Pint, PsJ[1], PsJ[2], PsJ[PYRAM_APEX]) ||
+            HasIntersection3( Pshift, PsI[4], Pint, PsJ[2], PsJ[3], PsJ[PYRAM_APEX]) ||
+            HasIntersection3( Pshift, PsI[4], Pint, PsJ[3], PsJ[0], PsJ[PYRAM_APEX]) );
         }
-        for(k=0; k<4 && !hasInt; k++) {
-          gp_Vec Vtmp(PsJ[k],PsJ[4]);
+        for ( k = 0; k < 4  &&  !hasInt; k++ )
+        {
+          gp_Vec Vtmp( PsJ[k], PsJ[ PYRAM_APEX ]);
           gp_Pnt Pshift = PsJ[k].XYZ() + Vtmp.XYZ() * 0.01;
           hasInt =
-            ( HasIntersection3( Pshift, PsJ[4], Pint, PsI[0], PsI[1], PsI[4]) ||
-              HasIntersection3( Pshift, PsJ[4], Pint, PsI[1], PsI[2], PsI[4]) ||
-              HasIntersection3( Pshift, PsJ[4], Pint, PsI[2], PsI[3], PsI[4]) ||
-              HasIntersection3( Pshift, PsJ[4], Pint, PsI[3], PsI[0], PsI[4]) );
+            ( HasIntersection3( Pshift, PsJ[4], Pint, PsI[0], PsI[1], PsI[PYRAM_APEX]) ||
+              HasIntersection3( Pshift, PsJ[4], Pint, PsI[1], PsI[2], PsI[PYRAM_APEX]) ||
+              HasIntersection3( Pshift, PsJ[4], Pint, PsI[2], PsI[3], PsI[PYRAM_APEX]) ||
+              HasIntersection3( Pshift, PsJ[4], Pint, PsI[3], PsI[0], PsI[PYRAM_APEX]) );
         }
 
         if ( hasInt )
         {
           // count common nodes of base faces of two pyramids
           int nbc = 0;
-          for (k=0; k<4; k++)
+          for ( k = 0; k < 4; k++ )
             nbc += int ( PrmI->GetNodeIndex( PrmJ->GetNode(k) ) >= 0 );
 
           if ( nbc == 4 )
             continue; // pyrams have a common base face
 
-          if(nbc>0)
+          if ( nbc > 0 )
           {
             // Merge the two pyramids and others already merged with them
             MergePiramids( PrmI, PrmJ, nodesToMove );
           }
-          else { // nbc==0
-
+          else  // nbc==0
+          {
             // decrease height of pyramids
             gp_XYZ PCi(0,0,0), PCj(0,0,0);
-            for(k=0; k<4; k++) {
+            for ( k = 0; k < 4; k++ ) {
               PCi += PsI[k].XYZ();
               PCj += PsJ[k].XYZ();
             }
@@ -1283,9 +1318,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh&
 
             VN1.Scale(coef1);
             VN2.Scale(coef2);
-            SMDS_MeshNode* aNode1 = const_cast<SMDS_MeshNode*>(PrmI->GetNode(4));
+            SMDS_MeshNode* aNode1 = const_cast<SMDS_MeshNode*>( apexI );
             aNode1->setXYZ( PCi.X()+VN1.X(), PCi.Y()+VN1.Y(), PCi.Z()+VN1.Z() );
-            SMDS_MeshNode* aNode2 = const_cast<SMDS_MeshNode*>(PrmJ->GetNode(4));
+            SMDS_MeshNode* aNode2 = const_cast<SMDS_MeshNode*>(PrmJ->GetNode( PYRAM_APEX ));
             aNode2->setXYZ( PCj.X()+VN2.X(), PCj.Y()+VN2.Y(), PCj.Z()+VN2.Z() );
             nodesToMove.insert( aNode1 );
             nodesToMove.insert( aNode2 );
index c1082f7ce8625b481498130842aef10f03e191a1..3c2807a14387e1e174a19d65477a40b06820ec01 100644 (file)
@@ -32,8 +32,8 @@ class SMESH_ElementSearcher;
 class SMDS_MeshElement;
 class SMDS_MeshNode;
 class SMDS_MeshFace;
-class Handle_TColgp_HArray1OfPnt;
-class Handle_TColgp_HArray1OfVec;
+class TColgp_Array1OfPnt;
+class TColgp_Array1OfVec;
 class gp_Pnt;
 class gp_Vec;
 
@@ -65,16 +65,19 @@ public:
 protected:
 
   int Preparation(const SMDS_MeshElement* face,
-                  Handle_TColgp_HArray1OfPnt& PN,
-                  Handle_TColgp_HArray1OfVec& VN,
+                  TColgp_Array1OfPnt& PN,
+                  TColgp_Array1OfVec& VN,
                   std::vector<const SMDS_MeshNode*>& FNodes,
                   gp_Pnt& PC, gp_Vec& VNorm,
                   const SMDS_MeshElement** volumes=0);
 
-  bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC,
-                         gp_Pnt& Pint, SMESH_Mesh& aMesh,
-                         const TopoDS_Shape& aShape,
-                         const SMDS_MeshElement* NotCheckedFace);
+  void LimitHeight (gp_Pnt&                                  Papex,
+                    const gp_Pnt&                            PC,
+                    const TColgp_Array1OfPnt&                PN,
+                    const std::vector<const SMDS_MeshNode*>& FNodes,
+                    SMESH_Mesh&                              aMesh,
+                    const SMDS_MeshElement*                  NotCheckedFace,
+                    const bool                               UseApexRay);
 
   bool Compute2ndPart(SMESH_Mesh&                                 aMesh,
                       const std::vector<const SMDS_MeshElement*>& pyramids);
@@ -85,7 +88,8 @@ protected:
                       std::set<const SMDS_MeshNode*> & nodesToMove);
 
   void MergeAdjacent(const SMDS_MeshElement*         PrmI,
-                     std::set<const SMDS_MeshNode*>& nodesToMove);
+                     std::set<const SMDS_MeshNode*>& nodesToMove,
+                     const bool                      isRecursion = false);
 
 
   TopoDS_Shape                      myShape;
index 708b9a2fabdf3777285dd0baf4f0da7d7afa350a..9ba7ec23a19b8d072bea83c27d83a4c49d1fc8ea 100644 (file)
@@ -153,16 +153,16 @@ ostream & StdMeshers_QuadrangleParams::SaveTo(ostream & save)
 istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load)
 {
   bool isOK = true;
-  isOK = (load >> _triaVertexID);
+  isOK = static_cast<bool>(load >> _triaVertexID);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
 
-  isOK = (load >> _objEntry);
+  isOK = static_cast<bool>(load >> _objEntry);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
 
   int type;
-  isOK = (load >> type);
+  isOK = static_cast<bool>(load >> type);
   if (isOK)
     _quadType = StdMeshers_QuadType(type);
 
index f7ac411d9a55673e25cf2f6eccb77454b0248f49..e55edf26aff59ab6801d8cfde585549c1099f8a4 100644 (file)
@@ -132,8 +132,7 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis
   myParams               = NULL;
   myQuadList.clear();
 
-  bool isOk = true;
-  aStatus   = SMESH_Hypothesis::HYP_OK;
+  aStatus = SMESH_Hypothesis::HYP_OK;
 
   const list <const SMESHDS_Hypothesis * >& hyps =
     GetUsedHypothesis(aMesh, aShape, false);
@@ -1782,10 +1781,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh &        aMesh,
   //       0  bottom  1
 
 
-  const int bfrom = quad->side[0].from;
-  const int rfrom = quad->side[1].from;
+  //const int bfrom = quad->side[0].from;
+  //const int rfrom = quad->side[1].from;
   const int tfrom = quad->side[2].from;
-  const int lfrom = quad->side[3].from;
+  //const int lfrom = quad->side[3].from;
   {
     const vector<UVPtStruct>& uv_eb_vec = quad->side[0].GetUVPtStruct(true,0);
     const vector<UVPtStruct>& uv_er_vec = quad->side[1].GetUVPtStruct(false,1);
@@ -1926,10 +1925,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh &        aMesh,
 
     } // if ( dv != 0 && dh != 0 )
 
-    const int db = quad->side[0].IsReversed() ? -1 : +1;
-    const int dr = quad->side[1].IsReversed() ? -1 : +1;
+    //const int db = quad->side[0].IsReversed() ? -1 : +1;
+    //const int dr = quad->side[1].IsReversed() ? -1 : +1;
     const int dt = quad->side[2].IsReversed() ? -1 : +1;
-    const int dl = quad->side[3].IsReversed() ? -1 : +1;
+    //const int dl = quad->side[3].IsReversed() ? -1 : +1;
 
     // Case dv == 0,  here possibly myQuadList.size() > 1
     //
@@ -2971,7 +2970,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh &        aMesh,
     const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
     const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
 
-    if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
+    if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr ||
+        (int) uv_et.size() != nt || (int) uv_el.size() != nl)
       return error(COMPERR_BAD_INPUT_MESH);
 
     // arrays for normalized params
@@ -3284,7 +3284,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh &        aMesh,
     const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
     const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
 
-    if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
+    if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr ||
+        (int) uv_et.size() != nt || (int) uv_el.size() != nl)
       return error(COMPERR_BAD_INPUT_MESH);
 
     gp_UV uv[ UV_SIZE ];
@@ -4219,7 +4220,7 @@ bool StdMeshers_Quadrangle_2D::check()
   return isOK;
 }
 
-/*//================================================================================
+//================================================================================
 /*!
  * \brief Finds vertices at the most sharp face corners
  *  \param [in] theFace - the FACE
@@ -4338,7 +4339,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
 
   // check if there are possible variations in choosing corners
   bool haveVariants = false;
-  if ( vertexByAngle.size() > nbCorners )
+  if ((int) vertexByAngle.size() > nbCorners )
   {
     double lostAngle = a2v->first;
     double lastAngle = ( --a2v, a2v->first );
@@ -4346,7 +4347,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
   }
 
   const double angleTol = 5.* M_PI/180;
-  myCheckOri = ( vertexByAngle.size() > nbCorners ||
+  myCheckOri = ( (int)vertexByAngle.size() > nbCorners ||
                  vertexByAngle.begin()->first < angleTol );
 
   // make theWire begin from a corner vertex or triaVertex
@@ -4476,7 +4477,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
       {
         // select two halfDivider's as corners
         TGeoIndex hd1, hd2 = -1;
-        int iC2;
+        size_t iC2;
         for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 )
         {
           hd1 = cornerInd[ iC2 ];
@@ -4522,10 +4523,10 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
         vector< double > accuLength;
         double totalLen = 0;
         vector< TGeoIndex > evVec( equVerts.begin(), equVerts.end() );
-        int          iEV = 0;
+        size_t      iEV = 0;
         TGeoIndex    iE = cornerInd[ helper.WrapIndex( iC - nbC[0] - 1, cornerInd.size() )];
         TGeoIndex iEEnd = cornerInd[ helper.WrapIndex( iC + nbC[1] + 1, cornerInd.size() )];
-        while ( accuLength.size() < nbEqualV + int( !allCornersSame ) )
+        while ((int) accuLength.size() < nbEqualV + int( !allCornersSame ) )
         {
           // accumulate length of edges before iEV-th equal vertex
           accuLength.push_back( totalLen );
@@ -4604,7 +4605,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
 //================================================================================
 
 FaceQuadStruct::Side::Side(StdMeshers_FaceSidePtr theGrid)
-  : grid(theGrid), nbNodeOut(0), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1)
+  : grid(theGrid), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1), nbNodeOut(0)
 {
 }
 
@@ -4781,8 +4782,6 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
       quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt );
     }
 
-  SMESH_Mesh*          mesh = myHelper->GetMesh();
-  SMESHDS_Mesh*      meshDS = myHelper->GetMeshDS();
   const TopoDS_Face&   face = TopoDS::Face( myHelper->GetSubShape() );
   Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
 
@@ -4962,8 +4961,8 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
           continue;
         const vector<UVPtStruct>& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct();
         const UVPtStruct&         uvPt  = points[ side.contacts[iC].point ];
-        if ( side.contacts[iC].other_point >= oGrid .size() ||
-             side.contacts[iC].point       >= points.size() )
+        if ( side.contacts[iC].other_point >= (int) oGrid .size() ||
+             side.contacts[iC].point       >= (int) points.size() )
           throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" );
         if ( oGrid[ side.contacts[iC].other_point ].node )
           (( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node;
@@ -5119,9 +5118,9 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side&  side,
     return;
   }
 
-  const int iFrom    = Min ( iForced, *iNext );
-  const int iTo      = Max ( iForced, *iNext ) + 1;
-  const int sideSize = iTo - iFrom;
+  const int    iFrom    = Min ( iForced, *iNext );
+  const int    iTo      = Max ( iForced, *iNext ) + 1;
+  const size_t sideSize = iTo - iFrom;
 
   vector<UVPtStruct> points[4]; // side points of a temporary quad
 
@@ -5131,7 +5130,7 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side&  side,
   for ( int is2nd = 0; is2nd < 2; ++is2nd )
   {
     points[ is2nd ].reserve( sideSize );
-    int nbLoops = 0;
+    size_t nbLoops = 0;
     while ( points[is2nd].size() < sideSize )
     {
       int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() );
@@ -5625,8 +5624,8 @@ bool FaceQuadStruct::Side::IsForced( int nodeIndex ) const
 
 void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop )
 {
-  if ( ip  >= GetUVPtStruct().size()      ||
-       iop >= side->GetUVPtStruct().size() )
+  if ( ip  >= (int) GetUVPtStruct().size()      ||
+       iop >= (int) side->GetUVPtStruct().size() )
     throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" );
   if ( ip < from || ip >= to )
     return;
index 460a5e4ab7fbbd948b0f064face9a77f1f42be1b..936a5e1c235f57c45faf28eb85a7c3325064f323 100644 (file)
@@ -82,7 +82,7 @@ struct FaceQuadStruct
       return GetUVPtStruct()[ to-nbNodeOut-(IsReversed() ? -1 : +1)];
     }
     // some sortcuts
-    const vector<UVPtStruct>& GetUVPtStruct(bool isXConst=0, double constValue=0) const
+    const std::vector<UVPtStruct>& GetUVPtStruct(bool isXConst=0, double constValue=0) const
     { return nbNodeOut ?
         grid->SimulateUVPtStruct( NbPoints()-nbNodeOut-1, isXConst, constValue ) :
         grid->GetUVPtStruct( isXConst, constValue );
index 3334af950e7b1ab61dbb8a95dee0bf798767c240..9ac099c2d5796921329dfc1de0c10729e0d9914f 100644 (file)
@@ -598,7 +598,6 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh,
 
 bool StdMeshers_RadialPrism_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
 {
-  bool isCurShellApp;
   int nbFoundSolids = 0;
   for (TopExp_Explorer exp( aShape, TopAbs_SOLID ); exp.More(); exp.Next(), ++nbFoundSolids )
   {
index 03395bd108806aa396c50e9fd5909e31afeefa6b..b861f3701c87d909fc01924f1445e02bc75b9e38 100644 (file)
@@ -537,8 +537,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
     gp_Vec2d aVec2d(PC,p2dV);
     Nodes1.resize( myLayerPositions.size()+1 );
     Nodes2.resize( myLayerPositions.size()+1 );
-    int i = 0;
-    for(; i<myLayerPositions.size(); i++) {
+    size_t i = 0;
+    for ( ; i < myLayerPositions.size(); i++ ) {
       gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
                 P0.Y() + aVec.Y()*myLayerPositions[i],
                 P0.Z() + aVec.Z()*myLayerPositions[i] );
@@ -648,7 +648,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
       meshDS->SetNodeOnEdge(NC, edgeID, cp);
       Nodes1.resize( myLayerPositions.size()+1 );
       Nodes2.resize( myLayerPositions.size()+1 );
-      int i = 0;
+      size_t i = 0;
       for(; i<myLayerPositions.size(); i++) {
         gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
                   P0.Y() + aVec.Y()*myLayerPositions[i],
@@ -774,8 +774,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
       bool nodesFromP0ToP1 = ( theNodes.rbegin()->second == NF );
       NC = const_cast<SMDS_MeshNode*>
         ( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second );
-      int i = 0, ir = Nodes1.size()-1;
-      int * pi = nodesFromP0ToP1 ? &i : &ir;
+      size_t i = 0, ir = Nodes1.size()-1;
+      size_t * pi = nodesFromP0ToP1 ? &i : &ir;
       itn = theNodes.begin();
       if ( nodesFromP0ToP1 ) ++itn;
       for ( ; i < Nodes1.size(); ++i, --ir, ++itn )
@@ -817,8 +817,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
         meshDS->SetNodeOnVertex(NC, vertID);
       }
       double dp = lp-fp;
-      int i = 0;
-      for(; i<myLayerPositions.size(); i++) {
+      size_t i = 0;
+      for ( ; i < myLayerPositions.size(); i++ ) {
         gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
                   P0.Y() + aVec.Y()*myLayerPositions[i],
                   P0.Z() + aVec.Z()*myLayerPositions[i] );
@@ -826,7 +826,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
         SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
         Nodes1[i] = node;
         double param;
-        if(!ori)
+        if ( !ori )
           param = fp + dp*(1-myLayerPositions[i]);
         else
           param = fp + dp*myLayerPositions[i];
@@ -840,11 +840,11 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
       // create 1D elements on edge
       SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] );
       if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
-      for(i=1; i<Nodes1.size(); i++) {
+      for ( i = 1; i < Nodes1.size(); i++ ) {
         ME = myHelper->AddEdge( Nodes1[i-1], Nodes1[i] );
         if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
       }
-      if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
+      if ( nbe == 2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
         Nodes2 = Nodes1;
     }
     markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
@@ -856,8 +856,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
         return error("Invalid mesh on a straight edge");
 
       bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL );
-      int i = 0, ir = Nodes1.size()-1;
-      int * pi = nodesFromP0ToP2 ? &i : &ir;
+      size_t i = 0, ir = Nodes1.size()-1;
+      size_t * pi = nodesFromP0ToP2 ? &i : &ir;
       itn = theNodes.begin();
       if ( nodesFromP0ToP2 ) ++itn;
       for ( ; i < Nodes2.size(); ++i, --ir, ++itn )
@@ -886,7 +886,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
         PC = PL;
       }
       double dp = lp-fp;
-      for(int i=0; i<myLayerPositions.size(); i++) {
+      for ( size_t i = 0; i < myLayerPositions.size(); i++ ) {
         gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
                   P0.Y() + aVec.Y()*myLayerPositions[i],
                   P0.Z() + aVec.Z()*myLayerPositions[i] );
@@ -905,8 +905,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
       Nodes2[ myLayerPositions.size() ] = NL;
       // create 1D elements on edge
       SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes2[0] );
-      if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
-      for(int i=1; i<Nodes2.size(); i++) {
+      if ( ME ) meshDS->SetMeshElementOnShape(ME, edgeID);
+      for ( size_t i = 1; i < Nodes2.size(); i++ ) {
         ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] );
         if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
       }
@@ -930,7 +930,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
   //cout<<"Angles.Length() = "<<Angles.Length()<<"   Points.Length() = "<<Points.Length()<<endl;
   //cout<<"Nodes1.size() = "<<Nodes1.size()<<"   Pnts2d1.Length() = "<<Pnts2d1.Length()<<endl;
   for(; i<Angles.Length(); i++) {
-    vector< const SMDS_MeshNode* > tmpNodes(Nodes1.size());
+    vector< const SMDS_MeshNode* > tmpNodes;
     gp_Trsf aTrsf;
     gp_Ax1 theAxis(P0,gp_Dir(Axis));
     aTrsf.SetRotation( theAxis, Angles.Value(i) );
@@ -948,12 +948,12 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
       aTrsf2d.Transforms( cx, cy );
       // set node on face
       meshDS->SetNodeOnFace( node, faceID, cx, cy );
-      tmpNodes[j-1] = node;
+      tmpNodes.push_back(node);
     }
     // create faces
-    tmpNodes[Points.Length()] = CNodes[i];
+    tmpNodes.push_back( CNodes[i] );
     // quad
-    for(j=0; j<Nodes1.size()-1; j++) {
+    for ( j = 0; j < (int)Nodes1.size() - 1; j++ ) {
       SMDS_MeshFace* MF;
       if(IsForward)
         MF = myHelper->AddFace( tmpNodes[j], Nodes1[j],
@@ -969,14 +969,14 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
       MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] );
     else
       MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] );
-    if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
-    for(j=0; j<Nodes1.size(); j++) {
+    if ( MF ) meshDS->SetMeshElementOnShape(MF, faceID);
+    for ( j = 0; j < (int) Nodes1.size(); j++ ) {
       Nodes1[j] = tmpNodes[j];
     }
   }
   // create last faces
   // quad
-  for(i=0; i<Nodes1.size()-1; i++) {
+  for ( i = 0; i < (int)Nodes1.size()-1; i++ ) {
     SMDS_MeshFace* MF;
     if(IsForward)
       MF = myHelper->AddFace( Nodes2[i], Nodes1[i],
@@ -1106,7 +1106,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt&
       }
       else {
         
-        if ( myLayerPositions.size() != nbNodes )
+        if ((int) myLayerPositions.size() != nbNodes )
           return error("Radial edge is meshed by other algorithm");
       }
     }
@@ -1196,7 +1196,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
     ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) );
     if ( !ok ) {
       const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
-      ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+      ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
     }
     if(ok) {
       ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
@@ -1243,7 +1243,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
       // other curve not line
       return error(COMPERR_BAD_SHAPE);
     }
-    int nbLayers = myLayerPositions.size();
+    size_t nbLayers = myLayerPositions.size();
     computeLayerPositions( P0, P1, LinEdge2 );
     if ( nbLayers != myLayerPositions.size() )
       return error("Different hypotheses apply to radial edges");
@@ -1254,7 +1254,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
         ok = true; // override other 1d hyps
       else {
         const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
-        ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+        ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
       }
     }
     if( ok && aResMap.count( aMesh.GetSubMesh(LinEdge2) )) {
@@ -1262,7 +1262,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
         ok = true; // override other 1d hyps
       else {
         const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ];
-        ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+        ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
       }
     }
     if(ok) {
index 73f11aff59838b56942fbddde96630ed2ad443a3..413a9249439750c71c91cc85d961dfc3a2a1935c 100644 (file)
@@ -343,9 +343,9 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh&         aMesh,
   return ( aStatus == SMESH_Hypothesis::HYP_OK );
 }
 
-static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last,
-                               double length, bool theReverse,
-                               int nbSeg, Function& func,
+static bool computeParamByFunc(Adaptor3d_Curve& C3d,
+                               double first, double last, double length,
+                               bool theReverse, int nbSeg, Function& func,
                                list<double>& theParams)
 {
   // never do this way
@@ -359,31 +359,23 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last,
   int nbPnt = 1 + nbSeg;
   vector<double> x(nbPnt, 0.);
 
-  if (!buildDistribution(func, 0.0, 1.0, nbSeg, x, 1E-4))
+  if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, 1E-4 ))
      return false;
 
-  MESSAGE( "Points:\n" );
-  char buf[1024];
-  for ( int i=0; i<=nbSeg; i++ )
-  {
-    sprintf(  buf, "%f\n", float(x[i] ) );
-    MESSAGE( buf );
-  }
-
-
-
   // apply parameters in range [0,1] to the space of the curve
   double prevU = first;
-  double sign = 1.;
-  if (theReverse)
+  double  sign = 1.;
+  if ( theReverse )
   {
     prevU = last;
-    sign = -1.;
+    sign  = -1.;
   }
-  for( int i = 1; i < nbSeg; i++ )
+
+  for ( int i = 1; i < nbSeg; i++ )
   {
     double curvLength = length * (x[i] - x[i-1]) * sign;
-    GCPnts_AbscissaPoint Discret( C3d, curvLength, prevU );
+    double tol         = Min( Precision::Confusion(), curvLength / 100. );
+    GCPnts_AbscissaPoint Discret( tol, C3d, curvLength, prevU );
     if ( !Discret.IsDone() )
       return false;
     double U = Discret.Parameter();
@@ -713,7 +705,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
     size_t  iSeg = theReverse ? segLen.size()-1 : 0;
     size_t  dSeg = theReverse ? -1 : +1;
     double param = theFirstU;
-    int nbParams = 0;
+    size_t nbParams = 0;
     for ( int i = 0, nb = segLen.size()-1; i < nb; ++i, iSeg += dSeg )
     {
       GCPnts_AbscissaPoint Discret( theC3d, segLen[ iSeg ], param );
@@ -988,9 +980,9 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
   case FIXED_POINTS_1D: {
     const std::vector<double>& aPnts = _fpHyp->GetPoints();
     const std::vector<int>&   nbsegs = _fpHyp->GetNbSegments();
-    int i = 0;
     TColStd_SequenceOfReal Params;
-    for(; i<aPnts.size(); i++) {
+    for ( size_t i = 0; i < aPnts.size(); i++ )
+    {
       if( aPnts[i]<0.0001 || aPnts[i]>0.9999 ) continue;
       int j=1;
       bool IsExist = false;
@@ -1014,8 +1006,9 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
     }
     double eltSize, segmentSize = 0.;
     double currAbscissa = 0;
-    for(i=0; i<Params.Length(); i++) {
-      int nbseg = ( i > nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
+    for ( int i = 0; i < Params.Length(); i++ )
+    {
+      int nbseg = ( i > (int)nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
       segmentSize = Params.Value(i+1)*theLength - currAbscissa;
       currAbscissa += segmentSize;
       GCPnts_AbscissaPoint APnt(theC3d, sign*segmentSize, par1);
@@ -1052,7 +1045,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
       par1 = par2;
     }
     // add for last
-    int nbseg = ( nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0];
+    int nbseg = ( (int)nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0];
     segmentSize = theLength - currAbscissa;
     eltSize = segmentSize/nbseg;
     GCPnts_UniformAbscissa Discret;
index 6a088119b25f94a429b4b0869522510102733b28..d653bfb0b20188b5f3d0b28ca6447a50d6cf3b87 100644 (file)
@@ -66,7 +66,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save)
 
   if ( !_edgeIDs.empty() )
   {
-    for ( size_t i = 0; i < _edgeIDs.size(); i++)
+    for ( size_t i = 0; i < _edgeIDs.size(); i++ )
       save << " " << _edgeIDs[i];
     save << " " << _objEntry << " ";
   }
@@ -76,7 +76,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -85,14 +85,14 @@ std::istream & StdMeshers_Reversible1D::LoadFrom(std::istream & load)
   bool isOK;
   int intVal;
 
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if (isOK && intVal > 0) {
     _edgeIDs.reserve( intVal );
-    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+    for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++ ) {
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _edgeIDs.push_back( intVal );
     }
-    isOK = (load >> _objEntry);
+    isOK = static_cast<bool>(load >> _objEntry);
   }
 
   return load;
index 9036dc18bc6965b99d2c8df29a44324f40a1a1e9..decbc2a6212fd0a1a20bfc67dc0930debc355516 100644 (file)
@@ -38,7 +38,7 @@ StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
   :SMESH_0D_Algo(hypId, studyId, gen)
 {
   _name = "SegmentAroundVertex_0D";
-  // it is assigned to vertices but influence a state of EDGE submeshes 
+  // it is assigned to vertices but influence a state of EDGE submeshes
   _shapeType = (1 << TopAbs_VERTEX);    // 1 bit per shape type
 
   _compatibleHypothesis.push_back("SegmentLengthAroundVertex");
@@ -55,16 +55,17 @@ StdMeshers_SegmentAroundVertex_0D::~StdMeshers_SegmentAroundVertex_0D()
 
 //=======================================================================
 //function : CheckHypothesis
-//purpose  : 
+//purpose  :
 //=======================================================================
 
-bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh&                          aMesh,
-                                                        const TopoDS_Shape&                  aShape,
-                                                        SMESH_Hypothesis::Hypothesis_Status& aStatus)
+bool StdMeshers_SegmentAroundVertex_0D::
+CheckHypothesis(SMESH_Mesh&                          aMesh,
+                const TopoDS_Shape&                  aShape,
+                SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
-  list <const SMESHDS_Hypothesis * >::const_iterator itl;
+  std::list <const SMESHDS_Hypothesis * >::const_iterator itl;
 
-  const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
+  const std::list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
   if ( hyps.size() == 0 )
   {
     aStatus = SMESH_Hypothesis::HYP_MISSING;
@@ -84,7 +85,7 @@ bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh&
 
 //=======================================================================
 //function : Compute
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 bool StdMeshers_SegmentAroundVertex_0D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
index e53ca623138910b6c0da526b8fcc4946dbb3edcc..3cc7562b482cd8bc6096c55ca1d224c9a9d8782a 100644 (file)
@@ -117,7 +117,7 @@ istream & StdMeshers_SegmentLengthAroundVertex::LoadFrom(istream & load)
 {
   bool isOK = true;
   double a;
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     this->_length = a;
   else
index c667ce38a5ec87c4b8286b50054a06715a62d30b..2c230524e49b3f7c45ca77dc444bb14ff9c81916 100644 (file)
@@ -146,22 +146,22 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load)
 {
   bool isOK = true;
   int intVal;
-  isOK = (load >> _begLength);
+  isOK = static_cast<bool>(load >> _begLength);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
-  isOK = (load >> _endLength);
+  isOK = static_cast<bool>(load >> _endLength);
 
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
-  
-  isOK = (load >> intVal);
+
+  isOK = static_cast<bool>(load >> intVal);
   if (isOK && intVal > 0) {
     _edgeIDs.reserve( intVal );
-    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+    for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _edgeIDs.push_back( intVal );
     }
-    isOK = (load >> _objEntry);
+    isOK = static_cast<bool>(load >> _objEntry);
   }
 
   return load;
@@ -169,7 +169,7 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
index 3c1841e7b20d9b8806439f622f50bd57429191ad..56613b3515179ab19d2e6753ea3bc2509b726dba 100644 (file)
@@ -817,7 +817,7 @@ bool _ViscousBuilder2D::findEdgesWithLayers()
                   {
                     hasVL = false;
                     for ( hyp = allHyps.begin(); hyp != allHyps.end() && !hasVL; ++hyp )
-                      if ( viscHyp = dynamic_cast<const THypVL*>( *hyp ))
+                      if (( viscHyp = dynamic_cast<const THypVL*>( *hyp )))
                         hasVL = viscHyp->IsShapeWithLayers( neighbourID );
                   }
                   if ( !hasVL )
@@ -1438,7 +1438,7 @@ bool _ViscousBuilder2D::inflate()
       _PolyLine::TEdgeIterator eIt = isR ? L._lEdges.end()-1 : L._lEdges.begin();
       if ( eIt->_length2D == 0 ) continue;
       _Segment seg1( eIt->_uvOut, eIt->_uvIn );
-      for ( eIt += deltaIt; nbRemove < L._lEdges.size()-1; eIt += deltaIt )
+      for ( eIt += deltaIt; nbRemove < (int)L._lEdges.size()-1; eIt += deltaIt )
       {
         _Segment seg2( eIt->_uvOut, eIt->_uvIn );
         if ( !intersection.Compute( seg1, seg2 ))
@@ -1446,7 +1446,7 @@ bool _ViscousBuilder2D::inflate()
         ++nbRemove;
       }
       if ( nbRemove > 0 ) {
-        if ( nbRemove == L._lEdges.size()-1 ) // 1st and last _LayerEdge's intersect
+        if ( nbRemove == (int)L._lEdges.size()-1 ) // 1st and last _LayerEdge's intersect
         {
           --nbRemove;
           _LayerEdge& L0 = L._lEdges.front();
@@ -2131,7 +2131,7 @@ bool _ViscousBuilder2D::refine()
   // store a proxyMesh in a sub-mesh
   // make faces on each _PolyLine
   vector< double > layersHeight;
-  double prevLen2D = -1;
+  //double prevLen2D = -1;
   for ( size_t iL = 0; iL < _polyLineVec.size(); ++iL )
   {
     _PolyLine& L = _polyLineVec[ iL ];
@@ -2669,7 +2669,7 @@ _SegmentTree::box_type* _SegmentTree::buildRootBox()
 
 void _SegmentTree::buildChildrenData()
 {
-  for ( int i = 0; i < _segments.size(); ++i )
+  for ( size_t i = 0; i < _segments.size(); ++i )
     for (int j = 0; j < nbChildren(); j++)
       if ( !myChildren[j]->getBox()->IsOut( *_segments[i]._seg->_uv[0],
                                             *_segments[i]._seg->_uv[1] ))
@@ -2680,7 +2680,7 @@ void _SegmentTree::buildChildrenData()
   for (int j = 0; j < nbChildren(); j++)
   {
     _SegmentTree* child = static_cast<_SegmentTree*>( myChildren[j]);
-    child->myIsLeaf = ( child->_segments.size() <= maxNbSegInLeaf() );
+    child->myIsLeaf = ((int) child->_segments.size() <= maxNbSegInLeaf() );
   }
 }
 
@@ -2698,7 +2698,7 @@ void _SegmentTree::GetSegmentsNear( const _Segment&            seg,
 
   if ( isLeaf() )
   {
-    for ( int i = 0; i < _segments.size(); ++i )
+    for ( size_t i = 0; i < _segments.size(); ++i )
       if ( !_segments[i].IsOut( seg ))
         found.push_back( _segments[i]._seg );
   }
@@ -2724,7 +2724,7 @@ void _SegmentTree::GetSegmentsNear( const gp_Ax2d&             ray,
 
   if ( isLeaf() )
   {
-    for ( int i = 0; i < _segments.size(); ++i )
+    for ( size_t i = 0; i < _segments.size(); ++i )
       if ( !_segments[i].IsOut( ray ))
         found.push_back( _segments[i]._seg );
   }
index 762bccdecff55ae3a8b5541f5c4265e8e8c7402f..21f64ed4fd07b89dbc368316c4a339016a9a3a3b 100644 (file)
@@ -319,10 +319,10 @@ namespace StdMeshersGUI
 
   void GridAxisTab::onMode(int isSpacing)
   {
-    mySpacingTreeWdg->setShown( isSpacing );
-    myCoordList->setShown( !isSpacing );
-    myStepSpin->setShown( !isSpacing );
-    myStepLabel->setShown( !isSpacing );
+    mySpacingTreeWdg->setVisible( isSpacing );
+    myCoordList->setVisible( !isSpacing );
+    myStepSpin->setVisible( !isSpacing );
+    myStepLabel->setVisible( !isSpacing );
     if ( isSpacing )
     {
       if ( mySpacingTreeWdg->topLevelItemCount() == 0 )
index 0d567e4fb232d2e74af3458a136ca8d5cd6547f5..e2471de3ae86d00c000e0eb62e10204bc1fa2851 100644 (file)
@@ -64,19 +64,19 @@ Plot2d_QwtLegendLabel* getLegendLabel( QwtPlotCurve* plotCurve )
   QwtLegend* legend = dynamic_cast<QwtLegend*>( plotCurve->plot()->legend() );
   QWidget* widget = legend->legendWidget( itemInfo );
   QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
-  if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label )
-    return anItem;
+  Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label;
+  return anItem;
 }
 
 StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
-: QwtPlot( p ),
-  myPoints( 50 ),
-  myIsTable( false ),
-  myVars( 1, 1 ),
-  myValues( 1, 1 ),
-  myConv( CUT_NEGATIVE ),
-  myIsDone( true ),
-  myNbSeg( 1 )
+  : QwtPlot( p ),
+    myPoints( 50 ),
+    myNbSeg( 1 ),
+    myIsTable( false ),
+    myConv( CUT_NEGATIVE ),
+    myVars( 1, 1 ),
+    myValues( 1, 1 ),
+    myIsDone( true )
 {
   Kernel_Utils::Localizer loc;
   myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
index c5ba29ec42650ed41ec9398f2ddd9eb1799443c7..0b5246735ca3af43fcc843ca7240c489723f235f 100644 (file)
@@ -445,7 +445,7 @@ deleteRow()
 {
   QList<int> selRows = selectedRows();
   for ( int r = selRows.count()-1; r >= 0; r-- )
-    removeRow( r );
+    removeRow( selRows.at(r) );
 }
 
 void
@@ -574,7 +574,7 @@ StdMeshersGUI_DistrTableFrame::
 setData( const DataArray& array )
 {
   QList<double> d;
-  for ( int i = 0; i < array.length(); i++ )
+  for ( CORBA::ULong i = 0; i < array.length(); i++ )
     d.append( array[i] );
 
   sortData( d );
index 3b5ece91c76d2661195971d527270a09020f6b72..7f75b9b6c77a592c5925e369f57e7a803576d071 100644 (file)
@@ -360,7 +360,7 @@ SMESH::double_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfPoints()
 void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints)
 {
   clear();
-  for ( int i = 0; i < thePoints->length(); i++ ) {
+  for ( CORBA::ULong i = 0; i < thePoints->length(); i++ ) {
     addPoint( thePoints[ i ] );
   }
 }
@@ -388,7 +388,7 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var
 {
   if ( myListWidget->count() > 0 && theSegments->length() == 1)
     mySameValues->setChecked(true);
-  for ( int i = 0; i < theSegments->length(); i++ ) {
+  for ( CORBA::ULong i = 0; i < theSegments->length(); i++ ) {
     setNbSegments( i, theSegments[i] );
   }
 }
index 82d2e437d8726a5a743e365d02278b3e1f5ebf3c..57e21193d3c01efc8e8a4c4f4ed4c25db1b27529 100644 (file)
@@ -45,7 +45,7 @@
 //================================================================================
 /*!
  * \brief Constructor initialized by filter
 * \param f - object filter
+ * \param f - object filter
  */
 //================================================================================
 
@@ -53,8 +53,8 @@ StdMeshersGUI_LayerDistributionParamWdg
 ::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp,
                                           SMESH::SMESH_Hypothesis_ptr distribHyp,
                                           const QString&              name,
-                                          QDialog*                    dlg): 
-  QWidget(), myName(name), myDlg( dlg )
+                                          QDialog*                    dlg):
+  QWidget(), myDlg( dlg ), myName(name)
 {
   myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp );
   init();
index fa4eb1dcc19f93aba7715d911075fc99ce650bb5..e7f35d1f39119462ffda0131c73b5d032f862422 100644 (file)
@@ -94,9 +94,10 @@ bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg ) const
   readParamsFromHypo( data_old );
   readParamsFromWidgets( data_new );
   bool res = storeParamsToHypo( data_new );
-  storeParamsToHypo( data_old );
   res = myNbSeg->isValid( msg, true ) && res;
   res = myScale->isValid( msg, true ) && res;
+  if ( !res )
+    storeParamsToHypo( data_old );
   return res;
 }
 
@@ -294,13 +295,13 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
   case Regular :
     valStr += tr("SMESH_DISTR_REGULAR");
     break;
-  case Scale   : 
-    valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );\
+  case Scale   :
+    valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );
     break;
   case TabFunc : {
     //valStr += tr("SMESH_TAB_FUNC");
     bool param = true;
-    for( int i=0; i < data.myTable.length(); i++, param = !param ) {
+    for( CORBA::ULong i = 0; i < data.myTable.length(); i++, param = !param ) {
       if ( param )
         valStr += "[";
       valStr += QString::number( data.myTable[ i ]);
@@ -382,9 +383,10 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
 
     h->SetVarParameter( h_data.myNbSegVarName.toLatin1().constData(), "SetNumberOfSegments" );
     h->SetNumberOfSegments( h_data.myNbSeg );
-    int distr = h_data.myDistrType;
-    h->SetDistrType( distr );
     
+    int distr = h_data.myDistrType;
+    if ( distr == 0 )
+      h->SetDistrType( distr ); // this is actually needed at non-uniform -> uniform switch
     if( distr==1 ) {
       h->SetVarParameter( h_data.myScaleVarName.toLatin1().constData(), "SetScaleFactor" );
       h->SetScaleFactor( h_data.myScale );
@@ -445,25 +447,25 @@ void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
     myTable->setData( arr ); //update data in table
   }
 
-  myScale->setShown( distr==1 );
-  myLScale->setShown( distr==1 );
-  myReversedEdgesBox->setShown( distr!=0 );
+  myScale->setVisible( distr==1 );
+  myLScale->setVisible( distr==1 );
+  myReversedEdgesBox->setVisible( distr!=0 );
   if ( myReversedEdgesHelper ) {
     myReversedEdgesHelper->Clear();
-    myReversedEdgesHelper->setShown( distr!=0 );
+    myReversedEdgesHelper->setVisible( distr!=0 );
   }
   myDirectionWidget->ShowPreview( distr!=0 );
 
   bool isFunc = distr==2 || distr==3;
 #ifndef DISABLE_PLOT2DVIEWER
-  myPreview->setShown( isFunc );
+  myPreview->setVisible( isFunc );
 #endif
-  myConvBox->setShown( isFunc );
+  myConvBox->setVisible( isFunc );
   
-  myTable->setShown( distr==2 );
-  myExpr->setShown( distr==3 );
-  myLExpr->setShown( distr==3 );
-  myInfo->setShown( distr==3);
+  myTable->setVisible( distr==2 );
+  myExpr->setVisible( distr==3 );
+  myLExpr->setVisible( distr==3 );
+  myInfo->setVisible( distr==3);
 
 #ifndef DISABLE_PLOT2DVIEWER
   //change of preview
index c84b40be9d8c1413765714ae6fc69f348e5b98f3..617f5cbfa910903c57939c6150d2a6d9ff74e56c 100644 (file)
@@ -379,7 +379,7 @@ std::vector< int > * StdMeshersGUI_PropagationHelperWdg::getSelectedChain()
   std::vector< int > * chain = 0;
   if ( QListWidgetItem * item = myListWidget->currentItem() )
   {
-    int i = item->data( Qt::UserRole ).toInt();
+    size_t i = (size_t) item->data( Qt::UserRole ).toInt();
     if ( 0 <= i && i < myChains.size() )
       chain = & myChains[i];
   }
index c52f3602ae8cd8ad6a6785b350383b2023f6f432..b1112e7864e30c16fd1923816991319a597c8de2 100644 (file)
@@ -215,7 +215,7 @@ void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const
     GEOM::ListOfGO_var     shapes;
     SMESH::nodes_array_var points;
     h->GetEnforcedNodes( shapes, points );
-    for ( int i = 0; i < shapes->length(); ++i )
+    for ( size_t i = 0; i < shapes->length(); ++i )
     {
       CORBA::String_var name  = shapes[i]->GetName();
       CORBA::String_var entry = shapes[i]->GetStudyEntry();
@@ -223,7 +223,7 @@ void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const
       item->setData( Qt::UserRole, entry.in() );
       myShapesList->addItem( item );
     }
-    for ( int i = 0; i < points->length(); ++i )
+    for ( size_t i = 0; i < points->length(); ++i )
     {
       QTreeWidgetItem* item = new QTreeWidgetItem
         ( QStringList()
index ea722142c8ebfff0881eb20bb03730226c3b14f9..a9b7782829e37291b4565813acdbd9469c1a5891 100644 (file)
@@ -30,7 +30,6 @@
 #include <SMESHGUI_HypothesesUtils.h>
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_GEOMGenUtils.h>
-
 #include <SMESH_TypeFilter.hxx>
 #include <SMESH_NumberFilter.hxx>
 
@@ -47,8 +46,9 @@
 #include <GEOM_wrap.hxx>
 
 // SALOME GUI includes
-#include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_IntSpinBox.h>
 
 // IDL includes
 #include <SALOMEconfig.h>
@@ -1383,6 +1383,14 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int)
       sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
     }
   }
+  else if ( SalomeApp_IntSpinBox* sb = qobject_cast< SalomeApp_IntSpinBox* >( w ))
+  {
+    if ( hypType().startsWith( "NumberOfLayers" ) ||
+         hypType().startsWith( "ViscousLayers" ))
+    {
+      sb->setMinimum( 1 );
+    }
+  }
 }
 
 //================================================================================
index 66da7722e2d71ca00fd84f78368e5d70b5420925..b5d7629f7508bf51cd7be02c9f707ee955f08729 100644 (file)
@@ -72,8 +72,8 @@
 StdMeshersGUI_SubShapeSelectorWdg
 ::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent, TopAbs_ShapeEnum aSubShType ): 
   QWidget( parent ),
-  myPreviewActor( 0 ),
-  myMaxSize( -1 )
+  myMaxSize( -1 ),
+  myPreviewActor( 0 )
 {
   QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
 
index e5bc43681c1a56bfb668d0a7fda715566431fd0e..96f16c5e4552df12eed8f3b70d5a857bd01caf05 100644 (file)
@@ -225,7 +225,7 @@ SMESH::long_array* StdMeshers_Arithmetic1D_i::GetReversedEdges()
   SMESH::long_array_var anArray = new SMESH::long_array;
   std::vector<int> ids = this->GetImpl()->GetReversedEdges();
   anArray->length( ids.size() );
-  for ( CORBA::Long i = 0; i < ids.size(); i++)
+  for ( CORBA::ULong i = 0; i < ids.size(); i++)
     anArray [ i ] = ids [ i ];
 
   return anArray._retn();
index 9ca0a8ee8e58b6975e7fb2b0522aef0d6d91d10b..0ea622706fb6b591d68f62972a2e7c0eef5b3b7b 100644 (file)
@@ -178,8 +178,8 @@ void StdMeshers_CartesianParameters3D_i::SetGridSpacing(const SMESH::string_arra
                                                         CORBA::Short               axis)
   throw (SALOME::SALOME_Exception)
 {
-  vector<string> funVec;
-  vector<double> pointVec;
+  std::vector<std::string> funVec;
+  std::vector<double>      pointVec;
   _array2vec( spaceFunctions, funVec, (const char*) );
   _array2vec( internalPoints, pointVec, );
 
@@ -209,8 +209,8 @@ void StdMeshers_CartesianParameters3D_i::GetGridSpacing(SMESH::string_array_out
 {
   ASSERT( myBaseImpl );
   try {
-    vector<string> funVec;
-    vector<double> pointVec;
+    std::vector<std::string> funVec;
+    std::vector<double>      pointVec;
     this->GetImpl()->GetGridSpacing( funVec, pointVec, axis );
 
     xSpaceFunctions = new SMESH::string_array();
@@ -394,8 +394,8 @@ StdMeshers_CartesianParameters3D_i::ComputeCoordinates(CORBA::Double
                                                        const char*                axisName )
   throw (SALOME::SALOME_Exception)
 {
-  vector<string> xFuns;
-  vector<double> xPoints, coords;
+  std::vector<std::string> xFuns;
+  std::vector<double>      xPoints, coords;
   _array2vec( spaceFuns, xFuns, (const char*) );
   _array2vec( points, xPoints, );
 
index 2db85387e81f2c543df68c69e51e1a8fefdc5dd0..580331db541a383bca7ac287cadb3867fd097bcc 100644 (file)
@@ -137,7 +137,7 @@ SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints()
   SMESH::double_array_var anArray = new SMESH::double_array;
   std::vector<double> params = this->GetImpl()->GetPoints();
   anArray->length( params.size() );
-  for ( CORBA::Long i = 0; i < params.size(); i++)
+  for ( CORBA::ULong i = 0; i < params.size(); i++)
     anArray [ i ] = params [ i ];
 
   return anArray._retn();
@@ -158,7 +158,7 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments()
   SMESH::long_array_var anArray = new SMESH::long_array;
   std::vector<int> nbsegs = this->GetImpl()->GetNbSegments();
   anArray->length( nbsegs.size() );
-  for ( CORBA::Long i = 0; i < nbsegs.size(); i++)
+  for ( CORBA::ULong i = 0; i < nbsegs.size(); i++)
     anArray [ i ] = nbsegs [ i ];
 
   return anArray._retn();
@@ -252,7 +252,7 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges()
   SMESH::long_array_var anArray = new SMESH::long_array;
   std::vector<int> ids = this->GetImpl()->GetReversedEdges();
   anArray->length( ids.size() );
-  for ( CORBA::Long i = 0; i < ids.size(); i++)
+  for ( CORBA::ULong i = 0; i < ids.size(); i++)
     anArray [ i ] = ids [ i ];
 
   return anArray._retn();
index 681092fc2fe46a8d300bbe37000bfad1858f48d0..9b6f41db1ce214ddab195e6f6572cdf43a50ad5c 100644 (file)
@@ -91,7 +91,7 @@ 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 ( int i = 0; i < groups.length(); ++i )
+    for ( CORBA::ULong i = 0; i < groups.length(); ++i )
       if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i] ))
       {
         if ( gp_i->GetType() != SMESH::EDGE )
@@ -109,7 +109,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou
 
     _groupEntries = new SMESH::string_array;
     _groupEntries->length( entries.size ());
-    for ( int i = 0; i < entries.size(); ++i )
+    for ( size_t i = 0; i < entries.size(); ++i )
       _groupEntries[i] = entries[i].c_str();
   }
   catch ( SALOME_Exception& S_ex )
@@ -173,7 +173,7 @@ char* StdMeshers_ImportSource1D_i::SaveTo()
   os << " " << _groupEntries->length();
 
   SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
-  for ( int i = 0; i < _groupEntries->length(); ++i )
+  for ( size_t i = 0; i < _groupEntries->length(); ++i )
   {
     // entry
     os << " " << _groupEntries[i];
@@ -208,7 +208,7 @@ void StdMeshers_ImportSource1D_i::LoadFrom( const char* theStream )
   _groupEntries = new SMESH::string_array;
   _groupEntries->length( nbGroups );
   std::string id, entry;
-  for ( int i = 0; i < _groupEntries->length(); ++i )
+  for ( size_t i = 0; i < _groupEntries->length(); ++i )
   {
     if ( is >> entry )
       _groupEntries[i] = entry.c_str();
index f8305e9c7b07a823227182c131c4a5dfa5754865..051ae469ce548e78c58267067c2ccca0e1953774 100644 (file)
@@ -90,7 +90,7 @@ 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 ( int i = 0; i < groups.length(); ++i )
+    for ( CORBA::ULong i = 0; i < groups.length(); ++i )
       if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i] ))
       {
         if ( gp_i->GetType() != SMESH::FACE )
@@ -109,7 +109,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou
 
     _groupEntries = new SMESH::string_array;
     _groupEntries->length( entries.size ());
-    for ( int i = 0; i < entries.size(); ++i )
+    for ( size_t i = 0; i < entries.size(); ++i )
       _groupEntries[i] = entries[i].c_str();
   }
   catch ( SALOME_Exception& S_ex )
@@ -173,7 +173,7 @@ char* StdMeshers_ImportSource2D_i::SaveTo()
   os << " " << _groupEntries->length();
 
   SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
-  for ( int i = 0; i < _groupEntries->length(); ++i )
+  for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i )
   {
     // entry
     os << " " << _groupEntries[i];
@@ -210,7 +210,7 @@ void StdMeshers_ImportSource2D_i::LoadFrom( const char* theStream )
   _groupEntries = new SMESH::string_array;
   _groupEntries->length( nbGroups );
   std::string id, entry;
-  for ( int i = 0; i < _groupEntries->length(); ++i )
+  for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i )
   {
     if ( is >> entry )
       _groupEntries[i] = entry.c_str();
index bedb2277e584ca71c809f90b7ad27818838922d2..48530d600486d43f3fa7d10cbf62a39efc17e463 100644 (file)
@@ -38,8 +38,8 @@ StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
                                           (PortableServer::POA_ptr thePOA,
                                            int                     theStudyId,
                                            ::SMESH_Gen*            theGenImpl )
-: StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl),
 SMESH_Hypothesis_i( thePOA )
+:SMESH_Hypothesis_i( thePOA ),
StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl)
 {
   MESSAGE( "StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i" );
   myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
index 59e6d77139d1e98ee0892e7fee2ca856c2015d31..da92224e8e506801532c24ad20c2a1d02c2c7039 100644 (file)
@@ -105,6 +105,16 @@ CORBA::Long StdMeshers_LengthFromEdges_i::GetMode()
   return this->GetImpl()->GetMode();
 }
 
+//================================================================================
+/*!
+ * \brief Return false as in SALOME the mode is not used
+ */
+//================================================================================
+
+CORBA::Boolean StdMeshers_LengthFromEdges_i::HasParameters()
+{
+  return false;
+}
 
 //=============================================================================
 /*!
index 06f98664fc9f712e5a5f263e7ca1e315762b1d40..6e121afc7f45e61a4598056ffe379252f8785630 100644 (file)
@@ -59,6 +59,9 @@ public:
   // Get mode
   CORBA::Long GetMode();
 
+  // Return false as in SALOME the mode is not used
+  CORBA::Boolean HasParameters();
+
   // Get implementation
   ::StdMeshers_LengthFromEdges* GetImpl();
   
index 6e1f2e974d8889f7c75a8d1b9d5fe2d31a98bfec..2863962972ed17d49ba2d86b11d41fc6b18db2e5 100644 (file)
@@ -38,8 +38,8 @@ StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
                                            (PortableServer::POA_ptr thePOA,
                                             int                     theStudyId,
                                             ::SMESH_Gen*            theGenImpl)
-: StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl),
-  SMESH_Hypothesis_i( thePOA )
+ :SMESH_Hypothesis_i( thePOA ),
+  StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl)
 {
   MESSAGE("StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i");
   myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
index c9047fb7ae7a57c14af5e83ff977a42957d2509b..47bbbcd79f3639a939240313aeadb94f2d4f3df2 100644 (file)
@@ -88,7 +88,7 @@ SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const
     SMESH::double_array_var aRes = new SMESH::double_array();
     const std::vector<double>& res = this->GetImpl()->BuildDistributionExpr( func, nbSeg, conv );
     aRes->length( res.size() );
-    for (int i = 0; i < res.size(); i++)
+    for (size_t i = 0; i < res.size(); i++)
       aRes[i] = res[i];
     return aRes._retn();
   }
@@ -98,23 +98,24 @@ SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const
   }
 }
 
-SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func,
-                                                                          CORBA::Long nbSeg, 
-                                                                          CORBA::Long conv )
+SMESH::double_array*
+StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func,
+                                                     CORBA::Long                nbSeg,
+                                                     CORBA::Long                conv )
   throw ( SALOME::SALOME_Exception )
 {
   ASSERT( myBaseImpl );
 
   std::vector<double> tbl( func.length() );
-  for (int i = 0; i < func.length(); i++)
+  for ( size_t i = 0; i < tbl.size(); i++ )
     tbl[i] = func[i];
 
   try
   {
-    SMESH::double_array_var aRes = new SMESH::double_array();
+    SMESH::double_array_var   aRes = new SMESH::double_array();
     const std::vector<double>& res = this->GetImpl()->BuildDistributionTab( tbl, nbSeg, conv );
     aRes->length( res.size() );
-    for (int i = 0; i < res.size(); i++)
+    for (size_t i = 0; i < res.size(); i++)
       aRes[i] = res[i];
     return aRes._retn();
   }
@@ -251,7 +252,7 @@ SMESH::long_array* StdMeshers_NumberOfSegments_i::GetReversedEdges()
   SMESH::long_array_var anArray = new SMESH::long_array;
   std::vector<int> ids = this->GetImpl()->GetReversedEdges();
   anArray->length( ids.size() );
-  for ( CORBA::Long i = 0; i < ids.size(); i++)
+  for ( size_t i = 0; i < ids.size(); i++)
     anArray [ i ] = ids [ i ];
 
   return anArray._retn();
@@ -267,10 +268,13 @@ void StdMeshers_NumberOfSegments_i::SetDistrType(CORBA::Long typ)
 {
   ASSERT( myBaseImpl );
   try {
+    CORBA::Long oldType = (CORBA::Long) this->GetImpl()->GetDistrType();
+
     this->GetImpl()->SetDistrType( (::StdMeshers_NumberOfSegments::DistrType) typ );
 
     // Update Python script
-    SMESH::TPythonDump() << _this() << ".SetDistrType( " << typ << " )";
+    if ( oldType != typ )
+      SMESH::TPythonDump() << _this() << ".SetDistrType( " << typ << " )";
   }
   catch ( SALOME_Exception& S_ex ) {
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
@@ -345,7 +349,7 @@ void StdMeshers_NumberOfSegments_i::SetTableFunction(const SMESH::double_array&
 {
   ASSERT( myBaseImpl );
   std::vector<double> tbl( table.length() );
-  for (int i = 0; i < table.length(); i++)
+  for ( CORBA::ULong i = 0; i < table.length(); i++)
     tbl[i] = table[i];
   try {
     this->GetImpl()->SetTableFunction( tbl );
@@ -372,12 +376,11 @@ SMESH::double_array* StdMeshers_NumberOfSegments_i::GetTableFunction()
     tbl = &this->GetImpl()->GetTableFunction();
   }
   catch ( SALOME_Exception& S_ex ) {
-    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
-                                  SALOME::BAD_PARAM );
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
   }
   SMESH::double_array_var aRes = new SMESH::double_array();
   aRes->length(tbl->size());
-  for (int i = 0; i < tbl->size(); i++)
+  for ( size_t i = 0; i < tbl->size(); i++ )
     aRes[i] = (*tbl)[i];
   return aRes._retn();
 }
index ed0ce004c1b7849a666cb3ba819981d1a161e53d..8120ca384e95c339aee8717a4c87c896980bb856 100644 (file)
@@ -111,7 +111,7 @@ public:
       std::string str;
       if (stream >> str) {
         if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) {
-          string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
+          std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
           if ( !ior.empty() )
              return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
         }
index 9a71ba6ca152b1ecad0501aeb7dd278f75608f97..a059ff39e378137c2e8901e4b5202d007e8dc44f 100644 (file)
@@ -79,7 +79,7 @@ void StdMeshers_Reversible1D_i::SetReversedEdges( const SMESH::long_array& theId
 
 void StdMeshers_Reversible1D_i::SetObjectEntry( const char* theEntry )
 {
-  string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping
+  std::string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping
   try {
     this->GetImpl()->SetObjectEntry( entry.c_str() );
     // Update Python script
@@ -123,7 +123,7 @@ SMESH::long_array* StdMeshers_Reversible1D_i::GetReversedEdges()
   SMESH::long_array_var anArray = new SMESH::long_array;
   std::vector<int> ids = this->GetImpl()->GetReversedEdges();
   anArray->length( ids.size() );
-  for ( CORBA::Long i = 0; i < ids.size(); i++)
+  for ( CORBA::ULong i = 0; i < ids.size(); i++)
     anArray [ i ] = ids [ i ];
 
   return anArray._retn();
index 7586394d3d26a6f7ad9215a367bdc681bff9b9cb..b73eab39b0efb9b31b8d7ca752fab36770fc1fd6 100644 (file)
@@ -223,7 +223,7 @@ SMESH::long_array* StdMeshers_StartEndLength_i::GetReversedEdges()
   SMESH::long_array_var anArray = new SMESH::long_array;
   std::vector<int> ids = this->GetImpl()->GetReversedEdges();
   anArray->length( ids.size() );
-  for ( CORBA::Long i = 0; i < ids.size(); i++)
+  for ( CORBA::ULong i = 0; i < ids.size(); i++)
     anArray [ i ] = ids [ i ];
 
   return anArray._retn();
index 64179ae4c74fa9d4256f899b6fdd942d9fb437e5..df10768327db93fd1d44bbd9b1984e2e80b6b791 100644 (file)
@@ -51,23 +51,6 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog):
         # Je n arrive pas a utiliser le setEnvironment du QProcess
         # fonctionne hors Salome mais pas dans Salome ???
         cmds=''
-        try :
-          LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_MGCLEANER"]
-        except:
-          LICENCE_FILE=''
-        try :
-          PATH=os.environ["DISTENE_PATH_FOR_MGCLEANER"]
-        except:
-          PATH=''
-        if LICENCE_FILE != '': 
-          cmds+='source '+LICENCE_FILE+'\n'
-        else:
-          cmds+="# $DISTENE_LICENCE_FILE_FOR_MGCLEANER NOT SET\n"
-        if PATH != '': 
-          cmds+='export PATH='+PATH+':$PATH\n'
-        else:
-          cmds+="# $DISTENE_PATH_FOR_MGCLEANER NOT SET\n"
-        #cmds+='env\n'
         cmds+='rm -f '+self.parent().fichierOut+'\n'
         cmds+=txt+'\n'
         cmds+='echo END_OF_MGCleaner\n'
index 35171babb4d564d54dd8724c6418cb8d746ad962..7b518b574eb005380da43b7721f1d18fd62cf804 100644 (file)
@@ -49,23 +49,6 @@ class MonViewText(Ui_ViewExe, QDialog):
         # Je n arrive pas a utiliser le setEnvironment du QProcess
         # fonctionne hors Salome mais pas dans Salome ???
         cmds=''
-        try :
-          LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_YAMS"]
-        except:
-          LICENCE_FILE=''
-        try :
-          PATH=os.environ["DISTENE_PATH_FOR_YAMS"]
-        except:
-          PATH=''
-        if LICENCE_FILE != '': 
-          cmds+='source '+LICENCE_FILE+'\n'
-        else:
-          cmds+="# $DISTENE_LICENCE_FILE_FOR_YAMS NOT SET\n"
-        if PATH != '': 
-          cmds+='export PATH='+PATH+':$PATH\n'
-        else:
-          cmds+="# $DISTENE_PATH_FOR_YAMS NOT SET\n"
-        #cmds+='env\n'
         cmds+='rm -f '+self.parent().fichierOut+'\n'
         cmds+=txt+'\n'
         cmds+='echo END_OF_Yams\n'
diff --git a/src/Tools/blocFissure/AREextradosLauncher.py b/src/Tools/blocFissure/AREextradosLauncher.py
new file mode 100644 (file)
index 0000000..f256b4c
--- /dev/null
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+""" FissureLauncher:
+    Permet de lancer le script 'casStandard'
+    en fonction des paramètres contenus dans 'dicoParams'. """
+
+#import sys
+import salome
+
+#import os
+#from blocFissure import gmu
+from blocFissure.gmu import initLog
+initLog.setDebug()
+#initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+mesh = 'ARE_sain_lin_rotated.med'
+crack = 'fissureExtrados.brep'
+
+dicoParams = dict(nomCas            = 'fissTuyau',
+                  maillageSain      = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh),
+                  brepFaceFissure   = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack),
+                  edgeFissIds       = [4],
+                  lgInfluence       = 12,
+                  meshBrep          = (0.05, 2.0),
+                  rayonPipe         = 1.0,
+                  lenSegPipe        = 1, #9,
+                  nbSegRad          = 8,
+                  nbSegCercle       = 20,
+                  areteFaceFissure  = 1.0)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+    salome.sg.updateObjBrowser(1)
diff --git a/src/Tools/blocFissure/AREintradosLauncher.py b/src/Tools/blocFissure/AREintradosLauncher.py
new file mode 100644 (file)
index 0000000..f95fea2
--- /dev/null
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+""" FissureLauncher:
+    Permet de lancer le script 'casStandard'
+    en fonction des paramètres contenus dans 'dicoParams'. """
+
+#import sys
+import salome
+
+#import os
+#from blocFissure import gmu
+from blocFissure.gmu import initLog
+initLog.setDebug()
+#initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+mesh = 'ARE_sain_lin_rotated.med'
+crack = 'fissureIntrados.brep'
+
+dicoParams = dict(nomCas            = 'fissTuyau',
+                  maillageSain      = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh),
+                  brepFaceFissure   = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack),
+                  edgeFissIds       = [4],
+                  lgInfluence       = 14,
+                  meshBrep          = (0.05, 2.0),
+                  rayonPipe         = 1.0,
+                  lenSegPipe        = 1, #9,
+                  nbSegRad          = 5,
+                  nbSegCercle       = 16,
+                  areteFaceFissure  = 1.0)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+    salome.sg.updateObjBrowser(1)
index 980d01d57cb5291f8ce1378f5a308804648e1e49..3b69e0f836e6f0296f464717d079100f035baa54 100644 (file)
@@ -30,11 +30,10 @@ ENDIF(SALOME_BUILD_GUI)
 # scripts / static
 SET(plugin_SCRIPTS
   __init__.py
-  casStandard.py
   exemple.py
   exemple2.py
 )
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure)
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure)
index e2808864d65c29692485d4fa2d3233f7b23f7d18..75757011b466f13692e2798737601282ac9ee68d 100644 (file)
@@ -24,6 +24,9 @@ SET(plugin_SCRIPTS
   __init__.py
   cubeAngle2.py
   cubeAngle.py
+  cubeCoin.py
+  cubeMilieu.py
+  cubeTransverse.py
   cylindre_2.py
   cylindre.py
   disquePerce.py
@@ -52,4 +55,4 @@ SET(plugin_SCRIPTS
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/CasTests)
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/CasTests)
index 579d2414024bee4e05c358831e89e93badeb1a52..38d11ea404dcbdefbfc35b57c74b5315a5ff125c 100644 (file)
@@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -41,7 +41,7 @@ class cubeAngle(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     """
@@ -85,9 +85,9 @@ class cubeAngle(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index a33fc2acce74325e819541dbb25bfccc1e6e5bd8..b7d31c405124c5b885b3afe9bd901c8becae5d93 100644 (file)
@@ -13,7 +13,7 @@ class cubeAngle2(cubeAngle):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     """
diff --git a/src/Tools/blocFissure/CasTests/cubeCoin.py b/src/Tools/blocFissure/CasTests/cubeCoin.py
new file mode 100644 (file)
index 0000000..97d18a4
--- /dev/null
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+
+dicoParams = dict(nomCas            = 'cubeCoin',
+                  maillageSain      = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'),
+                  brepFaceFissure   = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"),
+                  edgeFissIds       = [7],
+                  lgInfluence       = 50,
+                  meshBrep          = (5,10),
+                  rayonPipe         = 10,
+                  lenSegPipe        = 7,
+                  nbSegRad          = 5,
+                  nbSegCercle       = 10,
+                  areteFaceFissure  = 20)
+
+  # ---------------------------------------------------------------------------
+
+referencesMaillageFissure = dict(Entity_Quad_Pyramid    = 0,
+                                 Entity_Quad_Triangle   = 0,
+                                 Entity_Quad_Edge       = 0,
+                                 Entity_Quad_Penta      = 0,
+                                 Entity_Quad_Hexa       = 0,
+                                 Entity_Node            = 0,
+                                 Entity_Quad_Tetra      = 0,
+                                 Entity_Quad_Quadrangle = 0)
+
diff --git a/src/Tools/blocFissure/CasTests/cubeMilieu.py b/src/Tools/blocFissure/CasTests/cubeMilieu.py
new file mode 100644 (file)
index 0000000..0d93518
--- /dev/null
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+
+dicoParams = dict(nomCas            = 'cubeMilieu',
+                  maillageSain      = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'),
+                  brepFaceFissure   = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"),
+                  edgeFissIds       = [7],
+                  lgInfluence       = 50,
+                  meshBrep          = (5,10),
+                  rayonPipe         = 10,
+                  lenSegPipe        = 7,
+                  nbSegRad          = 5,
+                  nbSegCercle       = 10,
+                  areteFaceFissure  = 10)
+
+# ---------------------------------------------------------------------------
+
+referencesMaillageFissure = dict(Entity_Quad_Pyramid    = 0,
+                                 Entity_Quad_Triangle   = 0,
+                                 Entity_Quad_Edge       = 0,
+                                 Entity_Quad_Penta      = 0,
+                                 Entity_Quad_Hexa       = 0,
+                                 Entity_Node            = 0,
+                                 Entity_Quad_Tetra      = 0,
+                                 Entity_Quad_Quadrangle = 0)
+
diff --git a/src/Tools/blocFissure/CasTests/cubeTransverse.py b/src/Tools/blocFissure/CasTests/cubeTransverse.py
new file mode 100644 (file)
index 0000000..c003d38
--- /dev/null
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+
+dicoParams = dict(nomCas            = 'cubeTransverse',
+                  maillageSain      = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'),
+                  brepFaceFissure   = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep"),
+                  edgeFissIds       = [6],
+                  lgInfluence       = 50,
+                  meshBrep          = (5,10),
+                  rayonPipe         = 10,
+                  lenSegPipe        = 7,
+                  nbSegRad          = 5,
+                  nbSegCercle       = 10,
+                  areteFaceFissure  = 10)
+
+# ---------------------------------------------------------------------------
+
+referencesMaillageFissure = dict(Entity_Quad_Pyramid    = 0,
+                                 Entity_Quad_Triangle   = 0,
+                                 Entity_Quad_Edge       = 0,
+                                 Entity_Quad_Penta      = 0,
+                                 Entity_Quad_Hexa       = 0,
+                                 Entity_Node            = 0,
+                                 Entity_Quad_Tetra      = 0,
+                                 Entity_Quad_Quadrangle = 0)
+
index 87657a1e6ac8e14287cafcc7c0644770b24cff30..9885a96a385a27a1a4884337e829a9c92c15b754 100644 (file)
@@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -45,7 +45,7 @@ class cylindre(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     """
@@ -89,9 +89,9 @@ class cylindre(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index e2023fe678942c11be3d8fb4f6d9297a187ae691..8d83ec10370a831217ce857d831f3c5505f4cae2 100644 (file)
@@ -15,7 +15,7 @@ from cylindre import cylindre
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
index 00eef0df65c73dda309777a7f70e706cba5a493c..2e39357ae5b9a76a4dce43217eccbd338c5c2ced 100644 (file)
@@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -47,7 +47,7 @@ class ellipse_1(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     convexe     : optionnel, True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
@@ -93,9 +93,9 @@ class ellipse_1(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index 15e0c1b604a544da0840466760a4794145472f90..69ae3ed958c7568e67dbb1abc02ea7b13aef72d2 100644 (file)
@@ -18,7 +18,7 @@ from ellipse_1 import ellipse_1
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
index 66f9774bfb101e763c056edcfd0be8f399ec6c8c..1980367f453117070c605d2a869e4eb2b867f2b6 100644 (file)
@@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -41,7 +41,7 @@ class eprouvetteCourbe(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     convexe     : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
@@ -87,9 +87,9 @@ class eprouvetteCourbe(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index 8e08dd8e56f9eafd1c5dff7840804c1a26402091..202a96a447641ca8c9f004d029803eb7cd561eaf 100644 (file)
@@ -19,7 +19,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -42,7 +42,7 @@ class eprouvetteDroite(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     convexe     : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
@@ -89,9 +89,9 @@ class eprouvetteDroite(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index de55fd25f2150183bab09bcec636f7f97f39134c..8f78081904d86a30e3f68a7015ce7b0e7fd26b29 100644 (file)
@@ -18,7 +18,7 @@ from eprouvetteDroite import eprouvetteDroite
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
index 2d7b80dbe428499d89d1a03e89af720c66166086..8d8524f739cbe398d1dba052417ada5abe4ac43d 100644 (file)
@@ -1,13 +1,26 @@
 # -*- coding: utf-8 -*-
 
 import sys, traceback
+import logging
 from blocFissure import gmu
 from blocFissure.gmu import initLog
+
+# -----------------------------------------------------------------------------------------------
 #initLog.setDebug()
 initLog.setVerbose()
+#initLog.setRelease()
+#initLog.setPerfTests()
+
+# ---tous les cas en sequence, ou les cas selectionnés ...
+runall = True
+if runall:
+  torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,]
+else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27   
+  torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,]
+# -----------------------------------------------------------------------------------------------
 
 from blocFissure.gmu import geomsmesh
-from blocFissure.casStandard import casStandard
+from blocFissure.gmu.casStandard import casStandard
 
 problemes = []
 
@@ -111,15 +124,22 @@ cas=24
 from blocFissure.CasTests.vis_1 import vis_1
 problemes.append(vis_1(cas))
 
-# ---tous les cas en sequence, ou les cas selectionnés ...
-runall = True
-if runall:
-  torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,]
-else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24   
-  torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]
+cas=25
+from blocFissure.CasTests import cubeCoin
+problemes.append(casStandard(cubeCoin.dicoParams, cubeCoin.referencesMaillageFissure, cas))
+
+cas=26
+from blocFissure.CasTests import cubeMilieu
+problemes.append(casStandard(cubeMilieu.dicoParams, cubeMilieu.referencesMaillageFissure, cas))
+
+cas=27
+from blocFissure.CasTests import cubeTransverse
+problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, cas))
+
   
 for i in range(len(problemes)):
   if torun[i]:
+    logging.critical("=== Execution cas %s", i)
     try:
       problemes[i].executeProbleme()
     except:
index dfb251cc040741bcced48e3954003e086f6f5c5d..890a76ea80b913030e561265f2ea18688c05937f 100644 (file)
@@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -41,7 +41,7 @@ class faceGauche(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     convexe     : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
@@ -87,9 +87,9 @@ class faceGauche(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index cc8a03db86b03a3f11c71574ea614a71f35d2649..2feaec3a8ce81f524cbd38204e9c4baa86a2be15 100644 (file)
@@ -19,7 +19,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -42,7 +42,7 @@ class faceGauche_2(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     convexe     : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
@@ -60,7 +60,7 @@ class faceGauche_2(fissureGenerique):
 
     shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP")
     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
-    geompy.UnionIDs(fondFiss, [12, 4])
+    geompy.UnionIDs(fondFiss, [14, 9])
     geompy.addToStudy( shellFiss, 'shellFiss' )
     geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
 
@@ -88,9 +88,9 @@ class faceGauche_2(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index 9e763659987d47739a40e7fea9cf1cade7a94cee..5f3053f3a69efd4d3725a48d5a6e9cf3fab4c317 100644 (file)
@@ -51,7 +51,6 @@ class fissureCoude_1(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 2.5,
                                    lenSegPipe  = 2.5,
index 33ab3e012b0b593dcd1b960e50bf91d43499a5e0..ba74c5983c3b29510b8022169059a7a306799e6a 100644 (file)
@@ -50,7 +50,6 @@ class fissureCoude_10(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-#    logging.info("setParamShapeFissure %s", self.nomCas)
     self.shapeFissureParams = dict(profondeur  = 2.5,
                                    rayonPipe   = 1.5,
                                    lenSegPipe  = 6,
index 0690c01d66b6afece8f8df8883956c1684487c3f..53479bfeff7ce34ca2df43743389c8b31cdf5315 100644 (file)
@@ -51,7 +51,6 @@ class fissureCoude_2(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 2.5,
                                    lenSegPipe  = 2.5,
index 653192d5ba96c0ac595997780d537d742f760835..f21b11a38a39cff9cb9d109ee955e51927f583b3 100644 (file)
@@ -51,7 +51,6 @@ class fissureCoude_3(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 2.5,
                                    lenSegPipe  = 2.5,
index 8d43dcc41edfb919fd7f2508c5a1a22e61daa50d..7f8c535701f8fc99a471715dd2265cc8ab5c95a4 100644 (file)
@@ -51,7 +51,6 @@ class fissureCoude_4(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 2.5,
                                    lenSegPipe  =2.5,
index 23477e1346545db4d66b5a1d0bdc220a4fbc3d3a..aab86cd783bab30985acf04348115d4d7fdb089e 100644 (file)
@@ -51,7 +51,6 @@ class fissureCoude_5(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 2.5,
                                    lenSegPipe  = 2.5,
@@ -76,7 +75,7 @@ class fissureCoude_5(fissureCoude):
                                       nomFicSain    = self.nomCas,
                                       nomFicFissure = 'fissure_' + self.nomCas,
                                       nbsegRad      = 5,
-                                      nbsegCercle   = 6,
+                                      nbsegCercle   = 8,
                                       areteFaceFissure = 5)
 
   # ---------------------------------------------------------------------------
index 0952579a8589c41fefa990acc7306266eda8f138..18becbc7a31ae1de3c9bfb14f494b6724b645212 100644 (file)
@@ -48,7 +48,6 @@ class fissureCoude_6(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 4,
                                    lenSegPipe  = 4,
index d19a4b14cf43952dd2ef5db81bd16515fcc1eb93..78df23afa117d7a7b761649dfa34334db40d4491 100644 (file)
@@ -49,7 +49,6 @@ class fissureCoude_7(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-#    logging.info("setParamShapeFissure %s", self.nomCas)
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 4,
                                    lenSegPipe  = 4,
index 49439b6ec552b9cb937b2d969d587e0f48050672..2f189cb3cb0f60d277f8501f2edbd1801fbb5e60 100644 (file)
@@ -50,7 +50,6 @@ class fissureCoude_8(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-#    logging.info("setParamShapeFissure %s", self.nomCas)
     self.shapeFissureParams = dict(profondeur  = 8,
                                    rayonPipe   = 1,
                                    lenSegPipe  = 1.5,
index d7370d1edd6a4c4126ad9694fa78a1035b715a75..5a5139959786b9c0be21deb1244b857dc0f814df 100644 (file)
@@ -49,7 +49,6 @@ class fissureCoude_9(fissureCoude):
     pointIn_x   : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
     externe     : True : fissure face externe, False : fissure face interne
     """
-    print "setParamShapeFissure", self.nomCas
     self.shapeFissureParams = dict(profondeur  = 10,
                                    rayonPipe   = 2,
                                    lenSegPipe  = 6,
index fdcb5c94f2c002cc823830404aa11adcb9843f1d..cf4400faa918e2fdd0205e7dcb1a899bb245a3f8 100644 (file)
@@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique
 from blocFissure.gmu.triedreBase import triedreBase
 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -41,7 +41,7 @@ class vis_1(fissureGenerique):
   # ---------------------------------------------------------------------------
   def setParamShapeFissure(self):
     """
-    paramètres de la fissure pour méthode insereFissureGenerale
+    paramètres de la fissure pour méthode construitFissureGenerale
     lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
     rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
     convexe     : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
@@ -59,7 +59,7 @@ class vis_1(fissureGenerique):
 
     shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP")
     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
-    geompy.UnionIDs(fondFiss, [4, 7, 9])
+    geompy.UnionIDs(fondFiss, [7, 9])
     geompy.addToStudy( shellFiss, 'shellFiss' )
     geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
 
@@ -87,9 +87,9 @@ class vis_1(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index 62a3fa88e6f78fa5c6d25f964af382413db55bec..97e3d10ac90f8635982dd9e54b8636d3c6fd6ffe 100644 (file)
@@ -1,25 +1,38 @@
 
 Exécution des exemples et cas tests :
------------------------------------- 
+=====================================
 
 - lancer salome
-- exécuter les instructions suivantes dans la console Python embarquée, ou dans une console Python avec l'environnement SALOME
-  # les shapes et fichiers med nécessaires aux tests sont créés dans ${SMESH_ROOT_DIR}/share/salome/plugins/smesh/blocFissure/CasTests
+- exécuter les instructions suivantes dans la console Python embarquée,
+  ou dans une console Python avec l'environnement SALOME (salome shell)
+
+  # les shapes et fichiers med nécessaires aux tests sont créés dans
+    ${SMESH_ROOT_DIR}/lib/python2.7/site-packages/salome/blocFissure/CasTests
+
   # les maillages fissurés sont Ã©crits dans le répertoire d'exécution.
 
 
-# preparation des shapes et fichiers MED
+# préparation des shapes et fichiers MED
+----------------------------------------
 
-import sys, os
-sys.path.append(os.path.join(os.environ["SMESH_ROOT_DIR"], "share", "salome", "plugins", "smesh"))
 from blocFissure.materielCasTests import genereMateriel
 
-# execution exemples
+# exécution exemple
+-------------------
 
-from blocFissure import exemple
 from blocFissure import exemple
 
-# execution des cas tests
+# exécution des cas tests (long: 1/2 heure)
+-------------------------------------------
 
 from blocFissure.CasTests import execution_Cas
 
+# bug et problèmes des cas tests
+--------------------------------
+
+Mauvaise détection d'arête vive avec GetInPlace : cas 7, 24
+
+Le maillage longitudinal du pipe peut creer des mailles de faible Ã©paisseur
+à une des extrémités : le maillage en triangles des faces de fissure et de peau
+peut Ãªtre moche au voisinage, de même que les tétraèdres qui s'appuient dessus.
+(2,3,16,26 ?)
diff --git a/src/Tools/blocFissure/casStandard.py b/src/Tools/blocFissure/casStandard.py
deleted file mode 100644 (file)
index 9c1ac55..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import os
-from blocFissure import gmu
-from blocFissure.gmu.geomsmesh import geompy, smesh
-
-import math
-import GEOM
-import SALOMEDS
-import SMESH
-#import StdMeshers
-#import GHS3DPlugin
-#import NETGENPlugin
-import logging
-
-from blocFissure.gmu.fissureGenerique import fissureGenerique
-
-from blocFissure.gmu.initEtude import initEtude
-from blocFissure.gmu.triedreBase import triedreBase
-from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
-from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
-
-O, OX, OY, OZ = triedreBase()
-
-class casStandard(fissureGenerique):
-  """
-  problème de fissure standard, défini par :
-  - un maillage sain (hexaèdres),
-  - une face géométrique de fissure, qui doit légèrement dépasser hors du volume maillé
-  - les numéros d'arêtes (edges géométriques) correspondant au fond de fissure
-  - les paramètres de maillage de la fissure
-  """
-
-  # ---------------------------------------------------------------------------
-  def __init__ (self, dicoParams, references = None, numeroCas = 0):
-    initEtude()
-    self.references = references
-    self.dicoParams = dicoParams
-    if self.dicoParams.has_key('nomCas'):
-      self.nomCas = self.dicoParams['nomCas']
-    else:
-      self.nomCas = 'casStandard'    
-    self.numeroCas = numeroCas
-    if self.numeroCas != 0:
-      self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
-    else:
-      self.nomProbleme = self.nomCas
-    if self.dicoParams.has_key('lenSegPipe'):
-      self.lenSegPipe = self.dicoParams['lenSegPipe']
-    else:
-      self.lenSegPipe =self.dicoParams['rayonPipe']
-    if self.dicoParams.has_key('step'):
-      step = self.dicoParams['step']
-    else:
-      step = -1 # exécuter toutes les Ã©tapes
-    if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
-      self.executeProbleme(step)
-    
-  # ---------------------------------------------------------------------------
-  def genereMaillageSain(self, geometriesSaines, meshParams):
-    logging.info("genereMaillageSain %s", self.nomCas)
-
-    ([objetSain], status) = smesh.CreateMeshesFromMED(self.dicoParams['maillageSain'])
-    smesh.SetName(objetSain.GetMesh(), 'objetSain')
-
-    return [objetSain, True] # True : maillage hexa
-
-  # ---------------------------------------------------------------------------
-  def setParamShapeFissure(self):
-    """
-    paramètres de la fissure pour méthode insereFissureGenerale
-    lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
-    rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
-    convexe     : True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
-    pointIn_x   : optionnel : coordonnée x d'un point dans le solide sain (pour orienter la face - idem avec y,z)
-    """
-    logging.info("setParamShapeFissure %s", self.nomCas)
-    if self.dicoParams.has_key('pointInterieur'):
-      self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
-                                     rayonPipe   = self.dicoParams['rayonPipe'],
-                                     lenSegPipe  = self.lenSegPipe,
-                                     pointIn_x   = self.dicoParams['pointInterieur'][0],
-                                     pointIn_y   = self.dicoParams['pointInterieur'][1],
-                                     pointIn_z   = self.dicoParams['pointInterieur'][2])
-    else:
-      self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
-                                     rayonPipe   = self.dicoParams['rayonPipe'],
-                                     lenSegPipe  = self.lenSegPipe)
-
-  # ---------------------------------------------------------------------------
-  def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
-    logging.info("genereShapeFissure %s", self.nomCas)
-
-    lgInfluence = shapeFissureParams['lgInfluence']
-
-    shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
-    fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
-    geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
-    geompy.addToStudy( shellFiss, 'shellFiss' )
-    geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
-
-
-    coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1])
-
-    centre = None
-    return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
-
-  # ---------------------------------------------------------------------------
-  def setParamMaillageFissure(self):
-    self.maillageFissureParams = dict(nomRep           = '.',
-                                      nomFicSain       = self.nomCas,
-                                      nomFicFissure    = 'fissure_' + self.nomCas,
-                                      nbsegRad         = self.dicoParams['nbSegRad'],
-                                      nbsegCercle      = self.dicoParams['nbSegCercle'],
-                                      areteFaceFissure = self.dicoParams['areteFaceFissure'])
-
-  # ---------------------------------------------------------------------------
-  def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
-    elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
-    return elementsDefaut
-
-  # ---------------------------------------------------------------------------
-  def genereMaillageFissure(self, geometriesSaines, maillagesSains,
-                            shapesFissure, shapeFissureParams,
-                            maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
-    return maillageFissure
-
-  # ---------------------------------------------------------------------------
-  def setReferencesMaillageFissure(self):
-    if self.references is not None:
-      self.referencesMaillageFissure = self.references
-    else:
-      self.referencesMaillageFissure = dict(Entity_Quad_Pyramid    = 0,
-                                            Entity_Quad_Triangle   = 0,
-                                            Entity_Quad_Edge       = 0,
-                                            Entity_Quad_Penta      = 0,
-                                            Entity_Quad_Hexa       = 0,
-                                            Entity_Node            = 0,
-                                            Entity_Quad_Tetra      = 0,
-                                            Entity_Quad_Quadrangle = 0)
-
index f351d59c94d1882d8dce025acd8cc4f94691b123..d43618f9c6dd5b6a473e3237ecac2ba4538bee15 100644 (file)
@@ -6,7 +6,7 @@ from blocFissure.gmu import initLog
 initLog.setDebug()
 #initLog.setVerbose()
 
-from blocFissure.casStandard import casStandard
+from blocFissure.gmu.casStandard import casStandard
 
 dicoParams = dict(nomCas            = 'angleCube',
                   maillageSain      = os.path.join(gmu.pathBloc, 'materielCasTests/CubeAngle.med'),
index c6d20eb27bc0c4e93ca22d3070b45a578f69a352..e7320f55b8391890230c7114d344bdfbf7ba1e61 100644 (file)
@@ -74,18 +74,19 @@ from blocFissure.gmu import initLog
 #initLog.setDebug()
 initLog.setVerbose()
 
-from blocFissure.casStandard import casStandard
+from blocFissure.gmu.casStandard import casStandard
 
 dicoParams = dict(nomCas            = 'angleCube2',
                   maillageSain      = 'boite.med',
                   brepFaceFissure   = "disk.brep",
                   edgeFissIds       = [4],
-                  lgInfluence       = 20,
+                  lgInfluence       = 50,
                   meshBrep          = (5,10),
-                  rayonPipe         = 10,
+                  rayonPipe         = 15,
+                  lenSegPipe        = 20,
                   nbSegRad          = 5,
-                  nbSegCercle       = 8,
-                  areteFaceFissure  = 10)
+                  nbSegCercle       = 12,
+                  areteFaceFissure  = 2)
 
 execInstance = casStandard(dicoParams)
 
diff --git a/src/Tools/blocFissure/fissureLauncher.py b/src/Tools/blocFissure/fissureLauncher.py
new file mode 100644 (file)
index 0000000..10f7b0f
--- /dev/null
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+""" FissureLauncher:
+    Permet de lancer le script 'casStandard'
+    en fonction des paramètres contenus dans 'dicoParams'. """
+
+#import sys
+import salome
+
+#import os
+#from blocFissure import gmu
+from blocFissure.gmu import initLog
+initLog.setDebug()
+#initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+mesh = 'maillageSainTuyauFEM.med'
+crack = 'fissureQuartEllipse.brep'
+
+dicoParams = dict(nomCas            = 'fissTuyau',
+                  maillageSain      = '/local00/home/I48174/Bureau/supportMaillage/{0}'.format(mesh),
+                  brepFaceFissure   = '/local00/home/I48174/Bureau/supportMaillage/{0}'.format(crack),
+                  edgeFissIds       = [9],
+                  lgInfluence       = 250,
+                  meshBrep          = (10, 50),
+                  rayonPipe         = 35,
+                  lenSegPipe        = 7, #9,
+                  nbSegRad          = 6,
+                  nbSegCercle       = 30,
+                  areteFaceFissure  = 20)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+    salome.sg.updateObjBrowser(1)
\ No newline at end of file
index 0a301aec9d760e124419d1bdba425a066ea42b0d..c0afb86bed5ba1b748d273013b644b83e26ba7de 100644 (file)
 # scripts / static
 SET(plugin_SCRIPTS
   __init__.py
+  ajustePointsEdgePipeFissure.py
   blocDefaut.py
+  calculePointsAxiauxPipe.py
+  casStandard.py
   checkDecoupePartition.py
   commonSubShapes.py
+  compoundFromList.py
+  construitEdgesRadialesDebouchantes.py
+  construitFissureGenerale.py
+  construitMaillagePipe.py
+  construitPartitionsPeauFissure.py
+  creePointsPipePeau.py
   creeZoneDefautDansObjetSain.py
   creeZoneDefautFilling.py
   creeZoneDefautGeom.py
   creeZoneDefautMaillage.py
   distance2.py
   eliminateDoubles.py
+  elimineExtremitesPipe.py
   ellipsoideDefaut.py
   enleveDefaut.py
   extractionOrienteeMulti.py
@@ -43,20 +53,32 @@ SET(plugin_SCRIPTS
   findWireIntermediateVertices.py
   fissureCoude.py
   fissureGenerique.py
+  fusionMaillageAttributionDefaut.py
   genereElemsFissureElliptique.py
   genereMeshCalculZoneDefaut.py
   geomsmesh.py
   getCentreFondFiss.py
   getStatsMaillageFissure.py
   getSubshapeIds.py
+  identifieEdgesPeau.py
+  identifieElementsDebouchants.py
+  identifieElementsFissure.py
+  identifieElementsGeometriquesPeau.py
+  identifieFacesEdgesFissureExterne.py
+  identifieFacesPeau.py
   initEtude.py
   initLog.py
   insereFissureElliptique.py
   insereFissureGenerale.py
   insereFissureLongue.py
+  listOfExtraFunctions.py
+  mailleAretesEtJonction.py
+  mailleFacesFissure.py
+  mailleFacesPeau.py
   meshBlocPart.py
   orderEdgesFromWire.py
   partitionBlocDefaut.py
+  partitionneFissureParPipe.py
   partitionVolumeSain.py
   peauInterne.py
   produitMixte.py
@@ -65,8 +87,11 @@ SET(plugin_SCRIPTS
   prolongeWire.py
   propagateTore.py
   putName.py
+  quadranglesToShapeNoCorner.py
   quadranglesToShape.py
+  quadranglesToShapeWithCorner.py
   regroupeSainEtDefaut.py
+  restreintFaceFissure.py
   rotTrans.py
   shapesSurFissure.py
   shapeSurFissure.py
@@ -78,6 +103,7 @@ SET(plugin_SCRIPTS
   testgmu.py
   toreFissure.py
   triedreBase.py
+  trouveEdgesFissPeau.py
   whichSideMulti.py
   whichSide.py
   whichSideVertex.py
@@ -85,4 +111,4 @@ SET(plugin_SCRIPTS
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/gmu)
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/gmu)
index 728082fb2fd81e7a37aa10529464fa48c5287108..5f144fb6f019f95f4e08fb6c333894c0fe3f60fb 100644 (file)
@@ -2,9 +2,6 @@
 
 import os
 import initLog
-#initLog.setDebug()
-#initLog.setVerbose()
-#initLog.setRelease()
 
 # --- calcul path blocFissure
 
diff --git a/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py b/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py
new file mode 100644 (file)
index 0000000..acce0d0
--- /dev/null
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from findWireIntermediateVertices import findWireIntermediateVertices
+from projettePointSurCourbe import projettePointSurCourbe
+
+def ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne, gptsdisks, idisklim):
+  """
+  ajustement precis des points sur edgesPipeFissureExterneC
+  """
+  logging.info('start')
+  
+  edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)
+  verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne)  # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe)
+  idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté
+  idiskmax = idisklim[1]     # on ne prend pas le disque sur la peau, déjà ajusté
+  idiskint = []
+  for vtx in verticesPFE:
+    distPtVt = []
+    for idisk in range(idiskmin, idiskmax):
+      gptdsk = gptsdisks[idisk]
+      pt = gptdsk[0][-1]       # le point sur l'edge de la fissure externe au pipe
+      distPtVt.append((geompy.MinDistance(pt, vtx), idisk))
+    distPtVt.sort()
+    idiskint.append(distPtVt[0][1])
+    gptsdisks[idiskint[-1]][0][-1] = vtx
+    logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0])
+  for idisk in range(idiskmin, idiskmax):
+    if idisk in idiskint:
+      break
+    logging.debug("ajustement point sur edgePipeFissureExterne: %s", idisk)
+    gptdsk = gptsdisks[idisk]
+    pt = gptdsk[0][-1]       # le point sur l'edge de la fissure externe au pipe
+    distPtEd = [(geompy.MinDistance(pt, edgePFE), k, edgePFE) for k, edgePFE in enumerate(edgesPFE)]
+    distPtEd.sort()
+    edgePFE = distPtEd[0][2]
+    u = projettePointSurCourbe(pt, edgePFE)
+    ptproj = geompy.MakeVertexOnCurve(edgePFE, u)
+    gptsdisks[idisk][0][-1] = ptproj
+
+  return gptsdisks
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py
new file mode 100644 (file)
index 0000000..8a21e72
--- /dev/null
@@ -0,0 +1,120 @@
+# -*- coding: utf-8 -*-
+
+import logging
+import math
+
+from geomsmesh import geompy
+from geomsmesh import smesh
+  
+def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, 
+                            centreFondFiss, wireFondFiss, wirePipeFiss,
+                            lenSegPipe, rayonPipe, nbsegCercle, nbsegRad):
+  """
+  preparation maillage du pipe :
+  - détections des points a respecter : jonction des edges/faces constituant
+    la face de fissure externe au pipe
+  - points sur les edges de fond de fissure et edges pipe/face fissure,
+  - vecteurs tangents au fond de fissure (normal au disque maillé)  
+  """
+  
+  logging.info('start')
+
+  # --- option de maillage selon le rayon de courbure du fond de fissure 
+  lenEdgeFondExt = 0
+  for edff in edgesFondFiss:
+    lenEdgeFondExt += geompy.BasicProperties(edff)[0]
+  
+  disfond = []
+  for filling in facesDefaut:
+    disfond.append(geompy.MinDistance(centreFondFiss, filling))
+  disfond.sort()
+  rcourb = disfond[0]
+  nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle
+  alpha = math.pi/(4*nbSegQuart)
+  deflexion = rcourb*(1.0 -math.cos(alpha))
+  lgmin = lenSegPipe*0.25
+  lgmax = lenSegPipe*1.5               
+  logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax)  
+
+  meshFondExt = smesh.Mesh(wireFondFiss)
+  algo1d = meshFondExt.Segment()
+  hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
+  isDone = meshFondExt.Compute()
+  
+  ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
+  allNodeIds = meshFondExt.GetNodesId()
+  for nodeId in allNodeIds:
+    xyz = meshFondExt.GetNodeXYZ(nodeId)
+    #logging.debug("nodeId %s, coords %s", nodeId, str(xyz))
+    pt = geompy.MakeVertex(xyz[0], xyz[1], xyz[2])
+    u, PointOnEdge, EdgeInWireIndex = geompy.MakeProjectionOnWire(pt, wireFondFiss) # u compris entre 0 et 1
+    edgeOrder = edgesIdByOrientation[EdgeInWireIndex]
+    ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt
+    #logging.debug("nodeId %s, u %s", nodeId, str(u))
+  usort = sorted(ptGSdic)  
+  logging.debug("nombre de points obtenus par deflexion %s",len(usort))
+     
+  centres = []
+  origins = []
+  normals = []      
+  for edu in usort:
+    ied = edu[1]
+    u = edu[2]
+    vertcx = ptGSdic[edu]
+    norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
+    plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
+    part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0)
+    liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
+    if len(liste) == 5: # 4 coins du plan plus intersection recherchée
+      for point in liste:
+        if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin
+          vertpx = point
+          break
+      centres.append(vertcx)
+      origins.append(vertpx)
+      normals.append(norm)
+#      name = "vertcx%d"%i
+#      geompy.addToStudyInFather(wireFondFiss, vertcx, name)
+#      name = "vertpx%d"%i
+#      geompy.addToStudyInFather(wireFondFiss, vertpx, name)
+#      name = "plan%d"%i
+#      geompy.addToStudyInFather(wireFondFiss, plan, name)
+
+  # --- maillage du pipe Ã©tendu, sans tenir compte de l'intersection avec la face de peau
+      
+  logging.debug("nbsegCercle %s", nbsegCercle)
+  
+  # -----------------------------------------------------------------------
+  # --- points géométriques
+  
+  gptsdisks = [] # vertices géométrie de tous les disques
+  raydisks = [[] for i in range(nbsegCercle)]
+  for i in range(len(centres)): # boucle sur les disques
+    gptdsk = [] # vertices géométrie d'un disque
+    vertcx = centres[i]
+    vertpx = origins[i]
+    normal = normals[i]
+    vec1 = geompy.MakeVector(vertcx, vertpx)
+    
+    points = [vertcx] # les points du rayon de référence
+    for j in range(nbsegRad):
+      pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*float(rayonPipe)/nbsegRad)
+      points.append(pt)
+    gptdsk.append(points)
+    pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe)
+    rayon = geompy.MakeLineTwoPnt(vertcx, pt)
+    raydisks[0].append(rayon)
+    
+    for k in range(nbsegCercle-1):
+      angle = (k+1)*2*math.pi/nbsegCercle
+      pts = [vertcx] # les points d'un rayon obtenu par rotation
+      for j in range(nbsegRad):
+        pt = geompy.MakeRotation(points[j+1], normal, angle)
+        pts.append(pt)
+      gptdsk.append(pts)
+      ray = geompy.MakeRotation(rayon, normal, angle)
+      raydisks[k+1].append(ray)
+      
+    gptsdisks.append(gptdsk)
+    
+  return (centres, gptsdisks, raydisks)
diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py
new file mode 100644 (file)
index 0000000..b0bca4e
--- /dev/null
@@ -0,0 +1,147 @@
+# -*- coding: utf-8 -*-
+
+import os
+from geomsmesh import geompy, smesh
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from fissureGenerique import fissureGenerique
+
+from initEtude import initEtude
+from triedreBase import triedreBase
+from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from construitFissureGenerale import construitFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class casStandard(fissureGenerique):
+  """
+  problème de fissure standard, défini par :
+  - un maillage sain (hexaèdres),
+  - une face géométrique de fissure, qui doit légèrement dépasser hors du volume maillé
+  - les numéros d'arêtes (edges géométriques) correspondant au fond de fissure
+  - les paramètres de maillage de la fissure
+  """
+
+  # ---------------------------------------------------------------------------
+  def __init__ (self, dicoParams, references = None, numeroCas = 0):
+    initEtude()
+    self.references = references
+    self.dicoParams = dicoParams
+    if self.dicoParams.has_key('nomCas'):
+      self.nomCas = self.dicoParams['nomCas']
+    else:
+      self.nomCas = 'casStandard'    
+    self.numeroCas = numeroCas
+    if self.numeroCas != 0:
+      self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
+    else:
+      self.nomProbleme = self.nomCas
+    if self.dicoParams.has_key('lenSegPipe'):
+      self.lenSegPipe = self.dicoParams['lenSegPipe']
+    else:
+      self.lenSegPipe =self.dicoParams['rayonPipe']
+    if self.dicoParams.has_key('step'):
+      step = self.dicoParams['step']
+    else:
+      step = -1 # exécuter toutes les Ã©tapes
+    if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
+      self.executeProbleme(step)
+    
+  # ---------------------------------------------------------------------------
+  def genereMaillageSain(self, geometriesSaines, meshParams):
+    logging.info("genereMaillageSain %s", self.nomCas)
+
+    ([objetSain], status) = smesh.CreateMeshesFromMED(self.dicoParams['maillageSain'])
+    smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+    return [objetSain, True] # True : maillage hexa
+
+  # ---------------------------------------------------------------------------
+  def setParamShapeFissure(self):
+    """
+    paramètres de la fissure pour méthode insereFissureGenerale
+    lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+    rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
+    convexe     : True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+    pointIn_x   : optionnel : coordonnée x d'un point dans le solide sain (pour orienter la face - idem avec y,z)
+    """
+    logging.info("setParamShapeFissure %s", self.nomCas)
+    if self.dicoParams.has_key('pointInterieur'):
+      self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
+                                     rayonPipe   = self.dicoParams['rayonPipe'],
+                                     lenSegPipe  = self.lenSegPipe,
+                                     pointIn_x   = self.dicoParams['pointInterieur'][0],
+                                     pointIn_y   = self.dicoParams['pointInterieur'][1],
+                                     pointIn_z   = self.dicoParams['pointInterieur'][2])
+    else:
+      self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
+                                     rayonPipe   = self.dicoParams['rayonPipe'],
+                                     lenSegPipe  = self.lenSegPipe)
+
+  # ---------------------------------------------------------------------------
+  def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+    logging.info("genereShapeFissure %s", self.nomCas)
+
+    lgInfluence = shapeFissureParams['lgInfluence']
+
+    shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
+    fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+    geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
+    geomPublish(initLog.debug, shellFiss, 'shellFiss' )
+    geomPublishInFather(initLog.debug, shellFiss, fondFiss, 'fondFiss' )
+
+
+    coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1])
+
+    centre = None
+    return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+  # ---------------------------------------------------------------------------
+  def setParamMaillageFissure(self):
+    self.maillageFissureParams = dict(nomRep           = '.',
+                                      nomFicSain       = self.nomCas,
+                                      nomFicFissure    = 'fissure_' + self.nomCas,
+                                      nbsegRad         = self.dicoParams['nbSegRad'],
+                                      nbsegCercle      = self.dicoParams['nbSegCercle'],
+                                      areteFaceFissure = self.dicoParams['areteFaceFissure'])
+
+  # ---------------------------------------------------------------------------
+  def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+    elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+    return elementsDefaut
+
+  # ---------------------------------------------------------------------------
+  def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+                            shapesFissure, shapeFissureParams,
+                            maillageFissureParams, elementsDefaut, step):
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                              shapesFissure, shapeFissureParams,
+                                              maillageFissureParams, elementsDefaut, step)
+    return maillageFissure
+
+  # ---------------------------------------------------------------------------
+  def setReferencesMaillageFissure(self):
+    if self.references is not None:
+      self.referencesMaillageFissure = self.references
+    else:
+      self.referencesMaillageFissure = dict(Entity_Quad_Pyramid    = 0,
+                                            Entity_Quad_Triangle   = 0,
+                                            Entity_Quad_Edge       = 0,
+                                            Entity_Quad_Penta      = 0,
+                                            Entity_Quad_Hexa       = 0,
+                                            Entity_Node            = 0,
+                                            Entity_Quad_Tetra      = 0,
+                                            Entity_Quad_Quadrangle = 0)
+
diff --git a/src/Tools/blocFissure/gmu/compoundFromList.py b/src/Tools/blocFissure/gmu/compoundFromList.py
new file mode 100644 (file)
index 0000000..85b3212
--- /dev/null
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+def compoundFromList(elements, nom=None):
+  """
+  
+  """
+  logging.debug('start')
+  
+  shapeList = []
+  for a in elements:
+    if not isinstance(a, list):
+      shapeList.append(a)
+    else:
+      if a[0] is not None:
+        shapeList.append(a[0])
+      
+  if nom is not None:
+    for i,a in enumerate(shapeList):
+      nomi = nom +"%d"%i
+      logging.debug('nom: %s',nomi)
+      geomPublish(initLog.debug, a, nomi)
+
+  shapeCompound = None
+  if len(shapeList) > 0:
+    shapeCompound =geompy.MakeCompound(shapeList)
+    nomc = "compound_%s"%nom
+    geomPublish(initLog.debug, shapeCompound, nomc)
+  return shapeCompound
+    
diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py
new file mode 100644 (file)
index 0000000..d77ccaf
--- /dev/null
@@ -0,0 +1,108 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+import GEOM
+from sortEdges import sortEdges
+
+def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
+                                       facesPipePeau, edgeRadFacePipePeau, nbsegCercle):
+  """
+  construction des listes d'edges radiales sur chaque extrémité débouchante 
+  """
+  logging.info('start')
+    
+  # --- listes de nappes radiales en filling Ã  chaque extrémité débouchante
+  
+  facesDebouchantes = [False, False]
+  idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau)
+  listNappes =[]
+  for i, idisk in enumerate(idisklim):
+    numout = idiskout[i]
+    logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout)
+    nappes = []
+    if  (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante
+      for k in range(nbsegCercle):
+        if i == 0:
+          iddeb = max(0, numout)
+          idfin = max(iddeb+3,idisk+1) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
+          #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
+          comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
+          name='compoundRay%d'%k
+          geomPublish(initLog.debug, comp, name)
+        else:
+          idfin = min(len(gptsdisks), numout+1)
+          iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
+          #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
+          comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
+          name='compoundRay%d'%k
+          geomPublish(initLog.debug, comp, name)
+        nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
+        nappes.append(nappe)
+        name='nappe%d'%k
+        geomPublish(initLog.debug, nappe, name)
+        facesDebouchantes[i] = True
+    listNappes.append(nappes)
+      
+  # --- mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)
+  for i, nappes in enumerate(listNappes):
+    if facesDebouchantes[i]:
+      for k, face in enumerate(facesPipePeau):
+        #logging.debug('i, k, face, nappes[0] %s %s %s %s', i, k, face, nappes[0])
+        #geomPublish(initLog.debug, nappes[0], 'lanappe')
+        #geomPublish(initLog.debug, face, 'laface')
+        edge = geompy.MakeSection(face, nappes[0])
+        if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0:
+          idFacesDebouchantes[i] = k
+          break
+  logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes)
+
+  # --- construction des listes d'edges radiales sur chaque extrémité débouchante
+  listEdges = []
+  for i, nappes in enumerate(listNappes):
+    ifd = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
+    if ifd < 0:
+      listEdges.append([])
+    else:
+      face = facesPipePeau[ifd]
+      edges = [edgeRadFacePipePeau[ifd]]
+      for k, nappe in enumerate(nappes):
+        if k > 0:
+          obj = geompy.MakeSection(face, nappes[k]) # normalement une edge, parfois un compound d'edges dont un tout petit
+          edge = obj
+          vs = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False)
+          if len(vs) > 2:
+            eds = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False)
+            [edsorted, minl,maxl] = sortEdges(eds)
+            edge = edsorted[-1]
+          else:
+            maxl = geompy.BasicProperties(edge)[0]
+          if maxl < 0.01: # problème MakeSection
+            logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
+            partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0)
+            edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False)
+            ednouv = []
+            for ii, ed in enumerate(edps):
+              vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
+              distx = [geompy.MinDistance(vx, face) for vx in vxs]
+              distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs]
+              dmax = max(distx)
+              logging.debug("  dmax %s",dmax)
+              if dmax < 0.01:
+                ednouv.append(ed)
+            logging.debug("  edges issues de la partition: %s", ednouv)
+            for ii, ed in enumerate(ednouv):
+              geomPublish(initLog.debug, ed, "ednouv%d"%ii)
+            [edsorted, minl,maxl] = sortEdges(ednouv)
+            logging.debug("  longueur edge trouvée: %s", maxl) 
+            edge = edsorted[-1]
+          edges.append(edge)
+          name = 'edgeEndPipe%d'%k
+          geomPublish(initLog.debug, edge, name)
+      listEdges.append(edges)
+      
+  return (listEdges, idFacesDebouchantes)
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py
new file mode 100644 (file)
index 0000000..ddffac3
--- /dev/null
@@ -0,0 +1,332 @@
+# -*- coding: utf-8 -*-
+
+import logging
+import salome
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+import GEOM
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+import SMESH
+import math
+import bisect
+
+# from extractionOrientee import extractionOrientee
+# from extractionOrienteeMulti import extractionOrienteeMulti
+# from sortFaces import sortFaces
+#from sortEdges import sortEdges
+# from eliminateDoubles import eliminateDoubles
+# from substractSubShapes import substractSubShapes
+# from produitMixte import produitMixte
+# from findWireEndVertices import findWireEndVertices
+#from findWireIntermediateVertices import findWireIntermediateVertices
+from orderEdgesFromWire import orderEdgesFromWire
+# from getSubshapeIds import getSubshapeIds
+from putName import putName
+# from distance2 import distance2
+from enleveDefaut import enleveDefaut
+from shapeSurFissure import shapeSurFissure
+from regroupeSainEtDefaut import RegroupeSainEtDefaut
+from triedreBase import triedreBase
+# from checkDecoupePartition import checkDecoupePartition
+# from whichSide import whichSide
+# from whichSideMulti import whichSideMulti
+#from whichSideVertex import whichSideVertex
+#from projettePointSurCourbe import projettePointSurCourbe
+# from prolongeWire import prolongeWire
+from restreintFaceFissure import restreintFaceFissure
+from partitionneFissureParPipe import partitionneFissureParPipe
+from construitPartitionsPeauFissure import construitPartitionsPeauFissure
+from compoundFromList import compoundFromList
+from identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau
+from identifieFacesEdgesFissureExterne import identifieFacesEdgesFissureExterne
+from calculePointsAxiauxPipe import calculePointsAxiauxPipe
+from elimineExtremitesPipe import elimineExtremitesPipe
+from construitEdgesRadialesDebouchantes import construitEdgesRadialesDebouchantes
+from creePointsPipePeau import creePointsPipePeau
+from ajustePointsEdgePipeFissure import ajustePointsEdgePipeFissure
+from construitMaillagePipe import construitMaillagePipe
+from mailleAretesEtJonction import mailleAretesEtJonction
+from mailleFacesFissure import mailleFacesFissure
+from mailleFacesPeau import mailleFacesPeau
+
+# -----------------------------------------------------------------------------
+# --- procédure complète fissure générale
+
+def construitFissureGenerale(maillagesSains,
+                             shapesFissure, shapeFissureParams,
+                             maillageFissureParams, elementsDefaut, step=-1):
+  """
+  TODO: a completer
+  """
+  logging.info('start')
+  
+  shapeDefaut       = shapesFissure[0] # faces de fissure, débordant
+  fondFiss          = shapesFissure[4] # groupe d'edges de fond de fissure
+
+  rayonPipe = shapeFissureParams['rayonPipe']
+  if shapeFissureParams.has_key('lenSegPipe'):
+    lenSegPipe = shapeFissureParams['lenSegPipe']
+  else:
+    lenSegPipe = rayonPipe
+
+  nomRep            = maillageFissureParams['nomRep']
+  nomFicSain        = maillageFissureParams['nomFicSain']
+  nomFicFissure     = maillageFissureParams['nomFicFissure']
+
+  nbsegRad          = maillageFissureParams['nbsegRad']      # nombre de couches selon un rayon du pipe
+  nbsegCercle       = maillageFissureParams['nbsegCercle']   # nombre de secteur dans un cercle du pipe
+  areteFaceFissure  = maillageFissureParams['areteFaceFissure']
+
+  pointIn_x = 0.0
+  pointIn_y = 0.0
+  pointIn_z = 0.0
+  isPointInterne = False
+  if shapeFissureParams.has_key('pointIn_x'):
+    pointIn_x = shapeFissureParams['pointIn_x']
+    isPointInterne = True
+  if shapeFissureParams.has_key('pointIn_y'):
+    pointIn_y = shapeFissureParams['pointIn_y']
+    isPointInterne = True
+  if shapeFissureParams.has_key('pointIn_z'):
+    pointIn_z = shapeFissureParams['pointIn_z']
+    isPointInterne = True
+  if isPointInterne:
+    pointInterne = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z)
+  else:
+    pointInterne = None
+
+  #fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
+  fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med'
+
+  # fillings des faces en peau
+  facesDefaut              = elementsDefaut[0]
+  #centresDefaut            = elementsDefaut[1]
+  #normalsDefaut            = elementsDefaut[2]
+  #extrusionsDefaut         = elementsDefaut[3]
+  dmoyen                   = elementsDefaut[4]
+  bordsPartages            = elementsDefaut[5]
+  #fillconts                = elementsDefaut[6]
+  #idFilToCont              = elementsDefaut[7]
+  maillageSain             = elementsDefaut[8]
+  internalBoundary         = elementsDefaut[9]
+  zoneDefaut               = elementsDefaut[10]
+  zoneDefaut_skin          = elementsDefaut[11]
+  zoneDefaut_internalFaces = elementsDefaut[12]
+  zoneDefaut_internalEdges = elementsDefaut[13]
+  #edgeFondExt              = elementsDefaut[14]
+  centreFondFiss           = elementsDefaut[15]
+  #tgtCentre                = elementsDefaut[16]
+
+  O, OX, OY, OZ = triedreBase()
+
+  # --- restriction de la face de fissure au domaine solide :
+  #     partition face fissure Ã©tendue par fillings, on garde la face interne
+  
+  facesPortFissure = restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne)
+  # --- pipe de fond de fissure, prolongé, partition face fissure par pipe
+  #     identification des edges communes pipe et face fissure
+  
+  (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
+  edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
+  for i,edge in enumerate(edgesFondFiss):
+    geomPublishInFather(initLog.debug, wireFondFiss, edge, "edgeFondFiss%d"%i)
+  
+  # --- peau et face de fissure
+  #
+  # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée
+  #     il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure
+  #     liste de faces externes : facesDefaut
+  #     liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
+
+  partitionsPeauFissFond = construitPartitionsPeauFissure(facesDefaut, fissPipe)
+    
+  # --- arêtes vives détectées (dans quadranglesToShapeNoCorner
+  #                             et quadranglesToShapeWithCorner)
+    
+  aretesVivesC = compoundFromList(bordsPartages, "areteVive")
+  aretesVivesCoupees = []  # ensembles des arêtes vives identifiées sur les faces de peau dans l'itération sur partitionsPeauFissFond
+   
+  # --- inventaire des faces de peau coupées par la fissure
+  #     pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
+  #                                0, 1 ou plus edges de la face de fissure externe au pipe
+  
+  nbFacesFilling = len(partitionsPeauFissFond)
+  
+  ptEdgeFond = [ []  for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
+  fsPipePeau = [ []  for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
+  edRadFPiPo = [ []  for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
+  fsFissuExt = [ []  for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
+  edFisExtPe = [ []  for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
+  edFisExtPi = [ []  for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
+  facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
+  edCircPeau = [ []  for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
+  ptCircPeau = [ []  for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
+  gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés Ã  la partie saine
+  gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
+  edFissPeau = [ []  for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+  ptFisExtPi = [ []  for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
+  
+  for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
+    if partitionPeauFissFond is not None:
+      dataPPFF,aretesVivesCoupees = identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss,
+                                                                      edgesFondFiss, wireFondFiss, aretesVivesC,
+                                                                      facesDefaut, centreFondFiss, rayonPipe,
+                                                                      aretesVivesCoupees)      
+      ptEdgeFond[ifil] = dataPPFF['endsEdgeFond']
+      fsPipePeau[ifil] = dataPPFF['facesPipePeau']
+      edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau']
+      fsFissuExt[ifil] = dataPPFF['facesFissExt']
+      edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau']
+      edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe']
+      facesPeaux[ifil] = dataPPFF['facePeau']
+      edCircPeau[ifil] = dataPPFF['edgesCircPeau']
+      ptCircPeau[ifil] = dataPPFF['verticesCircPeau']
+      gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
+      gpedgeVifs[ifil] = dataPPFF['bordsVifs']
+      edFissPeau[ifil] = dataPPFF['edgesFissurePeau']
+      ptFisExtPi[ifil] = dataPPFF['verticesPipePeau']
+
+  facesPipePeau = []
+  edgeRadFacePipePeau = []
+  for ifil in range(nbFacesFilling):
+    facesPipePeau += fsPipePeau[ifil]
+    edgeRadFacePipePeau += edRadFPiPo[ifil]
+  
+  for i, avc in enumerate(aretesVivesCoupees):
+    name = "areteViveCoupee%d"%i
+    geomPublish(initLog.debug, avc, name)
+  
+  # --- identification des faces et edges de fissure externe pour maillage
+  
+  (faceFissureExterne, edgesPipeFissureExterneC,
+    wirePipeFissureExterne, edgesPeauFissureExterneC) = identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe,
+                                                                                          edFisExtPi, edgesPipeFiss)
+
+  # --- preparation maillage du pipe :
+  #     - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe
+  #     - points sur les edges de fond de fissure et edges pipe/face fissure,
+  #     - vecteurs tangents au fond de fissure (normal au disque maillé)
+  
+  (centres, gptsdisks, raydisks) = calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, 
+                                                           centreFondFiss, wireFondFiss, wirePipeFiss,
+                                                           lenSegPipe, rayonPipe, nbsegCercle, nbsegRad)
+   
+  # --- recherche des points en trop (externes au volume Ã  remailler)
+  #     - on associe chaque extrémité du pipe Ã  une face filling 
+  #     - on part des disques aux extrémités du pipe
+  #     - pour chaque disque, on prend les vertices de géométrie,
+  #       on marque leur position relative Ã  la face.
+  #     - on s'arrete quand tous les noeuds sont dedans
+  
+  (idFillingFromBout, idisklim, idiskout) = elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle)
+
+  # --- construction des listes d'edges radiales sur chaque extrémité débouchante
+  
+  (listEdges, idFacesDebouchantes) = construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
+                                                                        facesPipePeau, edgeRadFacePipePeau, nbsegCercle)
+    
+  # --- création des points du maillage du pipe sur la face de peau
+  
+  (gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
+                                             ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
+  
+  # --- ajustement precis des points sur edgesPipeFissureExterneC
+  
+  gptsdisks = ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne, gptsdisks, idisklim)
+    
+   # --- maillage effectif du pipe
+
+  (meshPipe, meshPipeGroups, edgesCircPipeGroup) = construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad)
+  
+  # --- edges de bord, faces défaut Ã  respecter
+  
+  (internalBoundary, bordsLibres, grpAretesVives) = mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, dmoyen)
+
+  # --- maillage faces de fissure
+  
+  (meshFaceFiss, grpFaceFissureExterne, 
+   grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne) = mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC,
+                                                                                meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad)
+
+  # --- maillage faces de peau
+  
+  meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
+                                    facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, 
+                                    bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives,
+                                    edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad)
+
+  # --- regroupement des maillages du défaut
+
+  listMeshes = [internalBoundary.GetMesh(),
+                meshPipe.GetMesh(),
+                meshFaceFiss.GetMesh()]
+  for mp in meshesFacesPeau:
+    listMeshes.append(mp.GetMesh())
+
+  meshBoiteDefaut = smesh.Concatenate(listMeshes, 1, 1, 1e-05,False)
+  # pour aider l'algo hexa-tetra Ã  ne pas mettre de pyramides Ã  l'exterieur des volumes repliés sur eux-mêmes
+  # on désigne les faces de peau en quadrangles par le groupe "skinFaces"
+  group_faceFissOutPipe = None
+  group_faceFissInPipe = None
+  groups = meshBoiteDefaut.GetGroups()
+  for grp in groups:
+    if grp.GetType() == SMESH.FACE:
+      if grp.GetName() == "fisOutPi":
+        group_faceFissOutPipe = grp
+      elif grp.GetName() == "fisInPi":
+        group_faceFissInPipe = grp
+
+  # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D
+  distene=True
+  if distene:
+    algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D)
+  else:
+    algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN)
+    hypo3d = algo3d.MaxElementVolume(1000.0)
+  putName(algo3d.GetSubMesh(), "boiteDefaut")
+  putName(algo3d, "algo3d_boiteDefaut")
+  isDone = meshBoiteDefaut.Compute()
+  putName(meshBoiteDefaut, "boiteDefaut")
+  logging.info("meshBoiteDefaut fini")
+  
+  faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
+  maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
+                              zoneDefaut_internalFaces, zoneDefaut_internalEdges)
+  putName(maillageSain, nomFicSain+"_coupe")
+  extrusionFaceFissure, normfiss = shapeSurFissure(facesPortFissure)
+  maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut,
+                                         None, None, 'COMPLET', normfiss)
+
+  logging.info("conversion quadratique")
+  maillageComplet.ConvertToQuadratic( 1 )
+  logging.info("groupes")
+  groups = maillageComplet.GetGroups()
+  grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
+  fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' )
+
+  logging.info("réorientation face de fissure FACE1")
+  grps = [ grp for grp in groups if grp.GetName() == 'FACE1']
+  nb = maillageComplet.Reorient2D( grps[0], normfiss, grps[0].GetID(1))
+
+  logging.info("réorientation face de fissure FACE2")
+  plansim = geompy.MakePlane(O, normfiss, 10000)
+  fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim)
+  grps = [ grp for grp in groups if grp.GetName() == 'FACE2']
+  nb = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1))
+  fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' )
+
+  logging.info("export maillage fini")
+  maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 )
+  putName(maillageComplet, nomFicFissure)
+  logging.info("fichier maillage fissure %s", fichierMaillageFissure)
+
+  if salome.sg.hasDesktop():
+    salome.sg.updateObjBrowser(1)
+
+  logging.info("maillage fissure fini")
+  
+  return maillageComplet
diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe.py b/src/Tools/blocFissure/gmu/construitMaillagePipe.py
new file mode 100644 (file)
index 0000000..e08ba47
--- /dev/null
@@ -0,0 +1,169 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import smesh
+import SMESH
+
+def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad):
+  """
+  maillage effectif du pipe
+  """
+  logging.info('start')
+  meshPipe = smesh.Mesh(None, "meshPipe")
+  fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS")
+  nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis")
+  faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi")
+  edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss")
+  edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0")
+  edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
+  faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
+  faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
+  
+  mptsdisks  = [] # vertices maillage de tous les disques
+  mEdges     = [] # identifiants edges maillage fond de fissure
+  mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe
+  mFaces     = [] # identifiants faces maillage fissure
+  mVols      = [] # identifiants volumes maillage pipe
+
+  mptdsk = None
+  for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
+    
+    # -----------------------------------------------------------------------
+    # --- points
+    
+    gptdsk = gptsdisks[idisk]
+    if idisk > idisklim[0]:
+      oldmpts = mptdsk
+    mptdsk = [] # vertices maillage d'un disque
+    for k in range(nbsegCercle):
+      points = gptdsk[k]
+      mptids = []
+      for j, pt in enumerate(points):
+        if j == 0 and k > 0:
+          id = mptdsk[0][0]
+        else:
+          coords = geompy.PointCoordinates(pt)
+          id = meshPipe.AddNode(coords[0], coords[1], coords[2])
+        mptids.append(id)
+      mptdsk.append(mptids)
+    mptsdisks.append(mptdsk)
+    
+    # -----------------------------------------------------------------------
+    # --- groupes edges cercles debouchants
+    
+    if idisk == idisklim[0]:
+      pts = []
+      for k in range(nbsegCercle):
+        pts.append(mptdsk[k][-1])
+      edges = []
+      for k in range(len(pts)):
+        k1 = (k+1)%len(pts)
+        idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
+        edges.append(idEdge)
+      edgeCircPipe0Group.Add(edges)
+       
+    if idisk == idisklim[1]:
+      pts = []
+      for k in range(nbsegCercle):
+        pts.append(mptdsk[k][-1])
+      edges = []
+      for k in range(len(pts)):
+        k1 = (k+1)%len(pts)
+        idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
+        edges.append(idEdge)
+      edgeCircPipe1Group.Add(edges)
+    
+    # -----------------------------------------------------------------------
+    # --- groupes faces  debouchantes
+    
+    if idisk == idisklim[0]:
+      faces = []
+      for j in range(nbsegRad):
+        for k in range(nbsegCercle):
+          k1 = k+1
+          if k ==  nbsegCercle-1:
+            k1 = 0
+          if j == 0:
+            idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle
+          else:
+            idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle
+          faces.append(idf)
+      faceCircPipe0Group.Add(faces)
+
+    if idisk == idisklim[1]:
+      faces = []
+      for j in range(nbsegRad):
+        for k in range(nbsegCercle):
+          k1 = k+1
+          if k ==  nbsegCercle-1:
+            k1 = 0
+          if j == 0:
+            idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle
+          else:
+            idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle
+          faces.append(idf)
+      faceCircPipe1Group.Add(faces)
+          
+    # -----------------------------------------------------------------------
+    # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure
+    
+    if idisk == idisklim[0]:
+      mEdges.append(0)
+      mEdgeFaces.append(0)
+      mFaces.append([0])
+      mVols.append([[0]])
+      nodesFondFissGroup.Add([mptdsk[0][0]])
+    else:
+      ide = meshPipe.AddEdge([oldmpts[0][0], mptdsk[0][0]])
+      mEdges.append(ide)
+      fondFissGroup.Add([ide])
+      nodesFondFissGroup.Add([mptdsk[0][0]])
+      ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]])
+      mEdgeFaces.append(ide2)
+      edgeFaceFissGroup.Add([ide2])
+      idFaces = []
+      idVols = []
+      
+      for j in range(nbsegRad):
+        idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]])
+        faceFissGroup.Add([idf])
+        idFaces.append(idf)
+        
+        idVolCercle = []
+        for k in range(nbsegCercle):
+          k1 = k+1
+          if k ==  nbsegCercle-1:
+            k1 = 0
+          if j == 0:
+            idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1],
+                                      oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1]])
+          else:
+            idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j],
+                                      oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1], oldmpts[k1][j]])
+          idVolCercle.append(idv)
+        idVols.append(idVolCercle)  
+        
+      mFaces.append(idFaces)
+      mVols.append(idVols)
+
+  pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' )
+  nbAdd = pipeFissGroup.AddFrom( meshPipe.GetMesh() )
+
+  nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries")
+  edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group]
+
+  meshPipeGroups = dict(fondFissGroup = fondFissGroup,
+                        nodesFondFissGroup = nodesFondFissGroup,
+                        faceFissGroup = faceFissGroup,
+                        edgeFaceFissGroup = edgeFaceFissGroup,
+                        edgeCircPipe0Group = edgeCircPipe0Group,
+                        edgeCircPipe1Group = edgeCircPipe1Group,
+                        faceCircPipe0Group = faceCircPipe0Group,
+                        faceCircPipe1Group = faceCircPipe1Group,
+                        pipeFissGroup = pipeFissGroup,
+                        edgesCircPipeGroup = edgesCircPipeGroup
+                        )
+  
+  return (meshPipe, meshPipeGroups, edgesCircPipeGroup)
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py
new file mode 100644 (file)
index 0000000..20ba23b
--- /dev/null
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+from checkDecoupePartition import checkDecoupePartition
+
+  # -----------------------------------------------------------------------------
+  # --- peau et face de fissure
+  #
+  # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée
+  #     il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure
+  #     liste de faces externes : facesDefaut
+  #     liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
+
+def construitPartitionsPeauFissure(facesDefaut, fissPipe):
+  """
+  partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée.
+  Il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure.
+  @param facesDefaut liste de faces externes
+  @param fissPipe    partition face de fissure etendue par pipe prolongé
+  @return partitionsPeauFissFond : liste de partitions face externe - fissure (None quand pas d'intersection)
+  """
+  
+  logging.info('start')
+  partitionsPeauFissFond = []
+  ipart = 0
+  for filling in facesDefaut: 
+    part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+    isPart = checkDecoupePartition([fissPipe, filling], part)
+    if isPart: # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte
+      otherFD = [fd for fd in facesDefaut if fd != filling]
+      if len(otherFD) > 0:
+        fissPipePart = geompy.MakePartition([fissPipe], otherFD, [], [], geompy.ShapeType["FACE"], 0, [], 0)
+      else:
+        fissPipePart = fissPipe
+      part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+      partitionsPeauFissFond.append(part)
+      geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
+    else:
+      partitionsPeauFissFond.append(None)
+    ipart = ipart +1
+
+  return partitionsPeauFissFond
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/creePointsPipePeau.py b/src/Tools/blocFissure/gmu/creePointsPipePeau.py
new file mode 100644 (file)
index 0000000..0f3bb71
--- /dev/null
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+from projettePointSurCourbe import projettePointSurCourbe
+
+def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
+                       ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad):
+  """
+  création des points du maillage du pipe sur la face de peau
+  """
+  logging.info('start')
+  
+  for i, edges in enumerate(listEdges):
+    idf = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
+    if idf >= 0:
+      gptdsk = []
+      if idf > 0: # idf vaut 0 ou 1
+        idf = -1  # si idf vaut 1, on prend le dernier Ã©lément de la liste (1 ou 2 extrémités débouchent sur la face)
+      centre = ptEdgeFond[idFillingFromBout[i]][idf]
+      name = "centre%d"%idf
+      geomPublish(initLog.debug, centre, name)
+      vertPipePeau = ptFisExtPi[idFillingFromBout[i]][idf]
+      geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau")
+      grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
+      edgesCirc = []
+      for grpEdgesCirc in grpsEdgesCirc:
+        edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
+      for k, edge in enumerate(edges):
+        extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
+        if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]):
+          bout = extrems[1]
+        else:
+          bout = extrems[0]
+        # ajustement du point extrémité (bout) sur l'edge circulaire en face de peau
+        logging.debug("edgesCirc: %s", edgesCirc)
+        distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)]
+        distEdgeCirc.sort()
+        logging.debug("distEdgeCirc: %s", distEdgeCirc)
+        u = projettePointSurCourbe(bout, distEdgeCirc[0][2])
+        if (abs(u) < 0.02) or (abs(1-u) < 0.02): # les points très proches d'une extrémité doivent y Ãªtre mis précisément.
+          extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True)
+          if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]):
+            bout = extrCircs[0]
+          else:
+            bout = extrCircs[1]
+        else:
+          bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
+        name ="bout%d"%k
+        geomPublishInFather(initLog.debug, centre, bout, name)
+        # enregistrement des points dans la structure
+        points = []
+        for j in range(nbsegRad +1):
+          u = j/float(nbsegRad)
+          points.append(geompy.MakeVertexOnCurve(edge, u))
+        if geompy.MinDistance(bout, points[0]) < geompy.MinDistance(centre, points[0]):
+          points.reverse()
+        points[0] = centre
+        points[-1] = bout
+        gptdsk.append(points)
+      if i == 0:
+        gptsdisks[idisklim[0] -1] = gptdsk
+        idisklim[0] = idisklim[0] -1
+      else:
+        gptsdisks[idisklim[1] +1] = gptdsk
+        idisklim[1] = idisklim[1] +1
+        
+  return (gptsdisks, idisklim)
\ No newline at end of file
index edd6855dbb0528a1b8c70fb561653cce933c42d5..d4270fceade65e7ed994c0ec8c142385fdace2a8 100644 (file)
@@ -7,7 +7,7 @@ import SALOMEDS
 
 from creeZoneDefautMaillage import creeZoneDefautMaillage
 from peauInterne import peauInterne
-from quadranglesToShape import quadranglesToShape
+from quadranglesToShapeNoCorner import quadranglesToShapeNoCorner
 from creeZoneDefautFilling import creeZoneDefautFilling
 from creeZoneDefautGeom import creeZoneDefautGeom
 from getCentreFondFiss import getCentreFondFiss
@@ -18,7 +18,7 @@ from getCentreFondFiss import getCentreFondFiss
 def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
                                 shapeFissureParams, maillageFissureParams):
   """
-  TODO: a compléter
+  #TODO: a compléter
   """
   logging.info('start')
   
@@ -62,7 +62,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
   maillageSain.ExportMED( fichierMaillageSain, 0, SMESH.MED_V2_2, 1 )
   logging.debug("fichier maillage sain %s", fichierMaillageSain)
   [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \
-    peauInterne(fichierMaillageSain, nomZones)
+    peauInterne(fichierMaillageSain, shapeDefaut, nomZones)
 
   facesDefaut = []
   centresDefaut = []
@@ -71,7 +71,9 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
   isPlane = False
   if isHexa and not isPlane:
     meshQuad =  smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0)
-    fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont  = quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss)
+    
+    fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss)
+    
     for filling in fillings:
       [faceDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \
         creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion)
@@ -82,7 +84,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
   else:
     [facesDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \
       creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion)
-    bordsPartages =[]
+    bordsPartages = []
     for face in facesDefaut:
       bordsPartages.append([None,None]) # TODO : traitement des arêtes vives ?
     fillconts = facesDefaut
index ed3229eb8f85ccba744b7a8b5ac9a6f0bf48a141..c83f2aa0256d68d28709b30e009c08f6923c5d30 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- crée zone géométrique défaut a partir d'un filling
@@ -9,7 +12,7 @@ from geomsmesh import geompy
 def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50):
   """
   Construction CAO de la zone Ã  remailler, quand on utilise un filling,
-  après appel creeZoneDefautMaillage et quadranglesToShape
+  après appel creeZoneDefautMaillage et quadranglesToShapeNoCorner
   @param filling : la CAO de la peau du défaut reconstituée
   @param shapeDefaut : objet géométrique représentant la fissure
   (selon les cas, un point central, ou une shape plus complexe,
@@ -21,15 +24,15 @@ def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50):
   trace = True
   facesDefaut = filling
   centreSphere = geompy.MakeCDG(shapeDefaut)
-  geompy.addToStudy(centreSphere, "cdg_defaut")
+  geomPublish(initLog.debug, centreSphere, "cdg_defaut")
   centreDefaut = geompy.MakeProjection(centreSphere, filling)
   if trace:
-    geompy.addToStudy(centreDefaut, "centreDefaut")
+    geomPublish(initLog.debug, centreDefaut, "centreDefaut")
   normalDefaut = geompy.GetNormal(filling, centreDefaut)
   if trace:
-    geompy.addToStudy(normalDefaut, "normalDefaut")
+    geomPublish(initLog.debug, normalDefaut, "normalDefaut")
   extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion)
   if trace:
-    geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
+    geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut")
 
   return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
index 9969c8d8cd4438131a32e7dad3dfd9dc2df52514..4c622ebeab9de2b966dbdad91a74c76867c9098b 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 from prolongeVertices import prolongeVertices
 
 # -----------------------------------------------------------------------------
@@ -42,57 +45,57 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
     curves.append(curve)
     if trace:
       name="poly_%d"%aShape
-      geompy.addToStudy(curve, name)
+      geomPublish(initLog.debug, curve, name)
     #
     cdg = geompy.MakeCDG(curve)
     cdgs.append(cdg)
     if trace:
       name="cdgpoly_%d"%aShape
-      geompy.addToStudy(cdg, name)
+      geomPublish(initLog.debug, cdg, name)
     #
     projCdg = geompy.MakeProjection(cdg, face)
     projs.append(projCdg)
     if trace:
       name="projCdg_%d"%aShape
-      geompy.addToStudy(projCdg, name)
+      geomPublish(initLog.debug, projCdg, name)
     #
     normal = geompy.GetNormal(face, projCdg)
     normals.append(normal)
     if trace:
       name="normal_%d"%aShape
-      geompy.addToStudy(normal, name)
+      geomPublish(initLog.debug, normal, name)
     #
     extrusion = geompy.MakePrismVecH2Ways(curve, normal, 10)
     extrusions.append(extrusion)
     if trace:
       name="extrusion_%d"%aShape
-      geompy.addToStudy(extrusion, name)
+      geomPublish(initLog.debug, extrusion, name)
     #
     verticesProlongees = prolongeVertices(vertices)
     #
     curveprol = geompy.MakePolyline(verticesProlongees, False)
     if trace:
       name="polyProl_%d"%aShape
-      geompy.addToStudy(curveprol, name)
+      geomPublish(initLog.debug, curveprol, name)
     #
     extruprol = geompy.MakePrismVecH2Ways(curveprol, normal, 10)
     if trace:
       name="extruProl_%d"%aShape
-      geompy.addToStudy(extruprol, name)
+      geomPublish(initLog.debug, extruprol, name)
     #
     partition = geompy.MakePartition([face], [extruprol], [], [], geompy.ShapeType["FACE"], 0, [], 0)
     partitions.append(partition)
     if trace:
       name="partition_%d"%aShape
-      geompy.addToStudy(partition, name)
+      geomPublish(initLog.debug, partition, name)
     pass
   #
 
   centreSphere = geompy.MakeCDG(shapeDefaut)
-  geompy.addToStudy(centreSphere, "cdg_defaut")
+  geomPublish(initLog.debug, centreSphere, "cdg_defaut")
   ccurves = geompy.MakeCompound(curves)
   gravCenter = geompy.MakeCDG(ccurves)
-  geompy.addToStudy(gravCenter, "cdg_curves")
+  geomPublish(initLog.debug, gravCenter, "cdg_curves")
   for i in range(len(partitions)):
     if trace:
       logging.debug(" --- original shape %s", origShapes[i])
@@ -114,7 +117,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
         if d == minDist:
           aFace = facesToSort[j]
           name="decoupe_%d"%origShapes[i]
-          geompy.addToStudy(aFace, name)
+          geomPublish(initLog.debug, aFace, name)
           decoupes.append(aFace)
           break
         pass
@@ -123,7 +126,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
   facesDefaut = decoupes[0]
   if len(decoupes) > 1:
     facesDefaut = geompy.MakePartition(decoupes, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-  geompy.addToStudy(facesDefaut, "facesDefaut")
+  geomPublish(initLog.debug, facesDefaut, "facesDefaut")
 
   shells=[]
   if len(decoupes) > 1: # plusieurs faces de defaut
@@ -159,7 +162,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
           theFaces[k:k+1] = []
       theShell = geompy.MakeShell(aShell)
       name = "theShell%d"%len(shells)
-      geompy.addToStudy(theShell,name)
+      geomPublish(initLog.debug, theShell,name)
       shells.append(theShell)
     #
     distances = []
@@ -175,7 +178,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
     subFaces = [facesDefaut]
     theShellDefaut = geompy.MakeShell(subFaces)
   if trace:
-    geompy.addToStudy(theShellDefaut,"theShellDefaut")
+    geomPublish(initLog.debug, theShellDefaut,"theShellDefaut")
 
   theFaces = geompy.ExtractShapes(theShellDefaut, geompy.ShapeType["FACE"], True)
   distances = []
@@ -188,10 +191,10 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
 
   centreDefaut = geompy.MakeProjection(centreSphere, theFaces[index])
   if trace:
-    geompy.addToStudy(centreDefaut, "centreDefaut")
+    geomPublish(initLog.debug, centreDefaut, "centreDefaut")
   normalDefaut = geompy.GetNormal(subFaces[index], centreDefaut)
   if trace:
-    geompy.addToStudy(normalDefaut, "normalDefaut")
+    geomPublish(initLog.debug, normalDefaut, "normalDefaut")
   extrusionDefaut = geompy.MakePrismVecH(theShellDefaut, normalDefaut, -lgExtrusion)
   info = geompy.ShapeInfo(extrusionDefaut)
   logging.debug("shape info %s", info)
@@ -202,6 +205,6 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
       solid0 = geompy.MakeFuse(solid0, solids[i])
     extrusionDefaut = solid0
   if trace:
-    geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
+    geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut")
 
   return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
index 9fcb7d58e340560bf0c86422a59ea769345f8559..dee9bf84fadedccc6ed1b1da48cbf4ace116648a 100644 (file)
@@ -12,7 +12,7 @@ def creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut,
                            nomZones, coordsNoeudsFissure):
   """
   Identification de la zone Ã  remailler, opérations sur le maillage
-  de l'objet sain
+  de l'objet sain.
   La zone Ã  remailler est définie Ã  partir d'un objet géométrique
   ou Ã  partir d'un jeu de points et d'une distance d'influence.
   @param maillagesSains : (le maillage de l'objet initial, booleen isHexa)
diff --git a/src/Tools/blocFissure/gmu/elimineExtremitesPipe.py b/src/Tools/blocFissure/gmu/elimineExtremitesPipe.py
new file mode 100644 (file)
index 0000000..edfb5ed
--- /dev/null
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from whichSideVertex import whichSideVertex
+
+def elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle):
+  """
+  recherche des points en trop (externes au volume Ã  remailler)
+  - on associe chaque extrémité du pipe Ã  une face filling 
+  - on part des disques aux extrémités du pipe
+  - pour chaque disque, on prend les vertices de géométrie,
+    on marque leur position relative Ã  la face.
+  - on s'arrete quand tous les noeuds sont dedans
+  """
+  
+  logging.info('start')
+
+  pt0 = centres[0]
+  pt1 = centres[-1]
+  idFillingFromBout = [None, None]                 # contiendra l'index du filling pour les extrémités 0 et 1
+  nbFacesFilling = len(ptEdgeFond)
+  for ifil in range(nbFacesFilling):
+    for ipt, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face
+      if geompy.MinDistance(pt,pt0) < geompy.MinDistance(pt,pt1): # TODO: trouver plus fiable pour les cas tordus...
+        idFillingFromBout[0] = ifil
+      else: 
+        idFillingFromBout[1] = ifil
+  logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout)
+     
+  logging.debug("recherche des disques de noeuds complètement internes")
+  idisklim = [] # indices des premier et dernier disques internes
+  idiskout = [] # indices des premier et dernier disques externes
+  for bout in range(2):
+    if bout == 0:
+      idisk = -1
+      inc = 1
+      numout = -1
+    else:
+      idisk = len(gptsdisks)
+      inc = -1
+      numout = len(gptsdisks)
+    inside = False
+    outside = True
+    while not inside:
+      idisk = idisk + inc
+      logging.debug("examen disque %s", idisk)
+      gptdsk = gptsdisks[idisk]
+      inside = True
+      for k in range(nbsegCercle):
+        points = gptdsk[k]
+        for j, pt in enumerate(points):
+          side = whichSideVertex(facesDefaut[idFillingFromBout[bout]], pt)
+          if side < 0:
+            if outside: # premier point detecté dedans
+              outside = False
+              numout = idisk -inc # le disque précédent Ã©tait dehors
+          else:
+            inside = False # ce point est dehors              
+        if not inside and not outside:
+          break
+    idisklim.append(idisk)  # premier et dernier disques internes
+    idiskout.append(numout) # premier et dernier disques externes
+    
+  return (idFillingFromBout, idisklim, idiskout)
\ No newline at end of file
index 2ea9e52f952cf2160f7f74fb2d749071205b45a7..ec95646de137c8a55be5bf026155ff012b05c30a 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 from whichSide import whichSide
 
@@ -32,19 +35,19 @@ def extractionOrientee(face, obj, ref, shapeType, tol, prefix=""):
       shapesInside.append(shape)
       if trace:
         name = prefix + "_Inside%d"%i
-        geompy.addToStudyInFather(obj, shape, name)
+        geomPublishInFather(initLog.debug, obj, shape, name)
       i+=1
     elif side == -sideRef:
       shapesOutside.append(shape)
       if trace:
         name = prefix + "_Outside%d"%j
-        geompy.addToStudyInFather(obj, shape, name)
+        geomPublishInFather(initLog.debug, obj, shape, name)
       j+=1
     elif side == 0:
       shapesOnside.append(shape)
       if trace:
         name = prefix + "_Onside%d"%k
-        geompy.addToStudyInFather(obj, shape, name)
+        geomPublishInFather(initLog.debug, obj, shape, name)
       k+=1
     logging.debug("--- shape was %s", name)
   return [shapesInside, shapesOutside, shapesOnside]
index 86faec83d35189cd449ccd76639699ecd19c4635..0c6457ad302b469e9c7dcb004221d51e6ce192a9 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 from whichSideMulti import whichSideMulti
 
@@ -30,19 +33,19 @@ def extractionOrienteeMulti(faces, ifil, obj, centre, shapeType, tol, prefix="")
       shapesInside.append(shape)
       if trace:
         name = prefix + "_Inside%d"%i
-        geompy.addToStudyInFather(obj, shape, name)
+        geomPublishInFather(initLog.debug, obj, shape, name)
       i+=1
     elif side == -1:
       shapesOutside.append(shape)
       if trace:
         name = prefix + "_Outside%d"%j
-        geompy.addToStudyInFather(obj, shape, name)
+        geomPublishInFather(initLog.debug, obj, shape, name)
       j+=1
     elif side == 0:
       shapesOnside.append(shape)
       if trace:
         name = prefix + "_Onside%d"%k
-        geompy.addToStudyInFather(obj, shape, name)
+        geomPublishInFather(initLog.debug, obj, shape, name)
       k+=1
     logging.debug("--- shape was %s", name)
   return [shapesInside, shapesOutside, shapesOnside]
index daca717f2a0b2c6eb18c28723dd203337084090e..71df8eeb03e5e35a82384174815f73fdf8de1429 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- TORE
@@ -20,10 +23,10 @@ def facesCirculaires(bloc, tore):
 
   faces = geompy.GetShapesOnShape(bloc, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
 
-  geompy.addToStudyInFather( tore, faces[0], 'face0' )
-  geompy.addToStudyInFather( tore, faces[1], 'face1' )
-  geompy.addToStudyInFather( tore, faces[2], 'face2' )
-  geompy.addToStudyInFather( tore, faces[3], 'face3' )
+  geomPublishInFather(initLog.debug, tore, faces[0], 'face0' )
+  geomPublishInFather(initLog.debug, tore, faces[1], 'face1' )
+  geomPublishInFather(initLog.debug, tore, faces[2], 'face2' )
+  geomPublishInFather(initLog.debug, tore, faces[3], 'face3' )
 
   centres = [None, None, None, None]
   [v1,centres[0],v3] = geompy.ExtractShapes(faces[0], geompy.ShapeType["VERTEX"], True)
@@ -31,10 +34,10 @@ def facesCirculaires(bloc, tore):
   [v1,centres[2],v3] = geompy.ExtractShapes(faces[2], geompy.ShapeType["VERTEX"], True)
   [v1,centres[3],v3] = geompy.ExtractShapes(faces[3], geompy.ShapeType["VERTEX"], True)
 
-  geompy.addToStudyInFather( faces[0], centres[0], 'centre0' )
-  geompy.addToStudyInFather( faces[1], centres[1], 'centre1' )
-  geompy.addToStudyInFather( faces[2], centres[2], 'centre2' )
-  geompy.addToStudyInFather( faces[3], centres[3], 'centre3' )
+  geomPublishInFather(initLog.debug, faces[0], centres[0], 'centre0' )
+  geomPublishInFather(initLog.debug, faces[1], centres[1], 'centre1' )
+  geomPublishInFather(initLog.debug, faces[2], centres[2], 'centre2' )
+  geomPublishInFather(initLog.debug, faces[3], centres[3], 'centre3' )
 
   alledges = [None, None, None, None]
   alledges[0] = geompy.ExtractShapes(faces[0], geompy.ShapeType["EDGE"], True)
@@ -60,7 +63,7 @@ def facesCirculaires(bloc, tore):
           dicoedge[edgid] = edgesface[j]
           edges.append(edgesface[j])
           named = 'edge_' + str(i) + '_' +str(j)
-          geompy.addToStudyInFather( faces[i], edgesface[j], named)
+          geomPublishInFather(initLog.debug, faces[i], edgesface[j], named)
           vertices = geompy.ExtractShapes(edgesface[j], geompy.ShapeType["VERTEX"], False)
           #firstVertex = geompy.GetFirstVertex(edgesface[j])
           if geompy.GetSubShapeID(tore, vertices[0]) != geompy.GetSubShapeID(tore, centres[i]):
index 1cbf8cea407a2f5b0538c9117648f728c16752be..f1b8dbe4000877f8ece6cd7734768bfeea4d8f95 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- faces fissure dans et hors tore, et edges face hors tore
@@ -24,18 +27,18 @@ def facesFissure(blocp, faceFissure, extrusionDefaut, genint):
     facefissintore = f1
     facefissoutore = f0
 
-  geompy.addToStudyInFather(faceFissure, facefissintore,'facefissintore')
-  geompy.addToStudyInFather(faceFissure, facefissoutore,'facefissoutore')
+  geomPublishInFather(initLog.debug, faceFissure, facefissintore,'facefissintore')
+  geomPublishInFather(initLog.debug, faceFissure, facefissoutore,'facefissoutore')
 
   edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
   edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
 
   for i in range(len(edgeint)):
     name = "edgeint_%d"%i
-    geompy.addToStudyInFather(facefissoutore, edgeint[i],name)
+    geomPublishInFather(initLog.debug, facefissoutore, edgeint[i],name)
   for i in range(len(edgeext)):
     name = "edgeext_%d"%i
-    geompy.addToStudyInFather(facefissoutore, edgeext[i],name)
+    geomPublishInFather(initLog.debug, facefissoutore, edgeext[i],name)
 
   reverext = []
   if len(edgeext) > 1:
index 0431554265b051322a9977414cdf826b43e19b2e..529216958d245295f38a624949576f03d6870bb8 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- identification des faces tore et fissure dans le solide hors tore du bloc partitionné
@@ -21,9 +24,9 @@ def facesToreInBloc(blocp, facefissoutore, facetore1, facetore2):
   blocFaceTore1 = geompy.GetInPlaceByHistory(blocp, facetore1)
   blocFaceTore2 = geompy.GetInPlaceByHistory(blocp, facetore2)
 
-  geompy.addToStudyInFather(blocp, blocFaceFiss,'blocFaceFiss')
-  geompy.addToStudyInFather(blocp, blocFaceTore1,'blocFaceTore1')
-  geompy.addToStudyInFather(blocp, blocFaceTore2,'blocFaceTore2')
+  geomPublishInFather(initLog.debug, blocp, blocFaceFiss,'blocFaceFiss')
+  geomPublishInFather(initLog.debug, blocp, blocFaceTore1,'blocFaceTore1')
+  geomPublishInFather(initLog.debug, blocp, blocFaceTore2,'blocFaceTore2')
 
   return blocFaceFiss, blocFaceTore1, blocFaceTore2
 
index 2ad4dc6e7c79805609d904b6078d016319e467ba..6d3434ba1d54360f5425f5e3570df47797157fd5 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 from extractionOrientee import extractionOrientee
 from getSubshapeIds import getSubshapeIds
 
@@ -43,11 +46,11 @@ def facesVolumesToriques(tore, plan, facesDefaut):
 
   #[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
 
-  geompy.addToStudyInFather( tore, facetore1, 'facetore1' )
-  geompy.addToStudyInFather( tore, facetore2, 'facetore2' )
+  geomPublishInFather(initLog.debug, tore, facetore1, 'facetore1' )
+  geomPublishInFather(initLog.debug, tore, facetore2, 'facetore2' )
 
   [volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True)
-  geompy.addToStudyInFather( tore, volumeTore1, 'volumeTore1' )
-  geompy.addToStudyInFather( tore, volumeTore2, 'volumeTore2' )
+  geomPublishInFather(initLog.debug, tore, volumeTore1, 'volumeTore1' )
+  geomPublishInFather(initLog.debug, tore, volumeTore2, 'volumeTore2' )
 
   return facetore1, facetore2, volumeTore1, volumeTore2
index 1196e28bd22f2bcce0459713d53eb108e0157f0c..22f4ff014f105200a3ebfc6b4b55cdcd64c4a124 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- trouver les vertices extremites d'un wire
@@ -44,11 +47,11 @@ def findWireEndVertices(aWire, getNormals=False):
     else:
       idsubs[subid] = [sub]
       name='vertex%d'%i
-      geompy.addToStudyInFather(aWire, sub, name)
+      geomPublishInFather(initLog.debug, aWire, sub, name)
       if getNormals:
         idnorm[subid] = normals[i]
         name='norm%d'%i
-        geompy.addToStudyInFather(aWire, normals[i], name)
+        geomPublishInFather(initLog.debug, aWire, normals[i], name)
   logging.debug("idsubs: %s", idsubs)
   for k, v in idsubs.iteritems():
     if len(v) == 1:
index 3b8b40591a38fa1b54f0302a4fb1d0def1275994..63c884458002affa026af13e244052e2b6414c0a 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- trouver les vertices intermediaires d'un wire
@@ -41,11 +44,11 @@ def findWireIntermediateVertices(aWire, getNormals=False):
     else:
       idsubs[subid] = [sub]
       name='vertex%d'%i
-      geompy.addToStudyInFather(aWire, sub, name)
+      geomPublishInFather(initLog.debug, aWire, sub, name)
       if getNormals:
         idnorm[subid] = normals[i]
         name='norm%d'%i
-        geompy.addToStudyInFather(aWire, normals[i], name)
+        geomPublishInFather(initLog.debug, aWire, normals[i], name)
   for k, v in idsubs.iteritems():
     if len(v) > 1:
       shortList.append(v[0])
index 0490611aa151d9133f15a8482c2934a04b06eed2..bf8e0e63927e700efe5d9b19805c4e5e27884784 100644 (file)
@@ -1,6 +1,9 @@
 # -*- coding: utf-8 -*-
 
 from geomsmesh import geompy, smesh
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 import math
 import GEOM
@@ -16,7 +19,7 @@ from fissureGenerique import fissureGenerique
 from triedreBase import triedreBase
 from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
 from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from insereFissureGenerale import insereFissureGenerale
+from construitFissureGenerale import construitFissureGenerale
 from sortEdges import sortEdges
 
 O, OX, OY, OZ = triedreBase()
@@ -69,22 +72,22 @@ class fissureCoude(fissureGenerique):
     Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
     tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
     plan_y = geompy.MakePlaneLCS(None, 100000, 3)
-    geompy.addToStudy( plan_y, "plan_y" )
-    geompy.addToStudy( tube_1, "tube_1" )
-    geompy.addToStudy( coude, "coude" )
-    geompy.addToStudy( tube_2, "tube_2" )
+    geomPublish(initLog.debug,  plan_y, "plan_y" )
+    geomPublish(initLog.debug,  tube_1, "tube_1" )
+    geomPublish(initLog.debug,  coude, "coude" )
+    geomPublish(initLog.debug,  tube_2, "tube_2" )
 
     P1 = O
-    geompy.addToStudy( P1, "P1" )
+    geompy.addToStudy(P1, "P1" )
     op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
     P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
     P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
-    geompy.addToStudy( P2, "P2" )
+    geompy.addToStudy(P2, "P2" )
 
     # --- tube coude sain
 
     geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
-    geompy.addToStudy( geometrieSaine, self.nomCas )
+    geomPublish(initLog.debug,  geometrieSaine, self.nomCas )
     [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
 
     xmin = -de -r_cintr -l_tube_p2
@@ -123,19 +126,19 @@ class fissureCoude(fissureGenerique):
     grped = geompy.CutGroups(grpedy0, long_p1)
     grped = geompy.CutGroups(grped, long_p2)
     ep = geompy.CutGroups(grped, long_coude)
-    geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
-    geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
-    geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
-    geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
-    geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
-    geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
+    geomPublishInFather(initLog.debug, geometrieSaine, long_p1, 'long_p1' )
+    geomPublishInFather(initLog.debug, geometrieSaine, ep, 'ep' )
+    geomPublishInFather(initLog.debug, geometrieSaine, long_coude, 'long_coude' )
+    geomPublishInFather(initLog.debug, geometrieSaine, circ_g, 'circ_g' )
+    geomPublishInFather(initLog.debug, geometrieSaine, circ_d, 'circ_d' )
+    geomPublishInFather(initLog.debug, geometrieSaine, long_p2, 'long_p2' )
 
     # --- face extremite tube (EXTUBE)
 
     facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
     EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
     geompy.UnionIDs(EXTUBE, facesIds)
-    geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
+    geomPublishInFather(initLog.debug, geometrieSaine, EXTUBE, 'EXTUBE' )
 
     # --- edge bord extremite tube (BORDTU)
 
@@ -147,17 +150,17 @@ class fissureCoude(fissureGenerique):
         edgesIds.append(edge)
     BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
     geompy.UnionIDs(BORDTU, edgesIds)
-    geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
+    geomPublishInFather(initLog.debug, geometrieSaine, BORDTU, 'BORDTU' )
 
     # --- face origine tube (CLGV)
 
     pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
     vec2 = geompy.MakeVector(P2, pp2)
-    #geompy.addToStudy(vec2, 'vec2')
+    #geomPublish(initLog.debug, vec2, 'vec2')
     facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
     CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
     geompy.UnionIDs(CLGV, facesIds)
-    geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
+    geomPublishInFather(initLog.debug, geometrieSaine, CLGV, 'CLGV' )
 
     # --- peau tube interieur (PEAUINT)
 
@@ -167,11 +170,11 @@ class fissureCoude(fissureGenerique):
     extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
     interne = geompy.MakeFuse(extru1, revol1)
     interne = geompy.MakeFuse(extru2, interne)
-    geompy.addToStudy(interne, 'interne')
+    geomPublish(initLog.debug, interne, 'interne')
     facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
     PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
     geompy.UnionIDs(PEAUINT, facesIds)
-    geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
+    geomPublishInFather(initLog.debug, geometrieSaine, PEAUINT, 'PEAUINT' )
 
     # --- peau tube exterieur (PEAUEXT)
 
@@ -182,18 +185,18 @@ class fissureCoude(fissureGenerique):
     extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
     externe = geompy.MakeFuse(extru1, revol1)
     externe = geompy.MakeFuse(extru2, externe)
-    geompy.addToStudy(externe, 'externe')
+    geomPublish(initLog.debug, externe, 'externe')
     facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
     PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
     geompy.UnionIDs(PEAUEXT, facesIds)
-    geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
+    geomPublishInFather(initLog.debug, geometrieSaine, PEAUEXT, 'PEAUEXT' )
 
     # --- solide sain
 
     volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
     COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
     geompy.UnionIDs(COUDE, volIds)
-    geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' )
+    geomPublishInFather(initLog.debug, geometrieSaine, COUDE, 'COUDSAIN' )
 
     geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
 
@@ -340,7 +343,7 @@ class fissureCoude(fissureGenerique):
 
     azimut = -azimut # axe inverse / ASCOUF
     axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
-    geompy.addToStudy(axe,"axe")
+    geomPublish(initLog.debug, axe,"axe")
     
     if not lgInfluence:
       lgInfluence = profondeur
@@ -377,8 +380,8 @@ class fissureCoude(fissureGenerique):
       pi = geompy.MakeVertex(rayint, 0, 0)      
       pbl = geompy.MakeRotation(pb, OZ, angle)
       pbr = geompy.MakeRotation(pb, OZ, -angle)
-      geompy.addToStudy(pbl,"pbl")
-      geompy.addToStudy(pbr,"pbr")
+      geomPublish(initLog.debug, pbl,"pbl")
+      geomPublish(initLog.debug, pbr,"pbr")
       pal = geompy.MakeTranslationVector(pbl, OZ)
       par = geompy.MakeTranslationVector(pbr, OZ)
       axl = geompy.MakeVector(pbl,pal)
@@ -409,7 +412,7 @@ class fissureCoude(fissureGenerique):
       wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])     
       #wiretube = geompy.MakeInterpol(points)
       wiretube=geompy.MakeWire([wire0,wire1,wire2])
-      geompy.addToStudy(wiretube,"wiretube")
+      geomPublish(initLog.debug, wiretube,"wiretube")
       
       pe = geompy.MakeVertex(rayext, 0, 0)
       pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
@@ -417,22 +420,22 @@ class fissureCoude(fissureGenerique):
       pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
      
       arce = geompy.MakeArc(points[0], pe, points[-1])
-      geompy.addToStudy(arce,"arce")
+      geomPublish(initLog.debug, arce,"arce")
       
       facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
-      geompy.addToStudy( facefiss, 'facefissPlace' )
+      geomPublish(initLog.debug,  facefiss, 'facefissPlace' )
       
       pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
       centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
       centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
       centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
-      geompy.addToStudy( centre, 'centrefissPlace' )
+      geomPublish(initLog.debug,  centre, 'centrefissPlace' )
       
       wiretube = geompy.GetInPlace(facefiss, wiretube)
-      geompy.addToStudy(wiretube, 'wiretubePlace' )
+      geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
       try:
         edgetube = geompy.MakeEdgeWire(wiretube)
-        geompy.addToStudy(edgetube,"edgetube")
+        geomPublish(initLog.debug, edgetube,"edgetube")
       except:
         logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
         edgetube = None
@@ -485,10 +488,10 @@ class fissureCoude(fissureGenerique):
         points.append(pt)
       curves.append(geompy.MakeInterpol(points))
       point0 = points[0]
-      geompy.addToStudy(curves[-1],"curve0")
+      geomPublish(initLog.debug, curves[-1],"curve0")
 #      for i, pt in enumerate(points):
 #        name = "point%d"%i
-#        geompy.addToStudyInFather(curves[-1], pt, name)
+#        geomPublishInFather(initLog.debug,curves[-1], pt, name)
 
       points = []
       nbp = 3*nbp1
@@ -506,10 +509,10 @@ class fissureCoude(fissureGenerique):
         pt = geompy.MakeRotation(pi, axe, angi)
         points.append(pt)
       curves.append(geompy.MakeInterpol(points))
-      geompy.addToStudy(curves[-1],"curve1")
+      geomPublish(initLog.debug, curves[-1],"curve1")
 #      for i, pt in enumerate(points):
 #        name = "point%d"%i
-#        geompy.addToStudyInFather(curves[-1], pt, name)
+#        geomPublishInFather(initLog.debug,curves[-1], pt, name)
 
       points = []
       nbp = 3*nbp1
@@ -529,16 +532,16 @@ class fissureCoude(fissureGenerique):
         points.append(pt)
       curves.append(geompy.MakeInterpol(points))
       point1 = points[-1]
-      geompy.addToStudy(curves[-1],"curve2")
+      geomPublish(initLog.debug, curves[-1],"curve2")
 #      for i, pt in enumerate(points):
 #        name = "point%d"%i
-#        geompy.addToStudyInFather(curves[-1], pt, name)
+#        geomPublishInFather(initLog.debug,curves[-1], pt, name)
       
       wiretube = geompy.MakeWire(curves)
-      geompy.addToStudy(wiretube,"wiretube")
+      geomPublish(initLog.debug, wiretube,"wiretube")
       try:
         edgetube = geompy.MakeEdgeWire(wiretube)
-        geompy.addToStudy(edgetube,"edgetube")
+        geomPublish(initLog.debug, edgetube,"edgetube")
       except:
         logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
         edgetube = None
@@ -553,21 +556,21 @@ class fissureCoude(fissureGenerique):
         pts.append(pt)
       pts.append(point1)
       arce = geompy.MakeInterpol(pts)
-      geompy.addToStudy(arce,"arce")
+      geomPublish(initLog.debug, arce,"arce")
       
       facefiss = geompy.MakeFaceWires([arce, wiretube], 0)
-      geompy.addToStudy( facefiss, 'facefissPlace' )
+      geomPublish(initLog.debug,  facefiss, 'facefissPlace' )
       
       pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
       centre = geompy.MakeRotation(pc, axe, alfrd)
-      geompy.addToStudy( centre, 'centrefissPlace' )
+      geomPublish(initLog.debug,  centre, 'centrefissPlace' )
       
       edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
       edgesTriees, minl, maxl = sortEdges(edges)
       edges = edgesTriees[:-1] # la plus grande correspond Ã  arce, on l'elimine
       wiretube = geompy.MakeWire(edges)
       #wiretube = edgesTriees[-1]
-      geompy.addToStudy(wiretube, 'wiretubePlace' )
+      geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
 
     # ---------------------------------------------------------
 
@@ -612,7 +615,7 @@ class fissureCoude(fissureGenerique):
       arci = geompy.MakePosition(arco, originLCS, localLCS, "arci")
       arce = geompy.MakePosition(lino, originLCS, localLCS, "arce")
       facefiss = geompy.MakeFaceWires([arce, arci], 0)
-      geompy.addToStudy( facefiss, 'facefissPlace' )
+      geomPublish(initLog.debug,  facefiss, 'facefissPlace' )
       edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
       edgesTriees, minl, maxl = sortEdges(edges)
       edgetube = edgesTriees[-1] # la plus grande correspond Ã  arci
@@ -620,7 +623,7 @@ class fissureCoude(fissureGenerique):
       
       pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
       centre = geompy.MakeRotation(pc, axe, alfrd)
-      geompy.addToStudy( centre, 'centrefissPlace' )
+      geomPublish(initLog.debug,  centre, 'centrefissPlace' )
 
     coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur)
 
@@ -651,9 +654,9 @@ class fissureCoude(fissureGenerique):
   def genereMaillageFissure(self, geometriesSaines, maillagesSains,
                             shapesFissure, shapeFissureParams,
                             maillageFissureParams, elementsDefaut, step):
-    maillageFissure = insereFissureGenerale(maillagesSains,
-                                            shapesFissure, shapeFissureParams,
-                                            maillageFissureParams, elementsDefaut, step)
+    maillageFissure = construitFissureGenerale(maillagesSains,
+                                               shapesFissure, shapeFissureParams,
+                                               maillageFissureParams, elementsDefaut, step)
     return maillageFissure
 
   # ---------------------------------------------------------------------------
index 17518e8715f59b412faefee23b2cb9cadef5c672..3296c39cecbaf64bbe54c4b41615f3f113222562 100644 (file)
@@ -1,5 +1,7 @@
 # -*- coding: utf-8 -*-
 
+import logging
+
 from blocFissure import gmu
 from blocFissure.gmu.initEtude import initEtude
 from blocFissure.gmu.getStatsMaillageFissure import getStatsMaillageFissure
@@ -60,7 +62,7 @@ class fissureGenerique():
 # ---------------------------------------------------------------------------
 
   def executeProbleme(self, step=-1):
-    print "executeProbleme", self.nomCas
+    logging.info(" --- executeProbleme %s", self.nomCas)
     if step == 0:
       return
 
diff --git a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py
new file mode 100644 (file)
index 0000000..703c024
--- /dev/null
@@ -0,0 +1,91 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Tue Jun 24 09:14:13 2014
+
+@author: I48174 (Olivier HOAREAU)
+"""
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import smesh
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+import GEOM
+import SMESH
+
+from listOfExtraFunctions import createNewMeshesFromCorner
+from listOfExtraFunctions import createLinesFromMesh
+
+# -----------------------------------------------------------------------------
+# --- groupe de quadrangles de face transformé en face géométrique par filling
+
+def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible, zoneDefaut_skin, shapeDefaut, listOfCorners):
+    """ """
+    # TODO: rédiger la docstring
+    
+    logging.info("start")
+    
+    facesNonCoupees = []
+    facesCoupees = []
+    maillagesNonCoupes = []
+    maillagesCoupes = []
+        
+    # On crée une liste contenant le maillage de chaque face.
+    listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners)
+    
+    i = 0
+    while i < len(listOfNewMeshes):
+        lines = createLinesFromMesh(listOfNewMeshes[i])
+        setOfLines = []
+        for line in lines:
+            # On possède l'information 'ID' de chaque noeud composant chaque
+            # ligne de la face. A partir de l'ID, on crée un vertex. Un
+            # ensemble de vertices constitue une ligne. Un ensemble de lignes
+            # constitue la face.
+            tmpCoords = [maillageDefautCible.GetNodeXYZ(node) for node in line]
+            tmpPoints = [geompy.MakeVertex(val[0], val[1], val[2]) for val in tmpCoords]
+            line = geompy.MakeInterpol(tmpPoints, False, False)
+            setOfLines.append(line)
+        
+        # A partir des lignes de la face,
+        # on recrée un objet GEOM temporaire par filling.
+        filling = geompy.MakeFilling(geompy.MakeCompound(setOfLines), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
+        #logging.debug("face de filling")
+        #geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1))
+        
+        tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+        tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
+        tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
+        if len(tmpExplodeRef) == len(tmpExplodeNum):
+            logging.debug("face de filling non coupee")
+            geompy.addToStudy( filling, "faceNonCoupee_{0}".format(i + 1)) # doit etre publie pour critere OK plus bas
+            facesNonCoupees.append(filling)
+            maillagesNonCoupes.append(listOfNewMeshes[i])
+        else:
+            logging.debug("face de filling coupee")
+            geompy.addToStudy( filling, "faceCoupee_{0}".format(i + 1))
+            facesCoupees.append(filling)
+            maillagesCoupes.append(listOfNewMeshes[i])
+        
+        i += 1
+    
+    listOfInternMeshes = [maillageInterneCible] + [msh.GetMesh() for msh in maillagesNonCoupes]
+    
+    newMaillageInterne = smesh.Concatenate(listOfInternMeshes, 1, 1, 1e-05, False)
+    
+    facesEnTrop = []
+    
+    criteres = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGenSurface, SMESH.FT_Undefined, face) for face in facesNonCoupees]
+    filtres = [smesh.GetFilterFromCriteria([critere]) for critere in criteres]
+    for i, filtre in enumerate(filtres):
+        filtre.SetMesh(maillageSain.GetMesh())
+        faceEnTrop = maillageSain.GroupOnFilter(SMESH.FACE, 'faceEnTrop_{0}'.format(i + 1), filtre)
+        facesEnTrop.append(faceEnTrop)
+    
+    newZoneDefaut_skin = maillageSain.GetMesh().CutListOfGroups([zoneDefaut_skin], facesEnTrop, 'newZoneDefaut_skin')
+    
+    smesh.SetName(newMaillageInterne, 'newInternalBoundary')
+        
+    return newZoneDefaut_skin, newMaillageInterne
+    
\ No newline at end of file
index bbf939417d7a853a789dcd1af59f838fc033c212..62be40c7755176b49577422b1d34102470b0887b 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 from toreFissure import toreFissure
 from ellipsoideDefaut import ellipsoideDefaut
@@ -40,12 +43,12 @@ def genereElemsFissureElliptique(shapeFissureParams):
   plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut)
   ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut)
 
-  geompy.addToStudy( pipe0, 'pipe0' )
-  geompy.addToStudy( gener1, 'gener1' )
-  geompy.addToStudy( pipe1, 'pipe1' )
-  geompy.addToStudy( facefis1, 'facefis1' )
-  geompy.addToStudy( plane1, 'plane1' )
-  geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
+  geomPublish(initLog.debug,  pipe0, 'pipe0' )
+  geomPublish(initLog.debug,  gener1, 'gener1' )
+  geomPublish(initLog.debug,  pipe1, 'pipe1' )
+  geomPublish(initLog.debug,  facefis1, 'facefis1' )
+  geomPublish(initLog.debug,  plane1, 'plane1' )
+  geomPublish(initLog.debug,  ellipsoide1, 'ellipsoide1' )
 
   shapeDefaut = facefis1
   xyz_defaut = geompy.PointCoordinates(centreDefaut)
index a08664bad6f35931590f1e7c56c53968bbbd76cc..08e24748c7da511aee18c714b80c500b7d8cab1e 100644 (file)
@@ -9,8 +9,19 @@ from salome.smesh import smeshBuilder
 
 def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize):
   """
-  TODO: a completer
-  """
+  -Permet de générer un maillage sur l'objet géométrique 'facefiss' via
+   l'algorithme NETGEN_1D2D :
+      -SetMaxSize     = dimension max d'un Ã©lément (maxSize)
+      -SetSecondOrder = Ã©lément quadratique (Y=1, N=0)
+      -SetOptimize    = Ã©lément régulier (Y=1, N=0)
+      -SetFineness    = finesse du maillage
+       [very_coarse, coarse, moderate, fine, very_fine, custom]
+       [0,           1,      2,        3,    4,         5     ]
+      -SetMinSize     = dimension min d'un Ã©lément (minSize)
+      -SetQuadAllowed = permission quadrangle dans maillage triangle
+  -On récupère les coordonnées de chaque noeud de la fissure qu'on stocke
+   dans une liste sous la forme : [X0, Y0, Z0, ..., Xn, Yn, Zn]"""
+   
   logging.info('start')
 
   meshFissure = smesh.Mesh(facefiss)
index 889d35ba309b05e2334c8fe5d035118f9297fcd8..aa8f02c939547605ad62d730a43cf4ec18472492 100644 (file)
@@ -2,6 +2,7 @@
 
 import logging
 logging.info('start')
+import initLog
 
 import salome
 salome.salome_init()
@@ -13,3 +14,12 @@ from salome.smesh import smeshBuilder
 smesh = smeshBuilder.New(salome.myStudy)
 
 logging.debug("initialisation de geompy et smesh OK")
+
+def geomPublish(level,aShape, aName):
+  if initLog.getLogLevel() <= level:
+    geompy.addToStudy(aShape, aName)
+    
+def geomPublishInFather(level, aFather, aShape, aName):
+  if initLog.getLogLevel() <= level:
+    geompy.addToStudyInFather(aFather, aShape, aName)
+    
\ No newline at end of file
index 6c04d36275da6ca5fc7b6f9ded5f49cc69b07787..52f1f3bd9c5902998e9054abfbfcc5be654c8126 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 import bisect
 
 publie = False
@@ -9,14 +12,14 @@ publie = False
 def getCentreFondFiss(shapesFissure):
   """
   identification du centre de fond de fissure,
-  transformation fond de fissure en edge unique (seulement pour la procédure insereFissureGenerale).
+  transformation fond de fissure en edge unique (seulement pour la procédure construitFissureGenerale).
   On distingue le cas d'utilisation de la procédure insereFissureLongue par le nombre d'éléments de shapesFissure.
   """
   global publie
   logging.debug("start")
   
   fondFiss          = shapesFissure[4] # groupe d'edges de fond de fissure
-  if len(shapesFissure) == 6:          # procédure insereFissureGenerale, et edge fond de fissure fournie explicitement
+  if len(shapesFissure) == 6:          # procédure construitFissureGenerale, et edge fond de fissure fournie explicitement
     edgeFondExt     = shapesFissure[5]
   else:
     edgeFondExt     = None
@@ -24,7 +27,7 @@ def getCentreFondFiss(shapesFissure):
   if len(shapesFissure) > 6:           # procédure insereFissureLongue (fissure plane, plusieurs edges sur le fond de fissure)
     centreFondFiss = shapesFissure[1]
     tgtCentre = None
-  else:                                # procédure insereFissureGenerale, détermination edge unique et milieu de l'edge
+  else:                                # procédure construitFissureGenerale, détermination edge unique et milieu de l'edge
     if geompy.NumberOfEdges(fondFiss) > 1:
       if geompy.NbShapes(fondFiss, geompy.ShapeType["WIRE"]) > 0: # wire
         aWire = fondFiss
@@ -35,7 +38,7 @@ def getCentreFondFiss(shapesFissure):
       edgeFondExt = fondFiss
       aWire = geompy.MakeWire([fondFiss], 1e-07)
     if not publie:
-      geompy.addToStudy(aWire, "wireFondFissExt")
+      geomPublish(initLog.debug, aWire, "wireFondFissExt")
         
     lgWire = geompy.BasicProperties(aWire)[0]
     edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True)
@@ -61,7 +64,7 @@ def getCentreFondFiss(shapesFissure):
         centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr])
     else: # on ne sait pas comment est orientée l'edge unique, mais Ã§a n'a pas d'importance
       centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr])
-    geompy.addToStudyInFather(aWire, centreFondFiss, "centreFondFiss")
+    geomPublishInFather(initLog.debug,aWire, centreFondFiss, "centreFondFiss")
     tgtCentre = geompy.MakeTangentOnCurve(edges[iedr], lgOnEdge/ lgEdges[iedr])
     
     if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge
@@ -71,7 +74,7 @@ def getCentreFondFiss(shapesFissure):
         logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
         edgeFondExt = None
     if not publie and edgeFondExt is not None:
-      geompy.addToStudy(edgeFondExt, "edgeFondExt")
+      geomPublish(initLog.debug, edgeFondExt, "edgeFondExt")
   
   publie = True
   return edgeFondExt, centreFondFiss, tgtCentre
diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py
new file mode 100644 (file)
index 0000000..a3abb62
--- /dev/null
@@ -0,0 +1,142 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+from substractSubShapes import substractSubShapes
+
+def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSorted,
+                       edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees):
+  """
+  identification précise des edges et disques des faces de peau selon index extremité fissure
+  """
+  logging.info('start')
+  
+  facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
+  endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
+  edgeRadFacePipePeau = [None for i in range(len(edgesFissExtPipe))]
+  
+  edgesListees = []
+  edgesCircPeau = []
+  verticesCircPeau = []
+  if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+    
+    for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
+      logging.debug("examen face debouchante circulaire")
+      for i,efep in enumerate(edgesFissExtPipe):
+        dist = geompy.MinDistance(face, efep)
+        logging.debug("  distance face circulaire edge %s", dist)
+        if dist < 1e-3:
+          for ik, edpfi in enumerate(edgesPeauFondIn):
+            if geompy.MinDistance(face, edpfi) < 1e-3:
+              break
+          sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[ik]], geompy.ShapeType["VERTEX"])
+          nameFace = "facePipePeau%d"%i
+          nameVert = "endEdgeFond%d"%i
+          nameEdge = "edgeRadFacePipePeau%d"%i
+          facesPipePeau[i] = face
+          endsEdgeFond[i] = sharedVertices[0]
+          geomPublish(initLog.debug, face, nameFace)
+          geomPublish(initLog.debug, sharedVertices[0], nameVert)
+          edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
+          for edge in edgesFace:
+            if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
+              edgeRadFacePipePeau[i] = edge
+              geomPublish(initLog.debug, edge, nameEdge)
+              break
+            pass
+          pass
+        pass
+      pass
+    
+    # --- edges circulaires de la face de peau et points de jonction de la face externe de fissure
+    logging.debug("facesPipePeau: %s", facesPipePeau)
+    edgesCircPeau = [None for i in range(len(facesPipePeau))]
+    verticesCircPeau = [None for i in range(len(facesPipePeau))]        
+    for i,fcirc in enumerate(facesPipePeau):
+      edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
+      grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+      geompy.UnionList(grpEdgesCirc, edges)
+      edgesCircPeau[i] = grpEdgesCirc
+      name = "edgeCirc%d"%i
+      geomPublishInFather(initLog.debug, facePeau, grpEdgesCirc, name)
+      edgesListees = edgesListees + edges
+      vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
+      grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
+      geompy.UnionList(grpVertCircPeau, vertices)
+      verticesCircPeau[i] = grpVertCircPeau
+      name = "pointEdgeCirc%d"%i
+      geomPublishInFather(initLog.debug, facePeau, grpVertCircPeau, name)
+      pass
+    pass # --- au moins une extrémité du pipe sur cette face de peau
+
+  # --- edges de bord de la face de peau
+
+  edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
+  edgesBords = []
+  for i, edge in enumerate(edgesFilling):
+    edgepeau = geompy.GetInPlace(facePeau, edge)
+    name = "edgepeau%d"%i
+    geomPublishInFather(initLog.debug, facePeau,edgepeau, name)
+    logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
+    if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
+      logging.debug("  EDGES multiples")
+      edgs = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False)
+      edgesBords += edgs
+      edgesListees += edgs
+    else:
+      logging.debug("  EDGE")
+      edgesBords.append(edgepeau)
+      edgesListees.append(edgepeau)
+  groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+  geompy.UnionList(groupEdgesBordPeau, edgesBords)
+  bordsVifs = None
+  if aretesVivesC is not None:
+    logging.debug("identification des bords vifs par GetInPlace (old)")
+    bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
+  if bordsVifs is not None:
+    geomPublishInFather(initLog.debug, facePeau, bordsVifs, "bordsVifs")
+    groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
+    grptmp = None
+    if len(aretesVivesCoupees) > 0:
+      grpC = geompy.MakeCompound(aretesVivesCoupees)
+      grptmp = geompy.GetInPlace(facePeau, grpC)
+    if grptmp is not None:
+      grpnew = geompy.CutGroups(bordsVifs, grptmp) # ce qui est nouveau dans bordsVifs
+    else:
+      grpnew = bordsVifs
+    if grpnew is not None:
+      edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
+      aretesVivesCoupees += edv
+  logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
+  geomPublishInFather(initLog.debug, facePeau, groupEdgesBordPeau , "EdgesBords")
+    
+  # ---  edges de la face de peau partagées avec la face de fissure
+  
+  edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
+  edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
+  edgesFissurePeau = []
+  if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+    edgesFissurePeau = [None for i in range(len(verticesCircPeau))] # edges associés aux extrémités du pipe, en premier
+    for edge in edges:
+      for i, grpVert in enumerate(verticesCircPeau):
+        if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
+          edgesFissurePeau[i] = edge
+          name = "edgeFissurePeau%d"%i
+          geomPublishInFather(initLog.debug, facePeau,  edge, name)
+    for edge in edges: # on ajoute après les edges manquantes
+      if edge not in edgesFissurePeau:
+        edgesFissurePeau.append(edge)
+  else:
+    for i, edge in enumerate(edges):
+      edgesFissurePeau.append(edge)
+      name = "edgeFissurePeau%d"%i
+      geomPublishInFather(initLog.debug, facePeau,  edge, name)
+      
+  return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
+          edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
+          bordsVifs, edgesFissurePeau, aretesVivesCoupees)
diff --git a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py
new file mode 100644 (file)
index 0000000..af48544
--- /dev/null
@@ -0,0 +1,151 @@
+# -*- coding: utf-8 -*-
+
+import logging
+import math
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+from produitMixte import produitMixte
+from whichSide import whichSide
+  
+def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
+                                edgesFondIn, edgesFondFiss, wireFondFiss,
+                                aretesVivesC, fillingFaceExterne,
+                                edgesPipeIn, verticesPipePeau, rayonPipe,
+                                facesInside, facesOnside):
+  """
+  elements débouchants (intersection pipe et peau), indexés selon les edges du fond de fissure (edgesFondIn)
+  """
+  
+  logging.info('start')
+  verticesEdgesFondIn = [] # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn)
+  pipexts = []             # les segments de pipe associés au points de fond de fissure débouchants (même indice)
+  cercles = []             # les cercles de generation des pipes débouchant (même indice)
+  facesFissExt = []        # les faces de la fissure externe associés au points de fond de fissure débouchants (même indice)
+  edgesFissExtPeau = []    # edges des faces de fissure externe sur la peau (même indice)
+  edgesFissExtPipe = []    # edges des faces de fissure externe sur le pipe (même indice)
+
+  #logging.debug("edgesFondIn %s", edgesFondIn)
+  for iedf, edge in enumerate(edgesFondIn):
+    name = "edgeFondIn%d"%iedf
+    geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
+    dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
+    ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
+    [u, PointOnEdge, EdgeInWireIndex]  = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
+    logging.debug("u:%s, EdgeInWireIndex: %s, len(edgesFondFiss): %s", u, EdgeInWireIndex, len(edgesFondFiss))
+    localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
+    centre = PointOnEdge
+    centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
+    geomPublishInFather(initLog.debug, partitionPeauFissFond, centre2, "centre2_%d"%iedf)
+    verticesEdgesFondIn.append(centre)
+    name = "verticeEdgesFondIn%d"%iedf
+    geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, name)
+    norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
+    geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, "norm%d"%iedf)
+    cercle = geompy.MakeCircle(centre, norm, rayonPipe)
+    geomPublishInFather(initLog.debug, partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
+    [vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
+    vec1 = geompy.MakeVector(centre, vertex)
+    vec2 = geompy.MakeVector(centre, ptPeau)
+    angle = geompy.GetAngleRadians(vec1, vec2)
+    # cas général : on reconstitue une portion de pipe, avec l'arête de couture qui coincide
+    #   avec la face de fissure, au niveau du débouché sur la face externe
+    # cas dégénéré : le pipe débouche perpendiculairement Ã  une surface plane Ã  l'origine.
+    #   La partition filling / pipe reconstruit Ã©choue.
+    #   - Si on partitionne le filling avec un simple pipe obtenu par extrusion droite du cercle,
+    #     cela donne un point en trop sur le cercle.
+    #   - Si on prend une vraie surface plane (pas un filling), on peut faire la partition avec 
+    #     les pipes reconstruits              
+    logging.debug("angle=%s", angle)
+    #if abs(angle) > 1.e-7:
+    sommetAxe = geompy.MakeTranslationVector(centre, norm)
+    pm = produitMixte(centre, vertex, ptPeau, sommetAxe)
+    if pm > 0:  # ajout de pi a (-)angle pour Ã©viter des points confondus (partition Ã©choue) dans les cas dégénérés
+      cercle = geompy.MakeRotation(cercle, norm, angle + math.pi)
+    else:
+      cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
+    name = "cercle%d"%iedf
+    geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name)
+    cercles.append(cercle)
+
+    # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
+    if aretesVivesC is None:
+      faceTestPeau = fillingFaceExterne
+    else:
+      faceTestPeau = facesDefaut[ifil]
+    sideCentre = whichSide(faceTestPeau, centre)
+    locPt0 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 0.0)
+    locPt1 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 1.0)
+    sidePt0 = whichSide(faceTestPeau, locPt0)
+    sidePt1 = whichSide(faceTestPeau, locPt1)
+    logging.debug("position centre cercle: %s, extremité edge u0: %s, u1: %s", sideCentre, sidePt0, sidePt1) 
+    normFace = geompy.GetNormal(faceTestPeau, ptPeau)
+    inclPipe = abs(geompy.GetAngleRadians(norm, normFace))
+    lgp = max(rayonPipe/2., abs(3*rayonPipe*math.tan(inclPipe)))
+    logging.debug("angle inclinaison Pipe en sortie: %s degres, lgp: %s", inclPipe*180/math.pi, lgp)
+    
+    # --- position des points extremite du pipe sur l'edge debouchante
+    #     il faut la distance curviligne ofp du point central par rapport Ã  une extrémité de l'edge débouchante
+    locEdgePart = geompy.MakePartition([localEdgeInFondFiss],[centre], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
+    edgesLoc = geompy.ExtractShapes(locEdgePart, geompy.ShapeType["EDGE"], False)
+    edgesLocSorted =[(geompy.MinDistance(edge, locPt0), kk, edge) for kk, edge in enumerate(edgesLoc)]
+    edgesLocSorted.sort()
+    ofp = geompy.BasicProperties(edgesLocSorted[0][2])[0] # distance curviligne centre locPt0
+    logging.debug("distance curviligne centre extremite0: %s", ofp)
+    p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
+    p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
+    geomPublishInFather(initLog.debug, wireFondFiss, p1, "p1_%d"%iedf)
+    geomPublishInFather(initLog.debug, wireFondFiss, p2, "p2_%d"%iedf)
+
+    edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
+    edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
+    for edp in edps:
+      if geompy.MinDistance(centre, edp) < 1.e-3:
+        pipext = geompy.MakePipe(cercle, edp)
+        name = "pipeExt%d"%iedf
+        geomPublishInFather(initLog.debug, partitionPeauFissFond, pipext, name)
+        pipexts.append(pipext)
+
+    for ifa, face in enumerate(facesInside):
+      logging.debug("recherche edges communes entre une face inside et (faces onside, edges pipe et fond débouchante)")
+      edgesPeauFis = []
+      edgesPipeFis = []
+      edgesPipeFnd = []
+      try:
+        edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
+        logging.debug("    faces onside %s",edgesPeauFis)
+        edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
+        logging.debug("    edgesPipeIn %s", edgesPipeFis)
+        edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"])
+        logging.debug("    edgesFondIn %s ", edgesPipeFnd)
+      except:
+        logging.debug("  pb edges communes %s %s %s",edgesPeauFis, edgesPipeFis, edgesPipeFnd)
+        pass
+      if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
+        dist = geompy.MinDistance(geompy.MakeCompound(edgesPeauFis), ptPeau)
+        logging.debug("    test distance extrémité reference %s", dist)
+        if dist < 1.e-3: # c'est la face de fissure externe associée
+          logging.debug("    face %s inside ajoutée", ifa)
+          facesFissExt.append(face)
+          name="faceFissExt%d"%iedf
+          geomPublishInFather(initLog.debug, partitionPeauFissFond, face, name)
+          dist = 1.
+          for ipe, edpe in enumerate(edgesPeauFis):
+            for ipi, edpi in enumerate(edgesPipeFis):
+              dist = geompy.MinDistance(edpe, edpi)
+              if dist < 1.e-3:
+                edgesFissExtPeau.append(edpe)
+                name="edgesFissExtPeau%d"%iedf
+                geomPublishInFather(initLog.debug, partitionPeauFissFond, edpe, name)
+                edgesFissExtPipe.append(edpi)
+                name="edgesFissExtPipe%d"%iedf
+                geomPublishInFather(initLog.debug, partitionPeauFissFond, edpi, name)
+                break
+            if dist < 1.e-3:
+              break
+
+  return (verticesEdgesFondIn, pipexts, cercles, facesFissExt, edgesFissExtPeau, edgesFissExtPipe)
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/identifieElementsFissure.py b/src/Tools/blocFissure/gmu/identifieElementsFissure.py
new file mode 100644 (file)
index 0000000..fcad8c5
--- /dev/null
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+from extractionOrientee import extractionOrientee
+from extractionOrienteeMulti import extractionOrienteeMulti
+def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond,
+                             edgesPipeFiss, edgesFondFiss, aretesVivesC,
+                             fillingFaceExterne, centreFondFiss):
+  """
+  # -----------------------------------------------------------------------
+  # --- identification edges fond de fissure, edges pipe sur la face de fissure,
+  #     edges prolongées
+  #     edges internes communes pipe et fissure, points communs edges fissure peau et edges circulaires
+  """
+
+  logging.info('start')
+
+  edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss))
+  geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
+  edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss))
+  geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesFondC, "edgesFondFiss")
+  
+  if aretesVivesC is None:
+    [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
+    [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
+  else:
+    [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
+    [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
+    
+  edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
+  verticesPipePeau = []
+
+  for i, edge in enumerate(edgesPipeIn):
+    try:
+      vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
+      verticesPipePeau.append(vertices[0])
+      name = "edgePipeIn%d"%i
+      geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
+      name = "verticePipePeau%d"%i
+      geomPublishInFather(initLog.debug, partitionPeauFissFond, vertices[0], name)
+      logging.debug("edgePipeIn%s coupe les faces OnSide", i)
+    except:
+      logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
+
+  edgesFondIn =[]
+  if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau  
+    #tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
+    #edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] 
+    tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
+    edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
+
+  return (edgesPipeIn, verticesPipePeau, edgesFondIn, facesInside, facesOnside) 
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py
new file mode 100644 (file)
index 0000000..c60682c
--- /dev/null
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from identifieElementsFissure import identifieElementsFissure
+from identifieElementsDebouchants import identifieElementsDebouchants
+from trouveEdgesFissPeau import trouveEdgesFissPeau
+from identifieFacesPeau import identifieFacesPeau
+from identifieEdgesPeau import identifieEdgesPeau
+
+def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss,
+                                      edgesFondFiss, wireFondFiss, aretesVivesC,
+                                      facesDefaut, centreFondFiss, rayonPipe,
+                                      aretesVivesCoupees):
+  """
+  """
+  logging.info('start')
+  fillingFaceExterne = facesDefaut[ifil]
+
+  logging.debug("traitement partitionPeauFissFond %s", ifil)
+  
+  # --- identification edges fond de fissure, edges pipe sur la face de fissure, edges prolongées
+  #     edges internes communes pipe et fissure, points communs edges fissure peau et edges circulaires
+  
+  (edgesPipeIn, verticesPipePeau, edgesFondIn, facesInside, facesOnside) = identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond,
+                                                                                                    edgesPipeFiss, edgesFondFiss, aretesVivesC,
+                                                                                                    fillingFaceExterne, centreFondFiss)
+  
+  # --- elements débouchants (intersection pipe et peau), indexés selon les edges du fond de fissure (edgesFondIn)
+  
+  (verticesEdgesFondIn, pipexts, cercles,
+   facesFissExt, edgesFissExtPeau, edgesFissExtPipe) = identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
+                                                                                    edgesFondIn, edgesFondFiss, wireFondFiss,
+                                                                                    aretesVivesC, fillingFaceExterne,
+                                                                                    edgesPipeIn, verticesPipePeau, rayonPipe,
+                                                                                    facesInside, facesOnside)
+
+  # --- pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau
+
+  if len(verticesPipePeau) == 0: # aucune extrémité du pipe sur cette face de peau
+    edgesFissExtPeau = trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau)
+    
+  # --- inventaire des faces de peau : face de peau percée du pipe, extrémités du pipe
+  
+  (facePeau, facesPeauSorted, edgesPeauFondIn) = identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
+                                                                    verticesEdgesFondIn, pipexts, cercles,
+                                                                    fillingFaceExterne, centreFondFiss)
+  
+  # --- identification précise des edges et disques des faces de peau selon index extremité fissure
+  
+  (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
+   edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
+   bordsVifs, edgesFissurePeau, aretesVivesCoupees) = identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted,
+                                                                         edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees)
+  
+  dataPPFF = dict(endsEdgeFond        = endsEdgeFond,        # pour chaque face [points edge fond de fissure aux débouchés du pipe]
+                  facesPipePeau       = facesPipePeau,       # pour chaque face [faces du pipe débouchantes]
+                  edgeRadFacePipePeau = edgeRadFacePipePeau, # pour chaque face [edge radiale des faces du pipe débouchantes ]
+                  facesFissExt        = facesFissExt,        # pour chaque face [faces de fissure externes au pipe]
+                  edgesFissExtPeau    = edgesFissExtPeau,    # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
+                  edgesFissExtPipe    = edgesFissExtPipe,    # pour chaque face [edge commun au pipe des faces de fissure externes]
+                  facePeau            = facePeau,            # pour chaque face : la face de peau finale a mailler (percee des faces débouchantes)
+                  edgesCircPeau       = edgesCircPeau,       # pour chaque face de peau : [groupe subshapes edges circulaires aux débouchés du pipe]
+                  verticesCircPeau    = verticesCircPeau,    # pour chaque face de peau : [groupe subshapes points sur edges circulaires aux débouchés du pipe]
+                  groupEdgesBordPeau  = groupEdgesBordPeau,  # pour chaque face de peau : groupe subshape des edges aux bords liés Ã  la partie saine
+                  bordsVifs           = bordsVifs,           # pour chaque face de peau : groupe subshape des edges aux bords correspondant Ã  des arêtes vives
+                  edgesFissurePeau    = edgesFissurePeau,    # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+                  verticesPipePeau    = verticesPipePeau     # pour chaque face de peau : [point commun edFissPeau edCircPeau]
+                  )  
+
+  return dataPPFF, aretesVivesCoupees
+  
diff --git a/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py
new file mode 100644 (file)
index 0000000..12efab4
--- /dev/null
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss):
+  """
+  identification des faces et edges de fissure externe pour maillage
+  """
+  logging.info('start')
+  facesFissExt = []
+  edgesFissExtPeau = []
+  edgesFissExtPipe = []
+  for ifil in range(len(fsFissuExt)): # TODO: Ã©liminer les doublons (comparer tous les vertices triés, avec mesure de distance ?)
+    facesFissExt += fsFissuExt[ifil]
+    edgesFissExtPeau += edFisExtPe[ifil]
+    edgesFissExtPipe += edFisExtPi[ifil]
+  logging.debug("---------------------------- identification faces de fissure externes au pipe :%s ", len(facesFissExt))
+  # regroupement des faces de fissure externes au pipe.
+  
+  if len(facesFissExt) > 1:
+    faceFissureExterne = geompy.MakePartition(facesFissExt, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+    edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss))    # edgesFissExtPipe peut ne pas couvrir toute la longueur
+    # edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau))
+    # il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau
+    (isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne)
+    edgesBordFFE = []
+    for bound in closedFreeBoundaries:
+      edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False)
+    edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE]
+    logging.debug("edgesBordFFEid %s", edgesBordFFEid)
+    edgesPPE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)
+    edgesPPEid = [ geompy.GetSubShapeID(faceFissureExterne, ed) for ed in edgesPPE]
+    logging.debug("edgesPPEid %s", edgesPPEid)
+    edgesPFE = [ edid[0] for edid in edgesBordFFEid if edid[1] not in edgesPPEid] # on garde toutes les edges de bord non en contact avec le pipe
+    logging.debug("edgesPFE %s", edgesPFE)
+    edgesPeauFissureExterneC = geompy.MakeCompound(edgesPFE)
+  else:
+    faceFissureExterne = facesFissExt[0]
+    edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
+    edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
+  wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
+  geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
+  geomPublishInFather(initLog.debug, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
+  geomPublishInFather(initLog.debug, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
+  
+  return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC)
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/identifieFacesPeau.py b/src/Tools/blocFissure/gmu/identifieFacesPeau.py
new file mode 100644 (file)
index 0000000..a8917ad
--- /dev/null
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+from sortFaces import sortFaces
+from extractionOrientee import extractionOrientee
+
+def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
+                       verticesEdgesFondIn, pipexts, cercles,
+                       fillingFaceExterne, centreFondFiss):
+  """
+  inventaire des faces de peau : face de peau percée du pipe, extrémités du pipe
+  La partition avec le pipe peut créer un vertex (et un edge) de trop sur le cercle projeté,
+  quand le cercle est très proche de la face.
+  dans ce cas, la projection du cercle sur la face suivie d'une partition permet
+  d'éviter le point en trop
+  """
+  logging.info('start')
+   
+  facesAndFond = facesOnside
+  facesAndFond.append(wireFondFiss)
+  try:
+    partitionPeauByPipe = geompy.MakePartition(facesAndFond, pipexts, [], [], geompy.ShapeType["FACE"], 0, [], 1)
+  except:
+    logging.debug("probleme partition face pipe, contournement avec MakeSection")
+    sections = []
+    for pipext in pipexts:
+      sections.append(geompy.MakeSection(facesOnside[0], pipext))
+    partitionPeauByPipe = geompy.MakePartition(facesAndFond, sections, [], [], geompy.ShapeType["FACE"], 0, [], 1)
+    
+  # contrôle edge en trop sur edges circulaires
+  if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+    edgeEnTrop = []
+    outilPart = pipexts
+    facesPeau = geompy.ExtractShapes(partitionPeauByPipe, geompy.ShapeType["FACE"], False)
+    facesPeauSorted, minsur, maxsurf = sortFaces(facesPeau)
+    for i, face in enumerate(facesPeauSorted[:-1]): # on ne teste que la ou les petites faces "circulaires"
+      nbv = geompy.NumberOfEdges(face)
+      logging.debug("nombre d'edges sur face circulaire: %s", nbv)
+      if nbv > 3:
+        edgeEnTrop.append(True) # TODO : distinguer les cas avec deux faces circulaires dont l'une est correcte
+      else:
+        edgeEnTrop.append(False)
+    refaire = sum(edgeEnTrop)
+    if refaire > 0:
+      dc = [(geompy.MinDistance(verticesEdgesFondIn[0], fac), i)  for i, fac in enumerate(facesPeauSorted[:-1])]
+      dc.sort()
+      logging.debug("dc sorted: %s", dc)
+      i0 = dc[0][1] # indice de facesPeauSorted qui correspond Ã  verticesEdgesFondIn[0], donc 0 pour cercles
+      direct = (i0 == 0)
+      for i, bad in enumerate(edgeEnTrop):
+        if direct:
+          j = i
+        else:
+          j = 1-i
+        if bad:
+          outilPart[j] = geompy.MakeProjection(cercles[j],facesOnside[0])
+        pass
+      partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, [], [], geompy.ShapeType["FACE"], 0, [], 1)
+      pass
+      
+  name="partitionPeauByPipe%d"%ifil
+  geomPublish(initLog.debug, partitionPeauByPipe, name)
+  [edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
+  [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
+    
+  if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+    facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFondOn)
+    facePeau = facesPeauSorted[-1] # la plus grande face
+  else:
+    facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
+    facesPeauSorted = [facePeau]
+  name="facePeau%d"%ifil
+  geomPublish(initLog.debug, facePeau, name)
+
+  return (facePeau, facesPeauSorted, edgesPeauFondIn)
\ No newline at end of file
index 63908c1d054101ea46bfdeabaa85bd7563c570a2..07c0c36407f3795db00c629f84e3c08ddba33d23 100644 (file)
@@ -2,25 +2,51 @@
 
 import logging
 
+debug = 10
+info = 20
+warning = 30
+error = 40
+critical = 50
+
+loglevel = warning
+
 def setDebug():
+  global loglevel
   logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
                       level=logging.DEBUG)
-  logging.info('start Debug')
+  loglevel = debug
+  logging.info('start Debug %s', loglevel)
 
 def setVerbose():
+  global loglevel
   logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
                       level=logging.INFO)
-  logging.info('start Verbose')
+  loglevel = info
+  logging.info('start Verbose %s', loglevel)
 
 def setRelease():
+  global loglevel
   logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
                       level=logging.WARNING)
-  logging.warning('start Release')
+  loglevel = warning
+  logging.warning('start Release %s', loglevel)
   
 def setUnitTests():
+  global loglevel
   logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
                       level=logging.CRITICAL)
-  logging.critical('start UnitTests')
+  loglevel = critical
+  logging.critical('start UnitTests %s', loglevel)
+  
+def setPerfTests():
+  global loglevel
+  logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
+                      level=logging.CRITICAL)
+  loglevel = critical
+  logging.info('start PerfTests %s', loglevel)
+  
+def getLogLevel():
+  return loglevel
   
   #logging.basicConfig(filename='myapp.log',
   #                    format='%(asctime)s %(message)s',
index 95d4a627970fafb40b8b822eca918318aff58900..ede20b48ce9cdd38718171318f13b96121e7752d 100644 (file)
@@ -3,6 +3,9 @@
 import logging
 import salome
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 from geomsmesh import smesh
 import SMESH
 import math
@@ -98,12 +101,12 @@ def insereFissureElliptique(geometriesSaines, maillagesSains,
   #plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
   #ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
 
-  #geompy.addToStudy( pipe0, 'pipe0' )
-  #geompy.addToStudy( gener1, 'gener1' )
-  #geompy.addToStudy( pipe1, 'pipe1' )
-  #geompy.addToStudy( facefis1, 'facefis1' )
-  #geompy.addToStudy( plane1, 'plane1' )
-  #geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
+  #geomPublish(initLog.debug,  pipe0, 'pipe0' )
+  #geomPublish(initLog.debug,  gener1, 'gener1' )
+  #geomPublish(initLog.debug,  pipe1, 'pipe1' )
+  #geomPublish(initLog.debug,  facefis1, 'facefis1' )
+  #geomPublish(initLog.debug,  plane1, 'plane1' )
+  #geomPublish(initLog.debug,  ellipsoide1, 'ellipsoide1' )
 
   # --- partition du bloc défaut par génératrice, tore et plan fissure
   if step == 7:
index 3204084a5c458e8726b26b10beaa21ba0db95f4c..96c733e1e31ede69f22a307072f1c3b9e4b8bc64 100644 (file)
@@ -3,6 +3,9 @@
 import logging
 import salome
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 import GEOM
 from geomsmesh import smesh
 from salome.smesh import smeshBuilder
@@ -82,12 +85,13 @@ def insereFissureGenerale(maillagesSains,
   #fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
   fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med'
 
-  facesDefaut              = elementsDefaut[0] # fillings des faces en peau 
+  # fillings des faces en peau
+  facesDefaut = elementsDefaut[0]
   #centresDefaut            = elementsDefaut[1]
   #normalsDefaut            = elementsDefaut[2]
   #extrusionsDefaut         = elementsDefaut[3]
   dmoyen                   = elementsDefaut[4]
-  bordsPartages            = elementsDefaut[5]
+  bordsPartages = elementsDefaut[5]
   fillconts                = elementsDefaut[6]
   idFilToCont              = elementsDefaut[7]
   maillageSain             = elementsDefaut[8]
@@ -104,7 +108,7 @@ def insereFissureGenerale(maillagesSains,
   #     partition face fissure Ã©tendue par fillings, on garde la plus grande face
 
   partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
-  geompy.addToStudy(partShapeDefaut, 'partShapeDefaut')
+  geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
   facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
   if isPointInterne:
     distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
@@ -114,9 +118,9 @@ def insereFissureGenerale(maillagesSains,
   else:
     facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit Ãªtre la plus grande
     logging.debug("surfaces faces fissure Ã©tendue, min %s, max %s", minSurf, maxSurf)
-    facesPortFissure = facesPartShapeDefautSorted[-1]
+    facesPortFissure = facesPartShapeDefautSorted[-1] #= global
   
-  geompy.addToStudy(facesPortFissure, "facesPortFissure")
+  geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
 
   O, OX, OY, OZ = triedreBase()
   
@@ -126,44 +130,44 @@ def insereFissureGenerale(maillagesSains,
   
   if geompy.NumberOfFaces(shapeDefaut) == 1:
     plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
-    shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-    fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss)
-    geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe')
-    geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
+    shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #= local
+    #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
+    geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
+    #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
   
   extrem, norms = findWireEndVertices(fondFiss, True)
   logging.debug("extrem: %s, norm: %s",extrem, norms)
   cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
   cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # Ã©viter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
-  geompy.addToStudy(cercle, 'cercle')
+  geomPublish(initLog.debug, cercle, 'cercle')
   fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
   pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
-  geompy.addToStudy(pipeFiss, 'pipeFiss')
+  geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
   partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
-  geompy.addToStudy(partFissPipe, 'partFissPipe')
-  fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
-  geompy.addToStudy(fissPipe, 'fissPipe')
-  partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
-  geompy.addToStudy(partPipe, 'partPipe')
+  geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
+  fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) #= global
+  geomPublish(initLog.debug, fissPipe, 'fissPipe')
+  partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) #= local
+  geomPublish(initLog.debug, partPipe, 'partPipe')
   
-  edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
+  edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) #= global
   for i, edge in enumerate(edgesPipeFiss):
     name = "edgePipe%d"%i
-    geompy.addToStudyInFather(fissPipe, edge, name)
+    geomPublishInFather(initLog.debug,fissPipe, edge, name)
   try:
-    wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
+    wirePipeFiss = geompy.MakeWire(edgesPipeFiss) #= global
   except:
     wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
     logging.debug("wirePipeFiss construit sous forme de compound")
-  geompy.addToStudy(wirePipeFiss, "wirePipeFiss")
+  geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
   
   wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
   edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
   for i, edge in enumerate(edgesFondFiss):
     name = "edgeFondFiss%d"%i
-    geompy.addToStudyInFather(fissPipe, edge, name)
-  wireFondFiss = geompy.MakeWire(edgesFondFiss)
-  geompy.addToStudy(wireFondFiss,"wireFondFiss")  
+    geomPublishInFather(initLog.debug,fissPipe, edge, name)
+  wireFondFiss = geompy.MakeWire(edgesFondFiss) #= global
+  geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")  
 
   # -----------------------------------------------------------------------------
   # --- peau et face de fissure
@@ -172,8 +176,8 @@ def insereFissureGenerale(maillagesSains,
   #     il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure
   #     liste de faces externes : facesDefaut
   #     liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
-  
-  partitionsPeauFissFond = []
+
+  partitionsPeauFissFond = [] #= global
   ipart = 0
   for filling in facesDefaut: 
     part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
@@ -186,23 +190,32 @@ def insereFissureGenerale(maillagesSains,
         fissPipePart = fissPipe
       part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
       partitionsPeauFissFond.append(part)
-      geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart )
+      geomPublish(initLog.debug,  part, 'partitionPeauFissFond%d'%ipart )
     else:
       partitionsPeauFissFond.append(None)
     ipart = ipart +1
+  
+  # --- arêtes vives détectées (dans quadranglesToShapeNoCorner
+  #                             et quadranglesToShapeWithCorner)
   
-  # --- arêtes vives détectées (dans quadranglesToShape)
-   
   aretesVives = []
-  aretesVivesCoupees = []
+  aretesVivesCoupees = []  #= global
   ia = 0
   for a in bordsPartages:
-    if a[0] is not None:
-      aretesVives.append(a[0])
-      name = "areteVive%d"%ia
-      geompy.addToStudy(a[0], name)
-      ia += 1
-  aretesVivesC = None
+    if not isinstance(a, list):
+        aretesVives.append(a)
+        name = "areteVive%d"%ia
+        geomPublish(initLog.debug, a, name)
+        ia += 1
+    else:
+        if a[0] is not None:
+            aretesVives.append(a[0])
+            name = "areteVive%d"%ia
+            geomPublish(initLog.debug, a[0], name)
+            ia += 1
+
+  aretesVivesC = None #= global
   if len(aretesVives) > 0:
     aretesVivesC =geompy.MakeCompound(aretesVives)
     
@@ -227,47 +240,48 @@ def insereFissureGenerale(maillagesSains,
   ptFisExtPi = [ []  for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
   
   for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
-    fillingFaceExterne = facesDefaut[ifil]
-    fillingSansDecoupe = fillconts[idFilToCont[ifil]]
     if partitionPeauFissFond is not None:
+      fillingFaceExterne = facesDefaut[ifil]
+      #fillingSansDecoupe = fillconts[idFilToCont[ifil]]
       logging.debug("traitement partitionPeauFissFond %s", ifil)
       # -----------------------------------------------------------------------
       # --- identification edges fond de fissure, edges pipe sur la face de fissure,
       #     edges prolongées
       
-      edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss))
-      geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
-      edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss))
-      geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss")
+      edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) #= local
+      geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
+      edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) #= local
+      geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesFondC, "edgesFondFiss")
       
-      if aretesVivesC is None:
+      if aretesVivesC is None: #= global facesInside facesOnside
         [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
         [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
       else:
         [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
         [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
         
-      edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
-      verticesPipePeau = []
+      edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) #= global
+      verticesPipePeau = [] #= global
 
       for i, edge in enumerate(edgesPipeIn):
         try:
           vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
           verticesPipePeau.append(vertices[0])
           name = "edgePipeIn%d"%i
-          geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+          geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name)
           name = "verticePipePeau%d"%i
-          geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name)
+          geomPublishInFather(initLog.debug,partitionPeauFissFond, vertices[0], name)
           logging.debug("edgePipeIn%s coupe les faces OnSide", i)
         except:
           logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
-      edgesFondOut = []
-      edgesFondIn =[]
+      #edgesFondOut = []     #= inutile
+      edgesFondIn =[] #= global
       if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau  
-        tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
-        edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
+        #tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
+        #edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] 
         tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
         edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
+
       verticesEdgesFondIn = [] # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn)
       pipexts = []             # les segments de pipe associés au points de fond de fissure débouchants (même indice)
       cercles = []             # les cercles de generation des pipes débouchant (même indice)
@@ -278,11 +292,11 @@ def insereFissureGenerale(maillagesSains,
 
       edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
       for i,edge in enumerate(edgesFondFiss):
-        geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i)
+        geomPublishInFather(initLog.debug,wireFondFiss, edge, "edgeFondFiss%d"%i)
 
       for iedf, edge in enumerate(edgesFondIn):
         name = "edgeFondIn%d"%iedf
-        geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+        geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name)
         dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
         ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
         [u, PointOnEdge, EdgeInWireIndex]  = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
@@ -290,14 +304,14 @@ def insereFissureGenerale(maillagesSains,
         localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
         centre = PointOnEdge
         centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
-        geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf)
+        geomPublishInFather(initLog.debug,partitionPeauFissFond, centre2, "centre2_%d"%iedf)
         verticesEdgesFondIn.append(centre)
         name = "verticeEdgesFondIn%d"%iedf
-        geompy.addToStudyInFather(partitionPeauFissFond, centre, name)
+        geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, name)
         norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
-        geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf)
+        geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, "norm%d"%iedf)
         cercle = geompy.MakeCircle(centre, norm, rayonPipe)
-        geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
+        geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
         [vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
         vec1 = geompy.MakeVector(centre, vertex)
         vec2 = geompy.MakeVector(centre, ptPeau)
@@ -319,7 +333,7 @@ def insereFissureGenerale(maillagesSains,
         else:
           cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
         name = "cercle%d"%iedf
-        geompy.addToStudyInFather(partitionPeauFissFond, cercle, name)
+        geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name)
         cercles.append(cercle)
 
         # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
@@ -348,8 +362,8 @@ def insereFissureGenerale(maillagesSains,
         logging.debug("distance curviligne centre extremite0: %s", ofp)
         p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
         p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
-        geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf)
-        geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf)
+        geomPublishInFather(initLog.debug,wireFondFiss, p1, "p1_%d"%iedf)
+        geomPublishInFather(initLog.debug,wireFondFiss, p2, "p2_%d"%iedf)
 
         edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
         edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
@@ -357,7 +371,7 @@ def insereFissureGenerale(maillagesSains,
           if geompy.MinDistance(centre, edp) < 1.e-3:
             pipext = geompy.MakePipe(cercle, edp)
             name = "pipeExt%d"%iedf
-            geompy.addToStudyInFather(partitionPeauFissFond, pipext, name)
+            geomPublishInFather(initLog.debug,partitionPeauFissFond, pipext, name)
             pipexts.append(pipext)
 
         for face in facesInside:
@@ -382,7 +396,7 @@ def insereFissureGenerale(maillagesSains,
               logging.debug("    face %s inside ajoutée", i)
               facesFissExt.append(face)
               name="faceFissExt%d"%iedf
-              geompy.addToStudyInFather(partitionPeauFissFond, face, name)
+              geomPublishInFather(initLog.debug,partitionPeauFissFond, face, name)
               dist = 1.
               for ipe, edpe in enumerate(edgesPeauFis):
                 for ipi, edpi in enumerate(edgesPipeFis):
@@ -390,10 +404,10 @@ def insereFissureGenerale(maillagesSains,
                   if dist < 1.e-3:
                     edgesFissExtPeau.append(edpe)
                     name="edgesFissExtPeau%d"%iedf
-                    geompy.addToStudyInFather(partitionPeauFissFond, edpe, name)
+                    geomPublishInFather(initLog.debug,partitionPeauFissFond, edpe, name)
                     edgesFissExtPipe.append(edpi)
                     name="edgesFissExtPipe%d"%iedf
-                    geompy.addToStudyInFather(partitionPeauFissFond, edpi, name)
+                    geomPublishInFather(initLog.debug,partitionPeauFissFond, edpi, name)
                     break
                 if dist < 1.e-3:
                   break
@@ -414,7 +428,7 @@ def insereFissureGenerale(maillagesSains,
           if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
             edgesFissExtPeau.append(edgesPeauFis[0])
             name="edgesFissExtPeau%d"%j
-            geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
+            geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
             j += 1
      
       # -----------------------------------------------------------------------
@@ -467,7 +481,7 @@ def insereFissureGenerale(maillagesSains,
           pass
           
       name="partitionPeauByPipe%d"%ifil
-      geompy.addToStudy(partitionPeauByPipe, name)
+      geomPublish(initLog.debug, partitionPeauByPipe, name)
       [edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
       [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
         
@@ -477,7 +491,7 @@ def insereFissureGenerale(maillagesSains,
       else:
         facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
       name="facePeau%d"%ifil
-      geompy.addToStudy(facePeau, name)
+      geomPublish(initLog.debug, facePeau, name)
       
       facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
       endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
@@ -503,13 +517,13 @@ def insereFissureGenerale(maillagesSains,
               nameEdge = "edgeRadFacePipePeau%d"%i
               facesPipePeau[i] = face
               endsEdgeFond[i] = sharedVertices[0]
-              geompy.addToStudy(face, nameFace)
-              geompy.addToStudy(sharedVertices[0], nameVert)
+              geomPublish(initLog.debug, face, nameFace)
+              geomPublish(initLog.debug, sharedVertices[0], nameVert)
               edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
               for edge in edgesFace:
                 if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
                   edgeRadFacePipePeau[i] = edge
-                  geompy.addToStudy(edge, nameEdge)
+                  geomPublish(initLog.debug, edge, nameEdge)
                   break
                 pass
               pass
@@ -526,14 +540,14 @@ def insereFissureGenerale(maillagesSains,
           geompy.UnionList(grpEdgesCirc, edges)
           edgesCircPeau[i] = grpEdgesCirc
           name = "edgeCirc%d"%i
-          geompy.addToStudyInFather(facePeau, grpEdgesCirc, name)
+          geomPublishInFather(initLog.debug,facePeau, grpEdgesCirc, name)
           edgesListees = edgesListees + edges
           vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
           grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
           geompy.UnionList(grpVertCircPeau, vertices)
           verticesCircPeau[i] = grpVertCircPeau
           name = "pointEdgeCirc%d"%i
-          geompy.addToStudyInFather(facePeau, grpVertCircPeau, name)
+          geomPublishInFather(initLog.debug,facePeau, grpVertCircPeau, name)
           pass
         pass # --- au moins une extrémité du pipe sur cette face de peau
 
@@ -544,7 +558,7 @@ def insereFissureGenerale(maillagesSains,
       for i, edge in enumerate(edgesFilling):
         edgepeau = geompy.GetInPlace(facePeau, edge)
         name = "edgepeau%d"%i
-        geompy.addToStudyInFather(facePeau,edgepeau, name)
+        geomPublishInFather(initLog.debug,facePeau,edgepeau, name)
         logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
         if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
           logging.debug("  EDGES multiples")
@@ -561,7 +575,7 @@ def insereFissureGenerale(maillagesSains,
       if aretesVivesC is not None:
         bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
       if bordsVifs is not None:
-        geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs")
+        geomPublishInFather(initLog.debug,facePeau, bordsVifs, "bordsVifs")
         groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
         grptmp = None
         if len(aretesVivesCoupees) > 0:
@@ -575,7 +589,7 @@ def insereFissureGenerale(maillagesSains,
           edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
           aretesVivesCoupees += edv
       logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
-      geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
+      geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords")
         
       # ---  edges de la face de peau partagées avec la face de fissure
       
@@ -589,7 +603,7 @@ def insereFissureGenerale(maillagesSains,
             if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
               edgesFissurePeau[i] = edge
               name = "edgeFissurePeau%d"%i
-              geompy.addToStudyInFather(facePeau,  edge, name)
+              geomPublishInFather(initLog.debug,facePeau,  edge, name)
         for edge in edges: # on ajoute après les edges manquantes
           if edge not in edgesFissurePeau:
             edgesFissurePeau.append(edge)
@@ -597,7 +611,7 @@ def insereFissureGenerale(maillagesSains,
         for i, edge in enumerate(edges):
           edgesFissurePeau.append(edge)
           name = "edgeFissurePeau%d"%i
-          geompy.addToStudyInFather(facePeau,  edge, name)
+          geomPublishInFather(initLog.debug,facePeau,  edge, name)
         
 
       ptEdgeFond[ifil] = endsEdgeFond        # pour chaque face [points edge fond de fissure aux débouchés du pipe]
@@ -620,7 +634,7 @@ def insereFissureGenerale(maillagesSains,
   
   for i, avc in enumerate(aretesVivesCoupees):
     name = "areteViveCoupee%d"%i
-    geompy.addToStudy(avc, name)
+    geomPublish(initLog.debug, avc, name)
   
   # --- identification des faces et edges de fissure externe pour maillage
   
@@ -656,9 +670,9 @@ def insereFissureGenerale(maillagesSains,
     edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
     edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
   wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
-  geompy.addToStudy(faceFissureExterne, "faceFissureExterne")
-  geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
-  geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
+  geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
+  geomPublishInFather(initLog.debug,faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
+  geomPublishInFather(initLog.debug,faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
   
   logging.debug("---------------------------- Preparation Maillage du Pipe --------------")
   # -----------------------------------------------------------------------
@@ -723,11 +737,11 @@ def insereFissureGenerale(maillagesSains,
       origins.append(vertpx)
       normals.append(norm)
 #      name = "vertcx%d"%i
-#      geompy.addToStudyInFather(wireFondFiss, vertcx, name)
+#      geomPublishInFather(initLog.debug,wireFondFiss, vertcx, name)
 #      name = "vertpx%d"%i
-#      geompy.addToStudyInFather(wireFondFiss, vertpx, name)
+#      geomPublishInFather(initLog.debug,wireFondFiss, vertpx, name)
 #      name = "plan%d"%i
-#      geompy.addToStudyInFather(wireFondFiss, plan, name)
+#      geomPublishInFather(initLog.debug,wireFondFiss, plan, name)
 
   # --- maillage du pipe Ã©tendu, sans tenir compte de l'intersection avec la face de peau
       
@@ -843,18 +857,18 @@ def insereFissureGenerale(maillagesSains,
           #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
           comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
           name='compoundRay%d'%k
-          geompy.addToStudy(comp, name)
+          geomPublish(initLog.debug, comp, name)
         else:
           idfin = min(len(gptsdisks), numout+1)
           iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
           #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
           comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
           name='compoundRay%d'%k
-          geompy.addToStudy(comp, name)
+          geomPublish(initLog.debug, comp, name)
         nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
         nappes.append(nappe)
         name='nappe%d'%k
-        geompy.addToStudy(nappe, name)
+        geomPublish(initLog.debug, nappe, name)
         facesDebouchantes[i] = True
     listNappes.append(nappes)
       
@@ -903,13 +917,13 @@ def insereFissureGenerale(maillagesSains,
                 ednouv.append(ed)
             logging.debug("  edges issues de la partition: %s", ednouv)
             for ii, ed in enumerate(ednouv):
-              geompy.addToStudy(ed, "ednouv%d"%ii)
+              geomPublish(initLog.debug, ed, "ednouv%d"%ii)
             [edsorted, minl,maxl] = sortEdges(ednouv)
             logging.debug("  longueur edge trouvée: %s", maxl) 
             edge = edsorted[-1]
           edges.append(edge)
           name = 'edgeEndPipe%d'%k
-          geompy.addToStudy(edge, name)
+          geomPublish(initLog.debug, edge, name)
       listEdges.append(edges)
 
   # --- création des points du maillage du pipe sur la face de peau
@@ -921,9 +935,9 @@ def insereFissureGenerale(maillagesSains,
         id = -1  # si id vaut 1, on prend le dernier Ã©lément de la liste (1 ou 2 extrémités débouchent sur la face)
       centre = ptEdgeFond[idFillingFromBout[i]][id]
       name = "centre%d"%id
-      geompy.addToStudy(centre, name)
+      geomPublish(initLog.debug, centre, name)
       vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
-      geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau")
+      geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau")
       grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
       edgesCirc = []
       for grpEdgesCirc in grpsEdgesCirc:
@@ -950,7 +964,7 @@ def insereFissureGenerale(maillagesSains,
         else:
           bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
         name ="bout%d"%k
-        geompy.addToStudyInFather(centre, bout, name)
+        geomPublishInFather(initLog.debug,centre, bout, name)
         # enregistrement des points dans la structure
         points = []
         for j in range(nbsegRad +1):
@@ -1169,7 +1183,7 @@ def insereFissureGenerale(maillagesSains,
     aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
     meshAretesVives = smesh.Mesh(aretesVivesC)
     algo1d = meshAretesVives.Segment()
-    hypo1d = algo1d.LocalLength(dmoyen/3.0,[],1e-07)
+    hypo1d = algo1d.LocalLength(dmoyen,[],1e-07)
     putName(algo1d.GetSubMesh(), "aretesVives")
     putName(algo1d, "algo1d_aretesVives")
     putName(hypo1d, "hypo1d_aretesVives")
@@ -1210,7 +1224,7 @@ def insereFissureGenerale(maillagesSains,
   grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
 
   # --- maillage faces de peau
-  
+    
   boutFromIfil = [None for i in range(nbFacesFilling)]
   if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes
     boutFromIfil[idFillingFromBout[0]] = 0
@@ -1227,7 +1241,7 @@ def insereFissureGenerale(maillagesSains,
       edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
       groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
       geompy.UnionList(groupEdgesBordPeau, edgesFilling)
-      geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords")
+      geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
       
       meshFacePeau = smesh.Mesh(facesDefaut[ifil])
       
index ec8307c9dda4602639e167aa31091eef9c26eeb0..bc33172eee45333c7dcdaac481d61d4844fa33b3 100644 (file)
@@ -3,6 +3,9 @@
 import logging
 import salome
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 from geomsmesh import smesh
 from salome.smesh import smeshBuilder
 import SMESH
@@ -79,8 +82,8 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
   facePorteFissure =  shapeDefaut
   WirePorteFondFissure = wiretube
   fillingFaceExterne = facesDefaut[0]
-  print fillingFaceExterne
-  geompy.addToStudy(fillingFaceExterne, "fillingFaceExterne")
+  logging.debug("fillingFaceExterne %s", fillingFaceExterne)
+  geomPublish(initLog.debug, fillingFaceExterne, "fillingFaceExterne")
   edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
 
   O, OX, OY, OZ = triedreBase()
@@ -90,7 +93,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
 
   # --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée
   partitionPeauFissFond = geompy.MakePartition([facePorteFissure, WirePorteFondFissure, fillingFaceExterne], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-  geompy.addToStudy( partitionPeauFissFond, 'partitionPeauFissFond' )
+  geomPublish(initLog.debug,  partitionPeauFissFond, 'partitionPeauFissFond' )
 
   edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False)
 
@@ -103,39 +106,39 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
       lgmax = lg
       imax = i
   edgemax = edges[imax]
-  geompy.addToStudy(edgemax, 'edgemax')
+  geomPublish(initLog.debug, edgemax, 'edgemax')
   centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
-  geompy.addToStudy(centreFondFiss, 'centreFondFiss')
+  geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss')
   tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
-  geompy.addToStudy(tangentFondFiss, 'tangentFondFiss')
+  geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss')
 
   bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
-  geompy.addToStudy(bord1FondFiss, 'bord1FondFiss')
+  geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss')
   tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
-  geompy.addToStudy(tangentBord1FondFiss, 'tangentBord1FondFiss')
+  geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss')
 
   bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
-  geompy.addToStudy(bord2FondFiss, 'bord2FondFiss')
+  geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss')
   tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
-  geompy.addToStudy(tangentBord2FondFiss, 'tangentBord2FondFiss')
+  geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss')
 
   planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
   planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
-  geompy.addToStudy(planBord1, 'planBord1')
-  geompy.addToStudy(planBord2, 'planBord2')
+  geomPublish(initLog.debug, planBord1, 'planBord1')
+  geomPublish(initLog.debug, planBord2, 'planBord2')
 
   [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
   [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
 
   # --- partition peau -face fissure - pipe fond de fissure prolongé
   partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-  geompy.addToStudy( partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
+  geomPublish(initLog.debug,  partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
 
   # --- identification face de peau
   [facesPeauFissInside, facesPeauFissOutside, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
   facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
   facePeau = facesPeauSorted[-1] # la plus grande face
-  geompy.addToStudyInFather(partitionPeauFissByPipe, facePeau, "facePeau")
+  geomPublishInFather(initLog.debug,partitionPeauFissByPipe, facePeau, "facePeau")
 
   # --- identification edges de bord face peau
   edgesBords = []
@@ -144,7 +147,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
     edgesBords.append(edgepeau)
   groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
   geompy.UnionList(groupEdgesBordPeau, edgesBords)
-  geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
+  geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords")
 
   # --- identification face fissure externe au pipe et edge commune peau fissure
   for face in facesPeauFissInside:
@@ -153,9 +156,9 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
       if sharedEdges is not None:
         faceFiss = face
         edgePeauFiss = sharedEdges[0]
-        geompy.addToStudyInFather(partitionPeauFissByPipe, faceFiss, "faceFiss")
-        geompy.addToStudyInFather(faceFiss, edgePeauFiss, "edgePeauFiss")
-        geompy.addToStudyInFather(facePeau, edgePeauFiss, "edgePeauFiss")
+        geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss")
+        geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss")
+        geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss")
         break
     except:
       pass
@@ -168,16 +171,16 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
   verticesDemiCerclesPeau = []
   for i, edge in enumerate(demiCerclesPeau):
     name = "demiCerclePeau_%d"%i
-    geompy.addToStudyInFather(facePeau, edge, name)
+    geomPublishInFather(initLog.debug,facePeau, edge, name)
     verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
   verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
   for i, vertex in enumerate(verticesDemiCerclesPeau):
     name = "verticesDemiCerclesPeau_%d"%i
-    geompy.addToStudyInFather(facePeau, vertex, name)
+    geomPublishInFather(initLog.debug,facePeau, vertex, name)
   verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
   for i, vertex in enumerate(verticesOutCercles):
     name = "verticesOutCercles_%d"%i
-    geompy.addToStudyInFather(facePeau, vertex, name)
+    geomPublishInFather(initLog.debug,facePeau, vertex, name)
 
   # --- demi cercles  regroupés
   groupsDemiCerclesPeau = []
@@ -189,7 +192,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
     group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
     geompy.UnionList(group, demis)
     name = "Cercle%d"%i
-    geompy.addToStudyInFather(facePeau, group , name)
+    geomPublishInFather(initLog.debug,facePeau, group , name)
     groupsDemiCerclesPeau.append(group)
 
   # --- identification edges commune pipe face fissure externe au pipe
@@ -200,10 +203,10 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
     if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
       edgesFaceFissPipe.append(edge)
       name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
-      geompy.addToStudyInFather(faceFiss, edge, name)
+      geomPublishInFather(initLog.debug,faceFiss, edge, name)
   groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
   geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
-  geompy.addToStudyInFather(faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
+  geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
 
   # -----------------------------------------------------------------------------
   # --- pipe de fond de fissure
@@ -240,29 +243,29 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
   #pipeFondFiss = pipesSorted[-1]
   #pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
 
-  geompy.addToStudy( disque, 'disque')
-  geompy.addToStudy( wireFondFiss, 'wireFondFiss')
-  geompy.addToStudy( pipeFondFiss, 'pipeFondFiss')
+  geomPublish(initLog.debug,  disque, 'disque')
+  geomPublish(initLog.debug,  wireFondFiss, 'wireFondFiss')
+  geomPublish(initLog.debug,  pipeFondFiss, 'pipeFondFiss')
 
   VerticesEndFondFiss = findWireEndVertices(wireFondFiss)
   for i, v in enumerate(VerticesEndFondFiss):
     name = "vertexEndFondFiss_%d"%i
-    geompy.addToStudyInFather(wireFondFiss, v, name)
+    geomPublishInFather(initLog.debug,wireFondFiss, v, name)
   VerticesEndPipeFiss = []
   for v in VerticesEndFondFiss:
     VerticesEndPipeFiss.append(geompy.GetInPlace(pipeFondFiss, v))
   for i, v in enumerate(VerticesEndPipeFiss):
     name = "vertexEndPipeFiss_%d"%i
-    geompy.addToStudyInFather(pipeFondFiss, v, name)
+    geomPublishInFather(initLog.debug,pipeFondFiss, v, name)
 
-  geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
-  geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
+  geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
+  geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
   if geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[0]) > geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[1]):
     a = verticesOutCercles[0]
     verticesOutCercles[0] = verticesOutCercles[1]
     verticesOutCercles[1] = a
-  geompy.addToStudyInFather(facePeau, verticesOutCercles[0], "THOR")
-  geompy.addToStudyInFather(facePeau, verticesOutCercles[1], "THEX")
+  geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[0], "THOR")
+  geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[1], "THEX")
 
   [facesPipeInside, facesPipeOutside, facesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "FACE", 0.1, "pipe_bord_")
   [edgesPipeInside, edgesPipeOutside, edgesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "EDGE", 0.1, "pipe_bord_")
@@ -275,7 +278,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
 
   centre = geompy.MakeVertexOnSurface(planfiss, 0.5, 0.5)
   refpoint = geompy.MakeTranslationVector(centre, geompy.GetNormal(planfiss,centre))
-  geompy.addToStudy(refpoint, 'refpoint')
+  geomPublish(initLog.debug, refpoint, 'refpoint')
   [facesPipeInplan, facesPipeOutplan, facesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "FACE", 0.1, "pipe_plan_")
   [edgesPipeInplan, edgesPipeOutplan, edgesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "EDGE", 0.1, "pipe_plan_")
 
@@ -315,7 +318,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
       generFiss.append(edge)
   groupGenerFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
   geompy.UnionList(groupGenerFiss, generFiss)
-  geompy.addToStudyInFather(pipeFondFiss, groupGenerFiss, "GenFiss")
+  geomPublishInFather(initLog.debug,pipeFondFiss, groupGenerFiss, "GenFiss")
 
   # --- demi cercles externes regroupés
   groupsDemiCerclesPipe = []
@@ -327,7 +330,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
     group = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
     geompy.UnionList(group, demis)
     name = "Cercle%d"%i
-    geompy.addToStudyInFather(pipeFondFiss, group , name)
+    geomPublishInFather(initLog.debug,pipeFondFiss, group , name)
     groupsDemiCerclesPipe.append(group)
 
   # --- faces fissure dans le pipe
@@ -344,12 +347,12 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
         logging.debug("face found")
         facesFissinPipe.append(face)
         name = "faceFissInPipe_%d"%i
-        geompy.addToStudyInFather(pipeFondFiss, face, name)
+        geomPublishInFather(initLog.debug,pipeFondFiss, face, name)
         break
   groupFaceFissInPipe = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["FACE"])
   geompy.UnionList(groupFaceFissInPipe, facesFissinPipe)
   name = "FaceFissInPipe"
-  geompy.addToStudyInFather(pipeFondFiss, groupFaceFissInPipe , name)
+  geomPublishInFather(initLog.debug,pipeFondFiss, groupFaceFissInPipe , name)
 
   # --- edges de fond de fissure
 
@@ -359,11 +362,11 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
     logging.debug("  edge %s ", anEdge)
     edgesFondFiss.append(anEdge)
     name ="edgeFondFissure_%d"%i
-    geompy.addToStudyInFather(pipeFondFiss, anEdge, name)
+    geomPublishInFather(initLog.debug,pipeFondFiss, anEdge, name)
   groupEdgeFondFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
   geompy.UnionList(groupEdgeFondFiss, edgesFondFiss)
   name = "FONDFISS"
-  geompy.addToStudyInFather(pipeFondFiss, groupEdgeFondFiss , name)
+  geomPublishInFather(initLog.debug,pipeFondFiss, groupEdgeFondFiss , name)
 
   # -------------------------------------------------------------------------
   # --- maillage
diff --git a/src/Tools/blocFissure/gmu/listOfExtraFunctions.py b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py
new file mode 100644 (file)
index 0000000..fbdd5cf
--- /dev/null
@@ -0,0 +1,198 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Jun 23 14:49:36 2014
+
+@author: I48174 (Olivier HOAREAU)
+"""
+
+import logging
+import SMESH
+from geomsmesh import smesh
+
+def lookForCorner(maillageAScanner):
+    
+    """ Cette fonction permet de scanner la liste de noeuds qui composent le
+        maillage passé en paramètre. On recherche un ou plusieurs coins, ce
+        qui implique les caractéristiques suivantes:
+            - le noeud doit appartenir au moins Ã  trois Ã©léments distincts
+            - chaque Ã©lément doit appartenir Ã  un ensemble distinct
+        La fonction renvoie une liste de coins par l'intermédiaire de l'IDs
+        chaque noeud. La liste contient en général au maximum deux coins.
+    """
+    
+    logging.info("start")
+    
+    allNodeIds = maillageAScanner.GetNodesId()  # On stocke tout les noeuds
+    listOfCorners = []
+    for ND in allNodeIds:
+        # On parcours la liste de noeuds
+        listOfElements = maillageAScanner.GetNodeInverseElements(ND)
+        if len(listOfElements) >=3:
+            # On teste le nombre d'éléments qui partagent le même noeud
+            # --- Filtre selon le critère 'coplanar' --- #
+            listOfCriterion = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \
+                               SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) \
+                               for elem in listOfElements]
+            listOfFilters = [smesh.GetFilterFromCriteria([criteria]) for criteria in listOfCriterion]
+            listOfSets = [maillageAScanner.GetIdsFromFilter(filter) for filter in listOfFilters]
+            if listOfSets.count(listOfSets[0]) == len(listOfSets):
+                # Si toutes les listes d'éléments sont similaires, on retourne
+                # au début pour Ã©viter de travailler sur des Ã©léments inutiles.
+                # Exemple : un noeud appartenant Ã  4 Ã©léments sur la même face.
+                continue
+            for s in listOfSets:
+                while listOfSets.count(s) > 1:
+                    # On supprime tant que la liste d'éléments n'est pas unique.
+                    listOfSets.remove(s)
+            if len(listOfSets) >= 3:
+                # Si on a au moins 3 listes d'élements différentes, on considère
+                # qu'il y a présence d'un coin.
+                listOfCorners.append(ND)
+    return listOfCorners
+
+def createLinesFromMesh(maillageSupport):
+    
+    """ Cette fonction permet de générer une liste de lignes Ã  partir du 
+        maillage support passé en paramètre. On démarre Ã  partir d'un coin
+        simple et on parcourt tout les noeuds pour former une ligne. Soit la
+        figure ci-dessous :
+            
+            1_____4_____7    On part du coin N1, et on cherche les noeuds
+            |     |     |    successifs tels que [1, 2, 3]. Lorsqu'on arrive
+            |  1  |  3  |    arrive sur le noeud de fin de ligne N3, on repart
+            |     |     |    du noeud précédent du premier Ã©lément (E1), Ã 
+            2_____5_____8    savoir le noeud N4. On suit les noeuds succesifs
+            |     |     |    [4, 5, 6] comme précédemment et ainsi de suite.
+            |  2  |  4  |    Lorsqu'on arrive sur le dernier noeud de la
+            |     |     |    dernière ligne, Ã  savoir le noeud N9, on considère
+            3_____6_____9    que toutes les lignes sont créées.
+            
+        La fonction retourne une liste de lignes utilisées par la suite.
+    """
+    
+    logging.info("start")
+    
+    allNodeIds = maillageSupport.GetNodesId()
+    while len(allNodeIds):
+        nodeIds = allNodeIds
+        for idNode in nodeIds: # rechercher un coin
+          elems = maillageSupport.GetNodeInverseElements(idNode)
+          if len(elems) == 1:
+            # un coin: un noeud, un element quadrangle
+            elem = elems[0]
+            break;
+        idStart = idNode # le noeud de coin
+        elemStart = elem # l'élément quadrangle au coin
+        xyz = maillageSupport.GetNodeXYZ(idStart)
+        logging.debug("idStart %s, coords %s", idStart, str(xyz))
+    
+        nodelines =[] # on va constituer une liste de lignes de points
+        nextLine = True
+        ligneFinale = False
+        while nextLine:
+            logging.debug("--- une ligne")
+            idNode = idStart
+            elem = elemStart
+            if ligneFinale:
+                agauche = False  # sens de parcours des 4 noeuds d'un quadrangle
+                nextLine = False
+            else:
+                agauche = True
+            ligneIncomplete = True  # on commence une ligne de points
+            debutLigne = True
+            nodeline = []
+            elemline = []
+            while ligneIncomplete:  # compléter la ligne de points
+                nodeline.append(idNode)
+                allNodeIds.remove(idNode)
+                elemline.append(elem)
+                nodes = maillageSupport.GetElemNodes(elem)
+                i = nodes.index(idNode)  # repérer l'index du noeud courant (i) dans l'élément quadrangle (0 a 3)
+                if agauche:              # déterminer le noeud suivant (j) et celui opposé (k) dans le quadrangle
+                    if i < 3:
+                        j = i+1
+                    else:
+                        j = 0
+                    if j < 3:
+                        k = j+1
+                    else:
+                        k = 0
+                else:
+                    if i > 0:
+                        j = i -1
+                    else:
+                        j = 3
+                    if j > 0:
+                        k = j -1
+                    else:
+                        k = 3
+                isuiv = nodes[j]   # noeud suivant
+                iapres = nodes[k]  # noeud opposé
+                if debutLigne:
+                    debutLigne = False
+                    # précédent a trouver, dernière ligne : précédent au lieu de suivant
+                    if agauche:
+                        if i > 0:
+                            iprec = nodes[i -1]
+                        else:
+                            iprec = nodes[3]
+                        idStart = iprec
+                        elems3 = maillageSupport.GetNodeInverseElements(iprec)
+                        if len(elems3) == 1: # autre coin
+                            ligneFinale = True
+                        else:
+                            for elem3 in elems3:
+                                if elem3 != elem:
+                                    elemStart = elem3
+                                    break
+                #print nodes, idNode, isuiv, iapres
+                elems1 = maillageSupport.GetNodeInverseElements(isuiv)
+                elems2 = maillageSupport.GetNodeInverseElements(iapres)
+                ligneIncomplete = False
+                for elem2 in elems2:
+                    if elems1.count(elem2) and elem2 != elem:
+                        ligneIncomplete = True
+                        idNode = isuiv
+                        elem = elem2
+                        break
+                if not  ligneIncomplete:
+                    nodeline.append(isuiv)
+                    allNodeIds.remove(isuiv)
+            logging.debug("nodeline %s", nodeline)
+            logging.debug("elemline %s", elemline)
+            nodelines.append(nodeline)
+             
+        # on a constitué une liste de lignes de points connexes
+        logging.debug("dimensions [%s, %s]", len(nodelines),  len(nodeline))
+    
+    return nodelines
+
+def createNewMeshesFromCorner(maillageSupport, listOfCorners):
+    
+    """ Cette fonction permet de générer un nouveau maillage plus facile Ã 
+        utiliser. On démarre d'un coin et on récupère les trois Ã©léments
+        auquel le noeud appartient. Grâce Ã  un filtre 'coplanar' sur les trois
+        Ã©léments, on peut générer des faces distinctes.
+    """
+    
+    logging.info("start")
+    
+    tmp = []
+    listOfNewMeshes = []
+    for corner in listOfCorners:
+        elems = maillageSupport.GetNodeInverseElements(corner)
+        for i, elem in enumerate(elems):
+            # --- Filtre selon le critère 'coplanar' --- #
+            critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \
+                                         SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30)
+            filtre = smesh.GetFilterFromCriteria([critere])
+            grp = maillageSupport.GroupOnFilter(SMESH.FACE, 'grp', filtre)
+            # On copie le maillage en fonction du filtre
+            msh = smesh.CopyMesh(grp, 'new_{0}'.format(i + 1), False, True)
+            # On stocke l'ensemble des noeuds du maillage dans tmp
+            # On ajoute le maillage Ã  la liste des nouveaux maillages
+            # seulement s'il n'y est pas déjà
+            tmp.append(msh.GetNodesId())
+            if tmp.count(msh.GetNodesId()) <= 1:
+                listOfNewMeshes.append(msh)
+    return listOfNewMeshes
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py
new file mode 100644 (file)
index 0000000..1791243
--- /dev/null
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import smesh
+import SMESH
+
+from putName import putName
+  
+def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, dmoyen):
+  """
+  edges de bord, faces défaut Ã  respecter
+  """
+  logging.info('start')
+
+  aFilterManager = smesh.CreateFilterManager()
+  nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [  ])
+  criteres = []
+  unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
+  criteres.append(unCritere)
+  filtre = smesh.GetFilterFromCriteria(criteres)
+  bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
+  smesh.SetName(bordsLibres, 'bordsLibres')
+
+  # --- pour aider l'algo hexa-tetra Ã  ne pas mettre de pyramides Ã  l'exterieur des volumes repliés sur eux-mêmes
+  #     on désigne les faces de peau en quadrangles par le groupe "skinFaces"
+
+  skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' )
+  nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() )
+
+  # --- maillage des Ã©ventuelles arêtes vives entre faces reconstruites
+  
+  grpAretesVives = None
+  if len(aretesVivesCoupees) > 0:
+    aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
+    meshAretesVives = smesh.Mesh(aretesVivesC)
+    algo1d = meshAretesVives.Segment()
+    hypo1d = algo1d.LocalLength(dmoyen,[],1e-07)
+    putName(algo1d.GetSubMesh(), "aretesVives")
+    putName(algo1d, "algo1d_aretesVives")
+    putName(hypo1d, "hypo1d_aretesVives")
+    isDone = meshAretesVives.Compute()
+    logging.info("aretesVives fini")
+    grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
+    nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
+
+  return (internalBoundary, bordsLibres, grpAretesVives)
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py
new file mode 100644 (file)
index 0000000..90bd870
--- /dev/null
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+import SMESH
+
+from putName import putName
+  
+def mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC,
+                        meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad):
+  """
+  maillage faces de fissure
+  """
+  logging.info('start')
+
+  meshFaceFiss = smesh.Mesh(faceFissureExterne)
+  algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D)
+  hypo2d = algo2d.Parameters()
+  hypo2d.SetMaxSize( areteFaceFissure )
+  hypo2d.SetSecondOrder( 0 )
+  hypo2d.SetOptimize( 1 )
+  hypo2d.SetFineness( 2 )
+  hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
+  hypo2d.SetQuadAllowed( 0 )
+  putName(algo2d.GetSubMesh(), "faceFiss")
+  putName(algo2d, "algo2d_faceFiss")
+  putName(hypo2d, "hypo2d_faceFiss")
+  
+  algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
+  hypo1d = algo1d.SourceEdges([ meshPipeGroups['edgeFaceFissGroup'] ],0,0)
+  putName(algo1d.GetSubMesh(), "edgeFissPeau")
+  putName(algo1d, "algo1d_edgeFissPeau")
+  putName(hypo1d, "hypo1d_edgeFissPeau")
+  
+  isDone = meshFaceFiss.Compute()
+  logging.info("meshFaceFiss fini")
+
+  grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE)
+  grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
+  grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
+
+  return (meshFaceFiss, grpFaceFissureExterne, grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne)
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py
new file mode 100644 (file)
index 0000000..41a72e9
--- /dev/null
@@ -0,0 +1,111 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+import SMESH
+
+from putName import putName
+
+def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
+                    facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau,
+                    bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives,
+                    edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad):
+  """
+  maillage faces de peau
+  """
+  logging.info('start')
+  nbFacesFilling = len(partitionsPeauFissFond)
+  boutFromIfil = [None for i in range(nbFacesFilling)]
+  if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes
+    boutFromIfil[idFillingFromBout[0]] = 0
+    boutFromIfil[idFillingFromBout[1]] = 1
+  
+  logging.debug("---------------------------- maillage faces de peau --------------")
+  meshesFacesPeau = []
+  for ifil in range(nbFacesFilling):
+    meshFacePeau = None
+    if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
+
+      logging.debug("meshFacePeau %d intacte", ifil)
+      # --- edges de bord de la face de filling
+      filling = facesDefaut[ifil]
+      edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
+      groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
+      geompy.UnionList(groupEdgesBordPeau, edgesFilling)
+      geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
+      
+      meshFacePeau = smesh.Mesh(facesDefaut[ifil])
+      
+      algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+      hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+      putName(algo1d.GetSubMesh(), "bordsLibres", ifil)
+      putName(algo1d, "algo1d_bordsLibres", ifil)
+      putName(hypo1d, "hypo1d_bordsLibres", ifil)
+      
+    else:
+      
+      logging.debug("meshFacePeau %d coupée par la fissure", ifil)
+      facePeau           = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
+      edgesCircPeau      = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
+      verticesCircPeau   = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
+      groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés Ã  la partie saine
+      bordsVifs          = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant Ã  des arêtes vives
+      edgesFissurePeau   = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+
+      meshFacePeau = smesh.Mesh(facePeau)
+      
+      algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+      hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+      putName(algo1d.GetSubMesh(), "bordsLibres", ifil)
+      putName(algo1d, "algo1d_bordsLibres", ifil)
+      putName(hypo1d, "hypo1d_bordsLibres", ifil)
+      
+      algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau))
+      hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
+      putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil)
+      putName(algo1d, "algo1d_edgePeauFiss", ifil)
+      putName(hypo1d, "hypo1d_edgePeauFiss", ifil)
+      
+      if bordsVifs is not None:
+        algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
+        hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
+        putName(algo1d.GetSubMesh(), "bordsVifs", ifil)
+        putName(algo1d, "algo1d_bordsVifs", ifil)
+        putName(hypo1d, "hypo1d_bordsVifs", ifil)
+        
+      for i, edgeCirc in enumerate(edgesCircPeau):
+        if edgeCirc is not None:
+          algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc)
+          if boutFromIfil[ifil] is None:
+            hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i] ],0,0)
+          else:
+            hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0)
+          name = "cercle%d"%i
+          putName(algo1d.GetSubMesh(), name, ifil)
+          putName(algo1d, "algo1d_" + name, ifil)
+          putName(hypo1d, "hypo1d_" + name, ifil)
+   
+    algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D)
+    hypo2d = algo2d.Parameters()
+    hypo2d.SetMaxSize( dmoyen )
+    hypo2d.SetOptimize( 1 )
+    hypo2d.SetFineness( 2 )
+    hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
+    hypo2d.SetQuadAllowed( 0 )
+    putName(algo2d.GetSubMesh(), "facePeau", ifil)
+    putName(algo2d, "algo2d_facePeau", ifil)
+    putName(hypo2d, "hypo2d_facePeau", ifil)
+      
+    isDone = meshFacePeau.Compute()
+    logging.info("meshFacePeau %d fini", ifil)
+    GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
+    nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
+    meshesFacesPeau.append(meshFacePeau)
+
+  return meshesFacesPeau
\ No newline at end of file
index 4016c9a5bee28044b386f1522eb92d66203b3501..be3a3481dfb73d116d3461b60dbbe8f64b93f4d9 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- partition du bloc defaut par generatrice, tore et plan fissure
@@ -29,10 +32,10 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
   faceFissure = geompy.GetInPlaceByHistory(volDefautPart, facefis)
   #ellipsoidep =geompy.GetInPlaceByHistory(volDefautPart, ellipsoide)
 
-  geompy.addToStudy( volDefautPart, 'volDefautPart' )
-  geompy.addToStudyInFather( volDefautPart, tore, 'tore' )
-  geompy.addToStudyInFather( volDefautPart, faceFissure, 'FACE1' )
-  #geompy.addToStudyInFather( volDefautPart, gencnt, 'generatrice' )
+  geomPublish(initLog.debug,  volDefautPart, 'volDefautPart' )
+  geomPublishInFather(initLog.debug, volDefautPart, tore, 'tore' )
+  geomPublishInFather(initLog.debug, volDefautPart, faceFissure, 'FACE1' )
+  #geomPublishInFather(initLog.debug, volDefautPart, gencnt, 'generatrice' )
 
   solids = geompy.ExtractShapes(blocp, geompy.ShapeType["SOLID"], True)
   vols = []
@@ -47,13 +50,13 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
   imaxvol = vols.index(maxvol)
   ellipsoidep = solids[imaxvol]
 
-  geompy.addToStudyInFather( volDefautPart, blocp, 'bloc' )
-  geompy.addToStudyInFather( volDefautPart, ellipsoidep, 'ellipsoide' )
+  geomPublishInFather(initLog.debug, volDefautPart, blocp, 'bloc' )
+  geomPublishInFather(initLog.debug, volDefautPart, ellipsoidep, 'ellipsoide' )
 
   sharedFaces = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["FACE"])
   for i in range(len(sharedFaces)):
     name = "faceCommuneEllipsoideBloc_%d"%i
-    geompy.addToStudyInFather(blocp, sharedFaces[i], name)
+    geomPublishInFather(initLog.debug,blocp, sharedFaces[i], name)
 
   #sharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
   allSharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
@@ -63,7 +66,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
       sharedEdges.append(allSharedEdges[i])
   for i in range(len(sharedEdges)):
     name = "edgeCommuneEllipsoideBloc_%d"%i
-    geompy.addToStudyInFather(blocp, sharedEdges[i], name)
+    geomPublishInFather(initLog.debug,blocp, sharedEdges[i], name)
 
   facesExternes = []
   facesExtBloc = []
@@ -75,14 +78,14 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
     faceExt = geompy.GetInPlace(ellipsoidep, faces[i])
     if faceExt is not None:
       name = "faceExterne_e%d"%i
-      geompy.addToStudyInFather(ellipsoidep, faceExt, name)
+      geomPublishInFather(initLog.debug,ellipsoidep, faceExt, name)
       facesExternes.append(faceExt)
       facesExtElli.append(faceExt)
 
     faceExt = geompy.GetInPlace(blocp, faces[i])
     if faceExt is not None:
       name = "faceExterne_b%d"%i
-      geompy.addToStudyInFather(blocp, faceExt, name)
+      geomPublishInFather(initLog.debug,blocp, faceExt, name)
       facesExternes.append(faceExt)
       facesExtBloc.append(faceExt)
     else:
@@ -93,12 +96,12 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
       #extrusionFace = geompy.MakePrismVecH2Ways(faces[i], normal, 0.1)
       #extrusionFace = geompy.MakeScaleTransform(extrusionFace, vertex, 1.01)
       name = "extrusionFace_b%d"%i
-      geompy.addToStudyInFather(blocp, extrusionFace, name)
+      geomPublishInFather(initLog.debug,blocp, extrusionFace, name)
       #facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
       facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ON)
       for j in range(len(facesExt)):
         name = "faceExterne_b%d_%d"%(i,j)
-        geompy.addToStudyInFather(blocp, facesExt[j], name)
+        geomPublishInFather(initLog.debug,blocp, facesExt[j], name)
         facesExternes.append(facesExt[j])
         facesExtBloc.append(facesExt[j])
 
@@ -120,7 +123,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
             pass
           if len(allSharedEdges) > 0:
             name = "faceExterne_b%d_%d"%(i,j)
-            geompy.addToStudyInFather(blocp, facesBloc[i], name)
+            geomPublishInFather(initLog.debug,blocp, facesBloc[i], name)
             facesExternes.append(facesBloc[i])
             facesExtBloc.append(facesBloc[i])
 
@@ -136,7 +139,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
         aretesInternes += shared
   for i in range(len(aretesInternes)):
     name = "aretesInternes_%d"%i
-    geompy.addToStudyInFather(blocp, aretesInternes[i], name)
+    geomPublishInFather(initLog.debug,blocp, aretesInternes[i], name)
 
   edgesBords = []
   for faceExtB in facesExtBloc:
@@ -150,7 +153,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
       if not isInterne:
         edgesBords.append(edges[i])
         name = "edgeBord%d"%i
-        geompy.addToStudyInFather(blocp,edges[i] , name)
+        geomPublishInFather(initLog.debug,blocp,edges[i] , name)
   group = None
   if len(edgesBords) > 0:
     group = geompy.CreateGroup(blocp, geompy.ShapeType["EDGE"])
index a23fa591a13f6af015f1338d139ff1faa51c1c61..e7ce51a11b479791a38d63361c0941d2529ef9ee 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- partition volume sain et bloc, face du bloc recevant la fissure
@@ -26,8 +29,8 @@ def partitionVolumeSain(volumeSain,boiteDefaut):
     partieSaine = b
   faceBloc = geompy.GetShapesOnShapeAsCompound(volumeSain, volDefaut, geompy.ShapeType["FACE"], GEOM.ST_ON)
 
-  geompy.addToStudy( volumeSainPart, 'volumeSainPart' )
-  geompy.addToStudyInFather( volumeSainPart, partieSaine, 'partieSaine' )
-  geompy.addToStudyInFather( volumeSainPart, volDefaut, 'volDefaut' )
-  geompy.addToStudyInFather( volDefaut, faceBloc, 'faceBloc' )
+  geomPublish(initLog.debug,  volumeSainPart, 'volumeSainPart' )
+  geomPublishInFather(initLog.debug, volumeSainPart, partieSaine, 'partieSaine' )
+  geomPublishInFather(initLog.debug, volumeSainPart, volDefaut, 'volDefaut' )
+  geomPublishInFather(initLog.debug, volDefaut, faceBloc, 'faceBloc' )
   return volumeSainPart, partieSaine, volDefaut, faceBloc
diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py
new file mode 100644 (file)
index 0000000..7d62897
--- /dev/null
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+
+import math
+import logging
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+from findWireEndVertices import findWireEndVertices
+from prolongeWire import prolongeWire
+
+def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
+  """
+  pipe de fond de fissure, prolongé, partition face fissure par pipe
+  identification des edges communes pipe et face fissure
+  """
+  logging.info('start')
+  shapeDefaut       = shapesFissure[0] # faces de fissure, débordant
+  fondFiss          = shapesFissure[4] # groupe d'edges de fond de fissure
+  centreFondFiss    = elementsDefaut[15]
+  tgtCentre         = elementsDefaut[16]
+
+  if geompy.NumberOfFaces(shapeDefaut) == 1:
+    plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
+    shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+    #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
+    geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
+    #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
+  
+  extrem, norms = findWireEndVertices(fondFiss, True)
+  logging.debug("extrem: %s, norm: %s",extrem, norms)
+  cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
+  cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # Ã©viter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
+  geomPublish(initLog.debug, cercle, 'cercle')
+  fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
+  pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
+  geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
+  partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
+  geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
+  fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
+  geomPublish(initLog.debug, fissPipe, 'fissPipe')
+  partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
+  geomPublish(initLog.debug, partPipe, 'partPipe')
+  
+  edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
+  for i, edge in enumerate(edgesPipeFiss):
+    name = "edgePipe%d"%i
+    geomPublishInFather(initLog.debug,fissPipe, edge, name)
+  try:
+    wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
+  except:
+    wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
+    logging.debug("wirePipeFiss construit sous forme de compound")
+  geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
+  
+  wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
+  edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
+  for i, edge in enumerate(edgesFondFiss):
+    name = "edgeFondFiss%d"%i
+    geomPublishInFather(initLog.debug,fissPipe, edge, name)
+  wireFondFiss = geompy.MakeWire(edgesFondFiss)
+  geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")  
+
+  return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)
\ No newline at end of file
index 6790061b96213a9259d9bbff54fe0092c2ccf668..b1915042e9066a2338b5b0d80e6a93ee01375c28 100644 (file)
@@ -4,10 +4,13 @@ import logging
 from geomsmesh import smesh
 import SMESH
 
+from listOfExtraFunctions import lookForCorner
+from fusionMaillageAttributionDefaut import fusionMaillageDefaut
+
 # -----------------------------------------------------------------------------
 # --- peau interne du defaut dans le maillage sain
 
-def peauInterne(fichierMaillage, nomZones):
+def peauInterne(fichierMaillage, shapeDefaut, nomZones):
   """
   Retrouve les groupes de défaut dans le maillage sain modifié par CreateHoleSkin (CreeZoneDefautMaillage)
   On récupère le volume et la peau de la zone de défaut, les Ã©ventuelles faces et arêtes internes de cette zone.
@@ -18,7 +21,7 @@ def peauInterne(fichierMaillage, nomZones):
   groups = maillageSain.GetGroups()
   zoneDefaut = None
   for grp in groups:
-    #print " ",grp.GetName()
+    logging.debug("groupe %s",grp.GetName())
     if grp.GetName() == nomZones + "_vol":
       zoneDefaut = grp
       break
@@ -41,6 +44,13 @@ def peauInterne(fichierMaillage, nomZones):
   nbAdded, maillageSain, DefautBoundary = maillageSain.MakeBoundaryElements( SMESH.BND_2DFROM3D, 'DefBound', '', 0, [ zoneDefaut ])
   internal = maillageSain.GetMesh().CutListOfGroups( [ DefautBoundary ], [ zoneDefaut_skin ], 'internal' )
   internalBoundary = smesh.CopyMesh( internal, 'internalBoundary', 0, 0)
+  
+  maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0)
+  listOfCorner = lookForCorner(maillageDefautCible)
+  logging.debug("listOfCorner = %s", listOfCorner)
+  if len(listOfCorner) > 0:
+      logging.info("présence de coins Ã  la surface externe de la zone Ã  reconstruire")
+      zoneDefaut_skin, internalBoundary = fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner)
 
   return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges
 
index 72e766dffec6d199cfe0c2e67701314331107445..52b3991b4540059b9314027dc2f47b9deec52f28 100644 (file)
@@ -2,6 +2,10 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+from orderEdgesFromWire import orderEdgesFromWire
 
 # -----------------------------------------------------------------------------
 # --- prolongation d'un wire par deux segments tangents
@@ -12,18 +16,43 @@ def prolongeWire(aWire, extrem, norms, long):
   logging.info("start")
   if geompy.NumberOfEdges(aWire) > 1:
     edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"])
+    uneSeuleEdge = False
   else:
     edges = [aWire]
+    uneSeuleEdge = True
+  edgesBout = []
   for i, v1 in enumerate(extrem):
     exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-long, long)]
     dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)]
     dists.sort()
     v2 = dists[-1][-1]
-    #v2 = geompy.MakeTranslationVectorDistance(v1, norms[i], long)
     edge = geompy.MakeEdge(v1, v2)
     edges.append(edge)
+    edgesBout.append(edge)
     name = "extrem%d"%i
-    #geompy.addToStudy(edge,name)
-  wireProlonge = geompy.MakeWire(edges)
-  geompy.addToStudy(wireProlonge, "wireProlonge")
+    geomPublish(initLog.debug, edge, name)
+  try:
+    wireProlonge = geompy.MakeWire(edges)
+    geomPublish(initLog.debug, wireProlonge, "wireProlonge")
+  except:
+    logging.warning("probleme MakeWire, approche pas a pas")
+    if uneSeuleEdge:
+      edgelist = [aWire]
+      accessList = [0]
+    else:
+      edgelist, accessList = orderEdgesFromWire(aWire)
+    edge1 = edgelist[accessList[0]]
+    if geompy.MinDistance(edgesBout[0], edge1) < 1.e-4 :
+      i0 = 0
+      i1 = 1
+    else:
+      i0 = 1
+      i1 = 0
+    wireProlonge = edgesBout[i0]
+    for i in range(len(edgelist)):
+      wireProlonge = geompy.MakeWire([wireProlonge, edgelist[accessList[i]]])
+      geomPublish(initLog.debug, wireProlonge, "wireProlonge_%d"%i)
+    wireProlonge = geompy.MakeWire([wireProlonge,edgesBout[i1]])
+    geomPublish(initLog.debug, wireProlonge, "wireProlonge")
+    logging.warning("prolongation wire pas a pas OK")
   return wireProlonge
index 70678a420b83597dd3e6b93411d58da5932d7d88..23200e1f738b06dc72086bb037497b9fbc186bb3 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- recherche et classement des edges du tore par propagate
@@ -18,7 +21,7 @@ def propagateTore(tore):
   lencomp = []
   compounds = geompy.Propagate(tore)
   for i in range(len(compounds)):
-    #geompy.addToStudyInFather( tore, compounds[i], 'edges' )
+    #geomPublishInFather(initLog.debug, tore, compounds[i], 'edges' )
     props = geompy.BasicProperties(compounds[i])
     lencomp.append(props[0])
     pass
@@ -35,10 +38,10 @@ def propagateTore(tore):
     else:
       circles.append(compounds[i])
 
-  geompy.addToStudyInFather( tore, diams[0], 'diams0' )
-  geompy.addToStudyInFather( tore, diams[1], 'diams1' )
-  geompy.addToStudyInFather( tore, circles[0], 'circles0' )
-  geompy.addToStudyInFather( tore, circles[1], 'circles1' )
-  geompy.addToStudyInFather( tore, geners[0], 'geners' )
+  geomPublishInFather(initLog.debug, tore, diams[0], 'diams0' )
+  geomPublishInFather(initLog.debug, tore, diams[1], 'diams1' )
+  geomPublishInFather(initLog.debug, tore, circles[0], 'circles0' )
+  geomPublishInFather(initLog.debug, tore, circles[1], 'circles1' )
+  geomPublishInFather(initLog.debug, tore, geners[0], 'geners' )
 
   return diams, circles, geners
index faa9478f7805053a9633c7a211b1b28ab81d9200..b9facb652fe7dcd83eea7aeac10d572d3a46219f 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 import GEOM
 import math
 import numpy as np
@@ -225,23 +228,23 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
           if i == 0:
             noeudsBords[0].append(node)
             #name = "bord0_%d"%k
-            #geompy.addToStudy( node, name )
+            #geomPublish(initLog.debug,  node, name )
           if i == (nbLignes -1):
             noeudsBords[2].append(node)
             #name = "bord2_%d"%k
-            #geompy.addToStudy( node, name )
+            #geomPublish(initLog.debug,  node, name )
           if j == 0:
             noeudsBords[1].append(node)
             #name = "bord1_%d"%k
-            #geompy.addToStudy( node, name )
+            #geomPublish(initLog.debug,  node, name )
           if j == (nbCols -1):
             noeudsBords[3].append(node)
             #name = "bord3_%d"%k
-            #geompy.addToStudy( node, name )
+            #geomPublish(initLog.debug,  node, name )
             k += 1
         curve = geompy.MakeInterpol(nodeList, False, False)
         #name = "curve_%d"%i
-        #geompy.addToStudy( curve, name )
+        #geomPublish(initLog.debug,  curve, name )
         if len(curvconts) == 0 or len(curves) > 0: # Ã©liminer les doublons de la surface sans découpe 
           curvconts.append(nodeList)
         curves.append(curve)
@@ -291,11 +294,11 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
           vecteurDefaut = geompy.MakeVector(vertex, cdg)
      
       if vecteurDefaut is not None:
-        geompy.addToStudy(normal, "normFillOrig%d"%iface)
-        geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface)
+        geomPublish(initLog.debug, normal, "normFillOrig%d"%iface)
+        geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface)
         if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
           filling = geompy.ChangeOrientation(filling)
-      geompy.addToStudy( filling, "filling%d"%iface )
+      geomPublish(initLog.debug,  filling, "filling%d"%iface )
       #geompy.ExportBREP(filling, "filling.brep")
       iface = iface+1
       fillings.append(filling)
@@ -315,7 +318,7 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
         curve = geompy.MakeInterpol(nodes, False, False)
         curves.append(curve)
       fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
-    geompy.addToStudy( fillcont, "filcont%d"%icont )
+    geomPublish(initLog.debug,  fillcont, "filcont%d"%icont )
     fillconts.append(fillcont)
     icont = icont+1   
     pass   # --- loop while there are remaining nodes
diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py
new file mode 100644 (file)
index 0000000..d3c52ab
--- /dev/null
@@ -0,0 +1,330 @@
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+import GEOM
+import math
+import numpy as np
+
+def mydot(a):
+  return np.dot(a,a)
+
+# -----------------------------------------------------------------------------
+# --- groupe de quadrangles de face transformé en face géométrique par filling
+
+def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss):
+  """
+  groupe de quadrangles de face transformée en faces géométriques par filling
+  on part de quadrangles définissant une zone a 4 cotés (convexe), et on reconstitue n lignes de p points.
+  Ces n lignes de p points sont transformées en n courbes géométriques,
+  Ã  partir desquelles on reconstitue une surface géométrique.
+  Il peut y avoir plusieurs faces géométriques reconstituées, si on fournit des groupes de quadrangles non connexes.
+  On détecte les angles vifs, pour conserver des arêtes vives délimitant des faces connexes.
+  @param meshQuad : maillages constitué de quadrangles constituant une ou plusieurs zones convexes
+  @return (fillings, noeuds_Bords) : liste de geomObject, listes des bords (bord = liste ordonnée de noeuds (geomObject))
+  """
+  logging.info("start")
+
+  isVecteurDefaut = False
+  if shapeFissureParams.has_key('vecteurDefaut'):
+    isVecteurDefaut = True
+    vecteurDefaut = shapeFissureParams['vecteurDefaut']
+
+  fillings = []       # les faces reconstituées, découpées selon les arêtes vives
+  noeuds_bords = []   #
+  bords_Partages = [] # contient a la fin les courbes correspondant aux arêtes vives
+  fillconts = []      # les faces reconstituées, sans découpage selon les arêtes vives
+  idFilToCont = []    # index face découpée vers face sans découpe
+  iface = 0           # index face découpée
+  icont = 0           # index face continue
+  
+  allNodeIds = meshQuad.GetNodesId()
+  while len(allNodeIds):
+    logging.debug("len(allNodeIds): %s ", len(allNodeIds))
+    nodeIds = allNodeIds
+    for idNode in nodeIds: # rechercher un coin
+      elems = meshQuad.GetNodeInverseElements(idNode)
+      if len(elems) == 1:
+        # un coin: un noeud, un element quadrangle
+        elem = elems[0]
+        break;
+    idStart = idNode # le noeud de coin
+    elemStart = elem # l'élément quadrangle au coin
+    xyz = meshQuad.GetNodeXYZ(idStart)
+    logging.debug("idStart %s, coords %s", idStart, str(xyz))
+  
+    nodelines =[] # on va constituer une liste de lignes de points
+    nextLine = True
+    ligneFinale = False
+    while nextLine:
+      logging.debug("--- une ligne")
+      idNode = idStart
+      elem = elemStart
+      if ligneFinale:
+        agauche = False      # sens de parcours des 4 noeuds d'un quadrangle
+        nextLine = False
+      else:
+        agauche = True
+      ligneIncomplete = True # on commence une ligne de points
+      debutLigne = True
+      nodeline = []
+      elemline = []
+      while ligneIncomplete: # compléter la ligne de points
+        nodeline.append(idNode)
+        allNodeIds.remove(idNode)
+        elemline.append(elem)
+        nodes = meshQuad.GetElemNodes(elem)
+        i = nodes.index(idNode) # repérer l'index du noeud courant (i) dans l'élément quadrangle (0 a 3)
+        if agauche:             # déterminer le noeud suivant (j) et celui opposé (k) dans le quadrangle
+          if i < 3:
+            j = i+1
+          else:
+            j = 0
+          if j < 3:
+            k = j+1
+          else:
+            k = 0
+        else:
+          if i > 0:
+            j = i -1
+          else:
+            j = 3
+          if j > 0:
+            k = j -1
+          else:
+            k = 3
+        isuiv = nodes[j]   #noeud suivant
+        iapres = nodes[k]  #noeud opposé
+        if debutLigne:
+          debutLigne = False
+          # précédent a trouver, dernière ligne : précédent au lieu de suivant
+          if agauche:
+            if i > 0:
+              iprec = nodes[i -1]
+            else:
+              iprec = nodes[3]
+            idStart = iprec
+            elems3 = meshQuad.GetNodeInverseElements(iprec)
+            if len(elems3) == 1: # autre coin
+              ligneFinale = True
+            else:
+              for elem3 in elems3:
+                if elem3 != elem:
+                  elemStart = elem3
+                  break
+        #print nodes, idNode, isuiv, iapres
+        elems1 = meshQuad.GetNodeInverseElements(isuiv)
+        elems2 = meshQuad.GetNodeInverseElements(iapres)
+        ligneIncomplete = False
+        for elem2 in elems2:
+          if elems1.count(elem2) and elem2 != elem:
+            ligneIncomplete = True
+            idNode = isuiv
+            elem = elem2
+            break
+        if not  ligneIncomplete:
+          nodeline.append(isuiv)
+          allNodeIds.remove(isuiv)
+      logging.debug("nodeline %s", nodeline)
+      logging.debug("elemline %s", elemline)
+      nodelines.append(nodeline)
+    logging.debug("nodelines = %s", nodelines)
+    longueur = [len(val) for val in nodelines]
+    logging.debug("longueur = %s", longueur)
+    # on a constitué une liste de lignes de points connexes
+    logging.debug("dimensions [%s, %s]", len(nodelines),  len(nodeline))   
+    
+    # stockage des coordonnées dans un tableau numpy
+    mat = np.zeros((len(nodelines), len(nodeline), 3))
+    for i, ligne in enumerate(nodelines):
+      for j, nodeId in enumerate(ligne):
+        mat[i,j] = meshQuad.GetNodeXYZ(nodeId)
+    logging.debug("matrice de coordonnées: \n%s",mat)
+    logging.debug("dimensions %s", mat.shape)
+    
+    # recherche d'angles supérieurs a un seuil sur une ligne : angle entre deux vecteurs successifs
+    cosmin = math.cos(math.pi/4.)          # TODO: angle reference en paramètre
+    vecx = mat[:, 1:,  :] - mat[:, :-1, :] # vecteurs selon direction "x"
+    vx0 = vecx[:, :-1, :]                  # vecteurs amont
+    vx1 = vecx[:, 1:,  :]                  # vecteurs aval
+    e = np.einsum('ijk,ijk->ij', vx0, vx1) # produit scalaire des vecteurs
+    f = np.apply_along_axis(mydot, 2, vx0) # normes carrées vecteurs amont
+    g = np.apply_along_axis(mydot, 2, vx1) # normes carrées vecteurs aval
+    h = e/(np.sqrt(f*g))                   # cosinus
+    ruptureX = h < cosmin                  # True si angle > reference
+    logging.debug("matrice de rupture X: \n%s",ruptureX)
+    rupX = filter(lambda x: np.prod(ruptureX[:,x]), range(len(nodeline)-2))
+    logging.debug("colonnes de rupture: %s",rupX)
+    # recherche d'angles supérieurs a un seuil sur une colonne : angle entre deux vecteurs successifs
+    vecy = mat[ 1:, :, :] - mat[:-1, :, :] # vecteurs selon direction "y"
+    vy0 = vecy[:-1, :, :]                  # vecteurs amont
+    vy1 = vecy[ 1:, :, :]                  # vecteurs aval
+    e = np.einsum('ijk,ijk->ij', vy0, vy1) # produit scalaire des vecteurs
+    f = np.apply_along_axis(mydot, 2, vy0) # normes carrées vecteurs amont
+    g = np.apply_along_axis(mydot, 2, vy1) # normes carrées vecteurs aval
+    h = e/(np.sqrt(f*g))                   # cosinus
+    ruptureY = h < cosmin                  # True si angle > reference
+    logging.debug("matrice de rupture Y: \n%s",ruptureY)
+    rupY = filter(lambda x: np.prod(ruptureY[x, :]), range(len(nodelines)-2))
+    logging.debug("lignes de rupture: %s",rupY)
+    if (len(rupX)*len(rupY)) > 0:
+      logging.critical("""Cas non traité: présence d'angles vifs dans 2 directions, 
+      lors de la reconstitution des faces géométriques dans la zone remaillée""")
+    
+    mats = []
+    bordsPartages = []
+    if (len(rupX)> 0):
+      rupX.append(mat.shape[1]-1)
+      for i, index in enumerate(rupX):
+        imax = index+2
+        imin = 0
+        if i > 0:
+          imin = rupX[i-1] + 1
+        mats.append(mat[:, imin:imax, :])
+        if imax == mat.shape[1] + 1:
+          ifin = 0
+        else:
+          ifin = imax
+        bordsPartages.append([imin,ifin]) # les indices différents de 0 correspondent Ã  des bords partagés
+    elif (len(rupY)> 0):
+      rupY.append(mat.shape[0]-1)
+      for i, index in enumerate(rupY):
+        imax = index+2
+        imin = 0
+        if i > 0:
+          imin = rupY[i-1] + 1
+        mats.append(mat[imin:imax, :, :])
+        if imax == mat.shape[0] + 1:
+          ifin = 0
+        else:
+          ifin = imax
+        bordsPartages.append([imin,ifin]) # les indices différents de 0 correspondent Ã  des bords partagés
+    else:
+      mats.append(mat)
+      bordsPartages.append([0,0])         # les indices différents de 0 correspondent Ã  des bords partagés
+    
+    curvconts = []
+    for nmat, amat in enumerate(mats):
+      logging.debug("dimensions matrice %s: %s", nmat, amat.shape)
+      nbLignes = amat.shape[1] # pas de rupture, ou rupture selon des colonnes: on transpose
+      nbCols = amat.shape[0]
+      if len(rupY) > 0 :       # rupture selon des lignes: pas de transposition
+        nbLignes = amat.shape[0]
+        nbCols = amat.shape[1]
+      curves = []
+      noeudsBords = []
+      for i in range(4):
+        noeudsBords.append([])
+      k = 0
+      for i in range(nbLignes):
+        nodeList = []
+        for j in range(nbCols):
+          #logging.debug("point[%s,%s] = (%s, %s, %s)",i,j,amat[i,j,0], amat[i,j,1], amat[i,j,2])
+          if len(rupY) > 0 : # pas de transposition
+            node = geompy.MakeVertex(amat[i,j,0], amat[i,j,1], amat[i,j,2])
+          else:              # transposition
+            node = geompy.MakeVertex(amat[j,i,0], amat[j,i,1], amat[j,i,2])
+          nodeList.append(node)
+          if i == 0:
+            noeudsBords[0].append(node)
+            #name = "bord0_%d"%k
+            #geomPublish(initLog.debug,  node, name )
+          if i == (nbLignes -1):
+            noeudsBords[2].append(node)
+            #name = "bord2_%d"%k
+            #geomPublish(initLog.debug,  node, name )
+          if j == 0:
+            noeudsBords[1].append(node)
+            #name = "bord1_%d"%k
+            #geomPublish(initLog.debug,  node, name )
+          if j == (nbCols -1):
+            noeudsBords[3].append(node)
+            #name = "bord3_%d"%k
+            #geomPublish(initLog.debug,  node, name )
+            k += 1
+        curve = geompy.MakeInterpol(nodeList, False, False)
+        #name = "curve_%d"%i
+        #geomPublish(initLog.debug,  curve, name )
+        if len(curvconts) == 0 or len(curves) > 0: # Ã©liminer les doublons de la surface sans découpe 
+          curvconts.append(nodeList)
+        curves.append(curve)
+      if bordsPartages[nmat][0] :
+        bordsPartages[nmat][0] = curves[0]  # la première ligne est un bord partagé
+      else:
+        bordsPartages[nmat][0] = None
+      if bordsPartages[nmat][1] :
+        bordsPartages[nmat][1] = curves[-1] # la dernière ligne est un bord partagé
+      else:
+        bordsPartages[nmat][1] = None
+      filling = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
+      # --- test orientation filling
+      vertex = geompy.MakeVertexOnSurface(filling, 0.5, 0.5)
+      normal = geompy.GetNormal(filling, vertex)
+
+      if centreFondFiss is not None:
+        logging.debug("orientation filling a l'aide du centre de fond de fissure")
+        vecteurDefaut = geompy.MakeVector(centreFondFiss, vertex)
+        
+      if not isVecteurDefaut:
+        pointIn_x = 0.0
+        pointIn_y = 0.0
+        pointIn_z = 0.0
+        pointExplicite = False
+        if shapeFissureParams.has_key('pointIn_x'):
+          pointExplicite = True
+          pointIn_x = shapeFissureParams['pointIn_x']
+        if shapeFissureParams.has_key('pointIn_y'):
+          pointExplicite = True
+          pointIn_y = shapeFissureParams['pointIn_y']
+        if shapeFissureParams.has_key('pointIn_z'):
+          pointExplicite = True
+          pointIn_z = shapeFissureParams['pointIn_z']
+        if pointExplicite:
+          cdg = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z)
+          logging.debug("orientation filling par point intérieur %s", (pointIn_x, pointIn_y, pointIn_z))
+          vecteurDefaut = geompy.MakeVector(cdg, vertex)
+        
+      if shapeFissureParams.has_key('convexe'):
+        isConvexe = shapeFissureParams['convexe']
+        logging.debug("orientation filling par indication de convexité %s", isConvexe)
+        cdg = geompy.MakeCDG(filling)
+        if isConvexe:
+          vecteurDefaut = geompy.MakeVector(cdg, vertex)
+        else:
+          vecteurDefaut = geompy.MakeVector(vertex, cdg)
+     
+      if vecteurDefaut is not None:
+        geomPublish(initLog.debug, normal, "normFillOrig%d"%iface)
+        geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface)
+        if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
+          filling = geompy.ChangeOrientation(filling)
+      geomPublish(initLog.debug,  filling, "filling%d"%iface )
+      #geompy.ExportBREP(filling, "filling.brep")
+      iface = iface+1
+      fillings.append(filling)
+      noeuds_bords.append(noeudsBords)
+      idFilToCont.append(icont)
+      bords_Partages += bordsPartages
+      logging.debug("bords_Partages = %s", bords_Partages)
+      pass # --- loop on mats
+    # --- reconstruction des faces continues Ã  partir des listes de noeuds
+    #     les courbes doivent suivre la courbure pour Ã©viter les oscillations
+    if icont == iface - 1: # pas de découpe, on garde la même face
+      fillcont = fillings[-1]
+    else:
+      nbLignes = len(curvconts[0])
+      curves = []
+      for i in range(nbLignes):
+        nodes = [curvconts[j][i] for j in range(len(curvconts))]
+        curve = geompy.MakeInterpol(nodes, False, False)
+        curves.append(curve)
+      fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
+    geomPublish(initLog.debug,  fillcont, "filcont%d"%icont )
+    fillconts.append(fillcont)
+    icont = icont+1   
+    pass   # --- loop while there are remaining nodes
+  
+  return fillings, noeuds_bords, bords_Partages, fillconts, idFilToCont
diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py
new file mode 100644 (file)
index 0000000..6696330
--- /dev/null
@@ -0,0 +1,118 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Tue Jun 24 09:14:13 2014
+
+@author: I48174
+"""
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+import GEOM
+
+from listOfExtraFunctions import createNewMeshesFromCorner
+from listOfExtraFunctions import createLinesFromMesh
+
+# -----------------------------------------------------------------------------
+# --- groupe de quadrangles de face transformé en face géométrique par filling
+
+def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, centreFondFiss, listOfCorners):
+    """ """
+    # TODO: rédiger la docstring
+    
+    logging.info("start")
+
+    #fillings = [[], []]
+    tmpFillings = []
+    noeuds_bords = []
+    #bords_Partages = [[], []]
+    tmpBords = []
+    fillconts = []
+    idFilToCont = []
+    
+    facesNonCoupees = []
+    facesCoupees = []
+    aretesNonCoupees = []
+    aretesCoupees = []
+    
+    setOfNodes = []
+    setOfLines = []
+    listOfEdges = []
+    # On crée une liste contenant le maillage de chaque face.
+    listOfNewMeshes = createNewMeshesFromCorner(meshQuad, listOfCorners)
+    for msh in listOfNewMeshes:
+        # On crée une liste de noeuds correspondant aux faces suivant
+        # le modèle liste[face][ligne][noeud].
+        lines = createLinesFromMesh(msh, listOfCorners[0])
+        setOfNodes.append(lines)
+    
+    for face in setOfNodes:
+        tmpFace = []
+        for line in face:
+            # On possède l'information 'ID' de chaque noeud composant chaque
+            # ligne de chaque face. A partir de l'ID, on crée un vertex. Un
+            # ensemble de vertices constitue une ligne. Un ensemble de lignes
+            # constitue une face.
+            tmpCoords = [meshQuad.GetNodeXYZ(node) for node in line]
+            tmpPoints = [geompy.MakeVertex(val[0], val[1], val[2]) for val in tmpCoords]
+            line = geompy.MakeInterpol(tmpPoints, False, False)
+            tmpFace.append(line)
+        setOfLines.append(tmpFace)
+    
+    for i, face in enumerate(setOfLines):
+        # A partir des lignes de chaque face,
+        # on recrée un objet GEOM temporaire par filling.
+        filling = geompy.MakeFilling(geompy.MakeCompound(face), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
+        geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1)) 
+        tmpFillings.append(filling)
+
+    for face in setOfNodes:
+        # On prend la première ligne qui correspond aux bords partagés
+        listOfEdges.append(face[0])
+    
+    for edge in listOfEdges:
+        # On utilise les points de bords pour créer des aretes vives
+        tmpCoords = [meshQuad.GetNodeXYZ(node) for node in list(edge)]
+        tmpPoints = [geompy.MakeVertex(val[0], val[1], val[2]) for val in tmpCoords]
+        line = geompy.MakeInterpol(tmpPoints, False, False)
+        tmpBords.append(line)
+    
+    for i, filling in enumerate(tmpFillings):
+        tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0, True)
+        tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
+        tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
+        if len(tmpExplodeRef) == len(tmpExplodeNum):
+            geomPublish(initLog.debug, filling, "faceNonCoupee_{0}".format(i + 1))
+            facesNonCoupees.append(filling)
+        else:
+            geomPublish(initLog.debug, filling, "faceCoupee_{0}".format(i + 1))
+            facesCoupees.append(filling)
+    fillings = facesCoupees, facesNonCoupees
+    
+    for i, filling in enumerate(tmpBords):
+        tmpPartition = geompy.MakePartition([shapeDefaut], [filling], [], [], geompy.ShapeType["SHELL"], 0, [], 0, True)
+        tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True)
+        tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True)
+        if len(tmpExplodeRef) == len(tmpExplodeNum):
+            geomPublish(initLog.debug, filling, "areteNonCoupee_{0}".format(i + 1))
+            aretesNonCoupees.append(filling)
+        else:
+            geomPublish(initLog.debug, filling, "areteCoupee_{0}".format(i + 1))
+            aretesCoupees.append(filling)
+    bords_Partages = aretesCoupees, aretesNonCoupees
+    
+# TODO: A enlever
+#    for i, face in enumerate(setOfLines):
+#        for j, line in enumerate(face):
+#            geomPublish(initLog.debug, line, 'face{0}_ligne{1}'.format(i + 1, j + 1))
+
+ #TODO: A enlever
+#    for i, filling in enumerate(fillings[0]):
+#        geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1))
+#        for j, line in enumerate(setOfLines[i]):
+#            geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1))
+    
+    return fillings, noeuds_bords, bords_Partages, fillconts, idFilToCont
+    
\ No newline at end of file
diff --git a/src/Tools/blocFissure/gmu/restreintFaceFissure.py b/src/Tools/blocFissure/gmu/restreintFaceFissure.py
new file mode 100644 (file)
index 0000000..50e867e
--- /dev/null
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+from sortFaces import sortFaces
+
+def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
+  """
+  restriction de la face de fissure au domaine solide
+  partition face fissure Ã©tendue par fillings
+  """
+  logging.info('start')
+  partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
+  geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
+  facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
+  if pointInterne is not None:
+    distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
+    distfaces.sort()
+    logging.debug("selection de la face la plus proche du point interne, distance=%s",distfaces[0][0])
+    facesPortFissure = distfaces[0][2]
+  else:
+    facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit Ãªtre la plus grande
+    logging.debug("surfaces faces fissure Ã©tendue, min %s, max %s", minSurf, maxSurf)
+    facesPortFissure = facesPartShapeDefautSorted[-1]
+  
+  geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
+  return facesPortFissure
index 7b8ff6e476cee960d0625dfb049c504966e156c1..05e3dcbe10db1d2821891018d22779c132854a48 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 import math
 from triedreBase import triedreBase
 O, OX, OY, OZ = triedreBase()
@@ -48,9 +51,9 @@ def rotTrans(objet, orientation, point, normal, trace = False):
   logging.debug("alpha",alpha)
   logging.debug("beta",beta)
   if trace:
-    geompy.addToStudy( rot1, 'rot1' )
-    geompy.addToStudy( axe2, 'axe2' )
-    geompy.addToStudy( rot2, 'rot2' )
+    geomPublish(initLog.debug,  rot1, 'rot1' )
+    geomPublish(initLog.debug,  axe2, 'axe2' )
+    geomPublish(initLog.debug,  rot2, 'rot2' )
 
   xyz = geompy.PointCoordinates(point)
   trans = geompy.MakeTranslation(rot2, xyz[0], xyz[1], xyz[2])
index 10b125ff7240d744f09718162de38491816a7b53..f9e36ac195bd91a41f3f39357bb8473d85e4a05c 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- construction d'une shape de dectection des Ã©léments Ã  modifier suite Ã  la la duplication des noeuds de la face fissure (d'un coté de la face)
@@ -30,6 +33,6 @@ def shapeSurFissure(facesFissure):
     normal = geompy.GetNormal(face, vertex)
     extrusionFaceFissure = geompy.MakePrismVecH(facesFissure, normal, 100)
     
-  geompy.addToStudy(extrusionFaceFissure, "extrusionFaceFissure")
+  geomPublish(initLog.debug, extrusionFaceFissure, "extrusionFaceFissure")
   return extrusionFaceFissure, normal
 
index 956a8bcb895d2115d311d2c9f8740964e2a04722..f61dc28381106d83f652fc5e6edcc64c454c0ec4 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # -----------------------------------------------------------------------------
 # --- tri par longueur des 3 generatrices
@@ -36,8 +39,8 @@ def sortGeneratrices(tore, geners):
       gencnt= genx[i]
     pass
 
-  geompy.addToStudyInFather( tore, genext, 'genext' )
-  geompy.addToStudyInFather( tore, genint, 'genint' )
-  geompy.addToStudyInFather( tore, gencnt, 'gencnt' )
+  geomPublishInFather(initLog.debug, tore, genext, 'genext' )
+  geomPublishInFather(initLog.debug, tore, genint, 'genint' )
+  geomPublishInFather(initLog.debug, tore, gencnt, 'gencnt' )
 
   return genext, genint, gencnt
index 899ef5e0c6abdc12bd0a4fa6e03492e916fd87a4..12464f65d3b35abb45794a875c9f1928f4d9327f 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 import math
 from triedreBase import triedreBase
 
@@ -28,11 +31,11 @@ def toreFissure(minRad,allonge,rayTore):
   Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3)
   generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1)
 
-  #geompy.addToStudy( Vertex_1, 'Vertex_1' )
-  #geompy.addToStudy( Vertex_2, 'Vertex_2' )
-  #geompy.addToStudy( Vertex_3, 'Vertex_3' )
-  #geompy.addToStudy( Arc_1, 'Arc_1' )
-  #geompy.addToStudy( generatrice, 'generatrice' )
+  #geomPublish(initLog.debug,  Vertex_1, 'Vertex_1' )
+  #geomPublish(initLog.debug,  Vertex_2, 'Vertex_2' )
+  #geomPublish(initLog.debug,  Vertex_3, 'Vertex_3' )
+  #geomPublish(initLog.debug,  Arc_1, 'Arc_1' )
+  #geomPublish(initLog.debug,  generatrice, 'generatrice' )
 
   # --- face circulaire sur la generatrice, pour extrusion
 
@@ -41,10 +44,10 @@ def toreFissure(minRad,allonge,rayTore):
   Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0)
   FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1)
 
-  #geompy.addToStudy( Circle_1, 'Circle_1' )
-  #geompy.addToStudy( Rotation_1, 'Rotation_1' )
-  #geompy.addToStudy( Translation_1, 'Translation_1' )
-  #geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' )
+  #geomPublish(initLog.debug,  Circle_1, 'Circle_1' )
+  #geomPublish(initLog.debug,  Rotation_1, 'Rotation_1' )
+  #geomPublish(initLog.debug,  Translation_1, 'Translation_1' )
+  #geomPublish(initLog.debug,  FaceGenFiss, 'FaceGenFiss' )
 
   # --- tore extrude
 
@@ -56,14 +59,14 @@ def toreFissure(minRad,allonge,rayTore):
   Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3)
   FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1)
 
-  #geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
-  #geompy.addToStudy( Line_1, 'Line_1' )
-  #geompy.addToStudy( FaceFissure, 'FaceFissure' )
+  #geomPublishInFather(initLog.debug, generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
+  #geomPublish(initLog.debug,  Line_1, 'Line_1' )
+  #geomPublish(initLog.debug,  FaceFissure, 'FaceFissure' )
 
   # --- tore coupe en 2 demi tore de section 1/2 disque
 
   Plane_1 = geompy.MakePlane(O, OZ, 2000)
   Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
-  geompy.addToStudy(Pipe1Part , 'Pipe1Part' )
+  geomPublish(initLog.debug, Pipe1Part , 'Pipe1Part' )
 
   return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part
index ffc3a1b329aa759d4e5062bb7a95cdee2424a4e2..8113cd077eecff59ca66b848cbc0149ccb48c1bf 100644 (file)
@@ -2,6 +2,9 @@
 
 import logging
 from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
 
 # --- origine et vecteurs de base
 
@@ -23,11 +26,11 @@ def triedreBase():
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
     OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
     OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
-
+  
     if not geompy.myStudy.FindObjectByName( 'OX', geompy.ComponentDataType() ):
-      geompy.addToStudy( O, 'O' )
-      geompy.addToStudy( OX, 'OX' )
-      geompy.addToStudy( OY, 'OY' )
-      geompy.addToStudy( OZ, 'OZ' )
+      geomPublish(initLog.debug,  O, 'O' )
+      geomPublish(initLog.debug,  OX, 'OX' )
+      geomPublish(initLog.debug,  OY, 'OY' )
+      geomPublish(initLog.debug,  OZ, 'OZ' )
 
   return O, OX, OY, OZ
diff --git a/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py b/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py
new file mode 100644 (file)
index 0000000..49205e6
--- /dev/null
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+
+import logging
+
+from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
+def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau):
+  """
+  pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau
+  """
+  logging.info('start')
+  
+  j = 0
+  for face in facesInside:
+    edgesPeauFis = []
+    edgesPipeFis = []
+    edgesPipeFnd = []
+    try:
+      edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
+      edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
+      edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"])
+    except:
+      pass
+    if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
+      edgesFissExtPeau.append(edgesPeauFis[0])
+      name="edgesFissExtPeau%d"%j
+      geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
+      j += 1
+  return edgesFissExtPeau
\ No newline at end of file
index f8187ef727d57a3938cac46a7da023035784195f..24e80f8eaa93c8c4a5130b8e3e10817a70abea2e 100644 (file)
@@ -26,6 +26,8 @@ SET(plugin_SCRIPTS
   __init__.py
   fissureCoude_ihm.py
   fissureCoude_plugin.py
+  fissureGenerale_plugin.py
+  dialogFissureCoude.dic
 )
 
 # --- resources ---
@@ -41,6 +43,6 @@ PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/ihm)
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm)
 
-SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/ihm)
\ No newline at end of file
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm)
\ No newline at end of file
index 2fc5575f13addb42079fa46afa37ba35a5738762..d6ab64019b61adf67c21d6b0cbc126699514cc5e 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>826</width>
-    <height>540</height>
+    <width>959</width>
+    <height>618</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Dialog</string>
+   <string>Génération de coude avec fissure</string>
   </property>
   <layout class="QGridLayout" name="gridLayout_8">
    <item row="0" column="0">
    </item>
   </layout>
   <zorder>verticalSpacer_2</zorder>
-  <zorder>horizontalSpacer</zorder>
-  <zorder>lb_calcul</zorder>
-  <zorder>horizontalSpacer_9</zorder>
  </widget>
  <resources/>
  <connections>
index 3a25713d8ef41026cd45dac5e5b3d4c83041ae6e..d8884190069f47ec713697d42a15b49c3799c6be 100644 (file)
@@ -5,7 +5,7 @@
 # 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.
+# version 2.1 of the License.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -30,7 +30,7 @@ from blocFissure.gmu import initLog
 initLog.setVerbose()
 
 from blocFissure.gmu import geomsmesh
-from blocFissure.casStandard import casStandard
+from blocFissure.gmu.casStandard import casStandard
 
 from blocFissure.ihm.fissureCoude_ihm import fissureCoude_ihm
 
index c18b3c18dfe70c31bdb536d903509d0f75c7aece..3f2cf9c3dc997834703be0d53a4e7372a8eadf68 100644 (file)
@@ -7,34 +7,55 @@
     <x>0</x>
     <y>0</y>
     <width>631</width>
-    <height>490</height>
+    <height>560</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Dialog</string>
+   <string>Insertion de fissure dans un maillage sain</string>
   </property>
   <property name="toolTip">
    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Insertion d'un maillage de fissure dans un maillage hexaédrique sain.&lt;/p&gt;&lt;p&gt;Le maillage sain est fourni sous forme de fichier Med.&lt;/p&gt;&lt;p&gt;La face de fissure est décrite par une géométrie dans un fichier brep.&lt;/p&gt;&lt;p&gt;La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.&lt;/p&gt;&lt;p&gt;La procédure identfie des mailles saines Ã  enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone Ã  remailler en tétraèdres.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout_11">
-   <item row="0" column="0" colspan="2">
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
       <string>maillage sain et géometries de fissure</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_4">
-      <item row="0" column="0">
-       <layout class="QGridLayout" name="gridLayout">
-        <item row="0" column="0">
-         <widget class="QPushButton" name="pb_maillage">
-          <property name="toolTip">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;sélection du fichier med du maillage sain (hexaèdres)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
+      <item row="1" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QLabel" name="label">
           <property name="text">
-           <string>maillage sain</string>
+           <string>index edges fond fissure</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="le_fondfiss">
+          <property name="toolTip">
+           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Index des edges décrivant le fond de fissure, dans la face de fissure.&lt;/p&gt;&lt;p&gt;Sous forme d'une liste Python.&lt;/p&gt;&lt;p&gt;Exemples :&lt;span style=&quot; color:#00ffff;&quot;/&gt;&lt;span style=&quot; font-style:italic; color:#00ffff;&quot;&gt;[5,9]&lt;/span&gt; ou &lt;span style=&quot; font-style:italic; color:#00ffff;&quot;&gt;[3]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;(on peut récupérer ces valeurs Ã  l'aide du dialogue de création de groupes d'edges, dans GEOM)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
           </property>
          </widget>
         </item>
+        <item>
+         <spacer name="horizontalSpacer">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item row="0" column="0">
+       <layout class="QGridLayout" name="gridLayout">
         <item row="0" column="1">
          <widget class="QLineEdit" name="le_maillage">
           <property name="toolTip">
           </property>
          </widget>
         </item>
-       </layout>
-      </item>
-      <item row="1" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label">
-          <property name="text">
-           <string>index edges fond fissure</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="le_fondfiss">
+        <item row="0" column="0">
+         <widget class="QPushButton" name="pb_maillage">
           <property name="toolTip">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Index des edges décrivant le fond de fissure, dans la face de fissure.&lt;/p&gt;&lt;p&gt;Sous forme d'une liste Python.&lt;/p&gt;&lt;p&gt;Exemples :&lt;span style=&quot; color:#00ffff;&quot;/&gt;&lt;span style=&quot; font-style:italic; color:#00ffff;&quot;&gt;[5,9]&lt;/span&gt; ou &lt;span style=&quot; font-style:italic; color:#00ffff;&quot;&gt;[3]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;(on peut récupérer ces valeurs Ã  l'aide du dialogue de création de groupes d'edges, dans GEOM)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
+           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;sélection du fichier med du maillage sain (hexaèdres)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
           </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
+          <property name="text">
+           <string>maillage sain</string>
           </property>
-         </spacer>
+         </widget>
         </item>
        </layout>
       </item>
@@ -97,7 +97,7 @@
      <zorder></zorder>
     </widget>
    </item>
-   <item row="1" column="0" colspan="2">
+   <item>
     <layout class="QGridLayout" name="gridLayout_10">
      <item row="0" column="0">
       <widget class="QGroupBox" name="groupBox_2">
             <property name="toolTip">
              <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;La zone remaillée contiendra toutes les mailles du maillage sain Ã  une distance de la face de fissure inférieure Ã  cette valeur.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
             </property>
+            <property name="decimals">
+             <number>5</number>
+            </property>
            </widget>
           </item>
          </layout>
                <property name="toolTip">
                 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pour faciliter la détermination de la zone Ã  remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.&lt;/p&gt;&lt;p&gt;Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
                </property>
+               <property name="decimals">
+                <number>5</number>
+               </property>
                <property name="maximum">
                 <double>1000000.000000000000000</double>
                </property>
                <property name="toolTip">
                 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pour faciliter la détermination de la zone Ã  remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.&lt;/p&gt;&lt;p&gt;Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
                </property>
+               <property name="decimals">
+                <number>5</number>
+               </property>
                <property name="maximum">
                 <double>1000000.000000000000000</double>
                </property>
                <property name="toolTip">
                 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pipe rayonnant construit sur le fond de fissure :&lt;/p&gt;&lt;p&gt;Rayon du pipe.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
                </property>
+               <property name="decimals">
+                <number>5</number>
+               </property>
                <property name="maximum">
                 <double>1000000.000000000000000</double>
                </property>
                <property name="toolTip">
                 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pipe rayonnant construit sur le fond de fissure :&lt;/p&gt;&lt;p&gt;Longueur des mailles le long de la ligne de fond de fissure.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
                </property>
+               <property name="decimals">
+                <number>5</number>
+               </property>
                <property name="maximum">
                 <double>1000000.000000000000000</double>
                </property>
              <property name="toolTip">
               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Faces externes de la zone Ã  remailler.&lt;/p&gt;&lt;p&gt;Mailage en triangles : valeur cible des arêtes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
              </property>
+             <property name="decimals">
+              <number>5</number>
+             </property>
              <property name="maximum">
               <double>1000000.000000000000000</double>
              </property>
      </item>
     </layout>
    </item>
-   <item row="2" column="1">
+   <item>
     <spacer name="verticalSpacer_2">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
     </spacer>
    </item>
-   <item row="3" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout_5">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <spacer name="horizontalSpacer_7">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QLabel" name="lb_calcul">
+       <property name="font">
+        <font>
+         <pointsize>24</pointsize>
+        </font>
+       </property>
+       <property name="text">
+        <string>--- Calcul en cours ---</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_8">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QPushButton" name="pb_reset">
+       <property name="toolTip">
+        <string>réinitialisation de tous les paramètres Ã  leur valeur par défaut</string>
+       </property>
+       <property name="text">
+        <string>Reset</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pb_valPrec">
+       <property name="toolTip">
+        <string>réinitialisation de tous les paramètres Ã  leur valeur de la précédente Ã©xécution</string>
+       </property>
+       <property name="text">
+        <string>Précédent</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pb_recharger">
+       <property name="toolTip">
+        <string>réinitialisation des paramètres Ã  partir d'un fichier préalablement sauvegardé</string>
+       </property>
+       <property name="text">
+        <string>Recharger</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pb_sauver">
+       <property name="toolTip">
+        <string>sauvegarde des paramètres dans un fichier Ã  choisir</string>
+       </property>
+       <property name="text">
+        <string>Sauver</string>
+       </property>
+      </widget>
+     </item>
      <item>
       <spacer name="horizontalSpacer_2">
        <property name="orientation">
diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py
new file mode 100644 (file)
index 0000000..c0a2080
--- /dev/null
@@ -0,0 +1,297 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (C) 2006-2015  EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# if you already have plugins defined in a salome_plugins.py file, add this file at the end.
+# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
+
+import sys, traceback
+import math
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.gmu import geomsmesh
+from blocFissure.gmu.casStandard import casStandard
+
+def fissureGeneraleDlg(context):
+  # get context study, studyId, salomeGui
+  study = context.study
+  studyId = context.studyId
+  sg = context.sg
+  
+  import os
+  #import subprocess
+  #import tempfile
+  from PyQt4 import QtCore
+  from PyQt4 import QtGui
+  from PyQt4.QtGui import QFileDialog
+  from PyQt4.QtGui import QMessageBox
+  from PyQt4.QtGui import QPalette
+  from PyQt4.QtGui import QColor
+  from fissureGenerale_ui import Ui_Dialog
+  
+  class fissureGeneraleDialog(QtGui.QDialog):
+    
+    def __init__(self):
+      QtGui.QDialog.__init__(self)
+      # Set up the user interface from Designer.
+      self.ui = Ui_Dialog()
+      self.ui.setupUi(self)
+      
+      self.blackPalette = self.ui.dsb_influence.palette()
+      self.redPalette = QPalette()
+      self.redPalette.setColor(QPalette.Text, QColor(255,0,0))
+      self.NOK = False
+      
+      self.initDefaut()
+      self.initDialog(self.defaut)
+      self.ui.lb_calcul.hide()
+      
+      # Connect up the buttons.
+      self.connect(self.ui.pb_valPrec, QtCore.SIGNAL("clicked()"),
+                   self.readValPrec)
+      self.connect(self.ui.pb_reset, QtCore.SIGNAL("clicked()"),
+                   self.resetVal)
+      self.connect(self.ui.pb_recharger, QtCore.SIGNAL("clicked()"),
+                   self.recharger)
+      self.connect(self.ui.pb_sauver, QtCore.SIGNAL("clicked()"),
+                   self.sauver)
+      self.connect(self.ui.pb_maillage, QtCore.SIGNAL("clicked()"),
+                   self.selectMaillage)
+      self.connect(self.ui.pb_facefiss, QtCore.SIGNAL("clicked()"),
+                   self.selectFacefiss)
+      self.disconnect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"), self.accept)
+      self.connect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"),
+                   self.execute)
+    
+    def initDefaut(self):
+      self.defaut = dict(
+        nomCas            = 'angleCube',
+        maillageSain      = os.path.join(gmu.pathBloc, 'materielCasTests/CubeAngle.med'),
+        brepFaceFissure   = os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"),
+        edgeFissIds       = [4],
+        lgInfluence       = 20,
+        meshBrep          = (5,10),
+        rayonPipe         = 5,
+        lenSegPipe        = 2.5,
+        nbSegRad          = 5,
+        nbSegCercle       = 32,
+        areteFaceFissure  = 10)
+
+      
+    def initDialog(self, dico):
+      self.ui.le_maillage.setText(dico['maillageSain'])
+      self.ui.le_facefiss.setText(dico['brepFaceFissure'])
+      self.ui.le_fondfiss.setText(str(dico['edgeFissIds']))
+      self.ui.dsb_influence.setValue(dico['lgInfluence'])
+      self.ui.dsb_meshBrepMin.setValue(dico['meshBrep'][0])
+      self.ui.dsb_meshBrepMax.setValue(dico['meshBrep'][1])
+      self.ui.dsb_rayonPipe.setValue(dico['rayonPipe'])
+      self.ui.dsb_lenSegPipe.setValue(dico['lenSegPipe'])
+      self.ui.sb_couronnes.setValue(dico['nbSegRad'])
+      self.ui.sb_secteurs.setValue(dico['nbSegCercle'])
+      self.ui.dsb_areteFaceFissure.setValue(dico['areteFaceFissure'])
+      incomplet = self.testval(dico)
+      pass
+  
+    def testval(self, dico):
+      incomplet = False
+      if not os.path.lexists(dico['maillageSain']):
+        self.ui.le_maillage.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.le_maillage.setPalette(self.blackPalette)
+      if not os.path.lexists(dico['brepFaceFissure']):
+        self.ui.le_facefiss.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.le_facefiss.setPalette(self.blackPalette)
+      edgeFissIdsOK=True
+      try:
+        l = dico['edgeFissIds']
+        for i in l:
+          if not isinstance(i, int):
+            print"not isinstance(i, int)"
+            incomplet = True
+            edgeFissIdsOK=False
+            break
+      except:
+        print "except eval"
+        incomplet = True
+        edgeFissIdsOK=False
+      if edgeFissIdsOK:
+        self.ui.le_fondfiss.setPalette(self.blackPalette)
+      else:
+        self.ui.le_fondfiss.setPalette(self.redPalette)
+      if dico['meshBrep'][0] == 0:
+        self.ui.dsb_meshBrepMin.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.dsb_meshBrepMin.setPalette(self.blackPalette)
+      if dico['meshBrep'][1] == 0:
+        self.ui.dsb_meshBrepMax.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.dsb_meshBrepMax.setPalette(self.blackPalette)
+      if dico['rayonPipe'] == 0:
+        self.ui.dsb_rayonPipe.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.dsb_rayonPipe.setPalette(self.blackPalette)
+      if dico['lenSegPipe'] == 0:
+        self.ui.dsb_lenSegPipe.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.dsb_lenSegPipe.setPalette(self.blackPalette)
+      if dico['areteFaceFissure'] == 0:
+        self.ui.dsb_areteFaceFissure.setPalette(self.redPalette)
+        incomplet = True
+      else:
+        self.ui.dsb_areteFaceFissure.setPalette(self.blackPalette)
+    
+      print "incomplet: ", incomplet
+      return incomplet
+    
+    def fileDefault(self):
+      filedef = os.path.expanduser("~/.config/salome/dialogFissureGenerale.dic")
+      print filedef
+      return filedef
+    
+    def writeDefault(self, dico):
+      filedef = self.fileDefault()
+      f = open(filedef, 'w')
+      f.write(str(dico))
+      f.close()
+    
+    def readValPrec(self):
+      filedef = self.fileDefault()
+      if os.path.exists(filedef):
+        f = open(filedef, 'r')
+        txt = f.read()
+        dico = eval(txt)
+        print dico
+        self.initDialog(dico)
+
+    def resetVal(self):
+      #self.initDefaut()
+      self.initDialog(self.defaut)
+      
+    def sauver(self):
+      print "sauver"
+      fileDiag = QFileDialog(self)
+      fileDiag.setFileMode(QFileDialog.AnyFile)
+      fileDiag.setNameFilter("Parametres *.dic (*.dic)")
+      fileDiag.setViewMode(QFileDialog.List)
+      if fileDiag.exec_() :
+        fileNames = fileDiag.selectedFiles()
+        filedef = fileNames[0]
+        dico = self.creeDico()
+        f = open(filedef, 'w')
+        f.write(str(dico))
+        f.close()
+        
+    def recharger(self):
+      print "recharger"
+      fileDiag = QFileDialog(self)
+      fileDiag.setFileMode(QFileDialog.ExistingFile)
+      fileDiag.setNameFilter("Parametres *.dic (*.dic)")
+      fileDiag.setViewMode(QFileDialog.Detail)
+      if fileDiag.exec_() :
+        fileNames = fileDiag.selectedFiles()
+        filedef = fileNames[0]
+        print filedef
+        if os.path.exists(filedef):
+          f = open(filedef, 'r')
+          txt = f.read()
+          dico = eval(txt)
+          print dico
+          self.initDialog(dico)
+          
+    def selectMaillage(self):
+      fileDiag = QFileDialog(self)
+      fileDiag.setFileMode(QFileDialog.ExistingFile)
+      fileDiag.setNameFilter("Maillage *.med (*.med)")
+      fileDiag.setViewMode(QFileDialog.Detail)
+      if fileDiag.exec_() :
+        fileNames = fileDiag.selectedFiles()
+        filedef = fileNames[0]
+        print filedef
+        self.ui.le_maillage.setText(filedef)
+         
+    def selectFacefiss(self):
+      fileDiag = QFileDialog(self)
+      fileDiag.setFileMode(QFileDialog.ExistingFile)
+      fileDiag.setNameFilter("Face fissure *.brep (*.brep)")
+      fileDiag.setViewMode(QFileDialog.Detail)
+      if fileDiag.exec_() :
+        fileNames = fileDiag.selectedFiles()
+        filedef = fileNames[0]
+        print filedef
+        self.ui.le_facefiss.setText(filedef)
+         
+    def creeDico(self):
+      dico = dict(
+                  maillageSain     = str(self.ui.le_maillage.text()),
+                  brepFaceFissure  = str(self.ui.le_facefiss.text()),
+                  edgeFissIds      = eval(str(self.ui.le_fondfiss.text())),
+                  lgInfluence      = self.ui.dsb_influence.value(),
+                  meshBrep         = [self.ui.dsb_meshBrepMin.value(),self.ui.dsb_meshBrepMax.value()],
+                  rayonPipe        = self.ui.dsb_rayonPipe.value(),
+                  lenSegPipe       = self.ui.dsb_lenSegPipe.value(),
+                  nbSegRad         = self.ui.sb_couronnes.value(),
+                  nbSegCercle      = self.ui.sb_secteurs.value(),
+                  areteFaceFissure = self.ui.dsb_areteFaceFissure.value()
+                  )
+      print dico
+      return dico
+      
+    def checkValues(self):
+      return self.NOK
+
+    def execute(self):
+      dico = self.creeDico()
+      NOK = self.testval(dico)
+      if not(NOK):
+        self.writeDefault(dico)
+        self.ui.lb_calcul.show()
+        execInstance = casStandard(dico)
+      self.NOK = NOK
+      self.accept()
+    
+    pass 
+
+# ----------------------------------------------------------------------------
+                     
+  window = fissureGeneraleDialog()
+  retry = True
+  while(retry):
+    retry = False
+    window.exec_()
+    result = window.result()
+    if result:
+      # dialog accepted
+      print "dialog accepted, check"
+      retry = window.checkValues()
+    else:
+      print "dialog rejected, exit"
+  pass
+  
diff --git a/src/Tools/blocFissure/lanceurSoudureArrondieTest.py b/src/Tools/blocFissure/lanceurSoudureArrondieTest.py
new file mode 100644 (file)
index 0000000..bd91562
--- /dev/null
@@ -0,0 +1,32 @@
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+mesh = 'areteArrondieSoudure.med'
+crack = 'fissureSoudureTest.brep'
+
+dicoParams = dict(nomCas            = 'casTestCoinTriple',
+                  maillageSain      = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh),
+                  brepFaceFissure   = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack),
+                  edgeFissIds       = [4],
+                  lgInfluence       = 30,
+                  meshBrep          = (5,10),
+                  rayonPipe         = 5,
+                  lenSegPipe        = 7,
+                  nbSegRad          = 8,
+                  nbSegCercle       = 20,
+                  areteFaceFissure  = 8)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser(1)
diff --git a/src/Tools/blocFissure/lanceurSoudureViveTest.py b/src/Tools/blocFissure/lanceurSoudureViveTest.py
new file mode 100644 (file)
index 0000000..aa4d803
--- /dev/null
@@ -0,0 +1,32 @@
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+mesh = 'areteViveSoudure.med'
+crack = 'fissureSoudureTest.brep'
+
+dicoParams = dict(nomCas            = 'casTestCoinTriple',
+                  maillageSain      = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh),
+                  brepFaceFissure   = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack),
+                  edgeFissIds       = [4],
+                  lgInfluence       = 30,
+                  meshBrep          = (5,10),
+                  rayonPipe         = 10,
+                  lenSegPipe        = 7,
+                  nbSegRad          = 5,
+                  nbSegCercle       = 10,
+                  areteFaceFissure  = 10)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser(1)
diff --git a/src/Tools/blocFissure/lanceurTestAubry.py b/src/Tools/blocFissure/lanceurTestAubry.py
new file mode 100644 (file)
index 0000000..6e43111
--- /dev/null
@@ -0,0 +1,32 @@
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+mesh = 'huehue.med'
+crack = 'hue.brep'
+
+dicoParams = dict(nomCas            = 'testAubry',
+                  maillageSain      = '/local00/home/I48174/Bureau/{0}'.format(mesh),
+                  brepFaceFissure   = '/local00/home/I48174/Bureau/{0}'.format(crack),
+                  edgeFissIds       = [8],
+                  lgInfluence       = 0.01,
+                  meshBrep          = (0.0002,0.003),
+                  rayonPipe         = 0.005,
+                  lenSegPipe        = 0.0015,
+                  nbSegRad          = 8,
+                  nbSegCercle       = 18,
+                  areteFaceFissure  = 0.0015)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser(1)
index 37cc0c1666009b5768c9dc83cbfe33dce2de1275..688a815dfd16f921ef7b68fcfa8c50c510f45566 100644 (file)
@@ -23,6 +23,7 @@
 SET(plugin_SCRIPTS
   __init__.py
   cubeAngle.py
+  cubeFin.py
   decoupeCylindre.py
   disque_perce.py
   ellipse_disque.py
@@ -38,4 +39,4 @@ SET(plugin_SCRIPTS
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/materielCasTests)
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/materielCasTests)
index e596663ca6d4e07ce71b985171ebda7dc56b7013..cef66f65edf6c2557b20908fc3979d1afe4e61cc 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -35,7 +35,7 @@ Vertex_2 = geompy.MakeVertex(-5, -5, 90)
 Vertex_3 = geompy.MakeVertex(65, 65, 110)
 Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
 Common_1 = geompy.MakeCommon(Disk_1, Box_2)
-geompy.Export(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP")
+geompy.ExportBREP(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
diff --git a/src/Tools/blocFissure/materielCasTests/cubeFin.py b/src/Tools/blocFissure/materielCasTests/cubeFin.py
new file mode 100644 (file)
index 0000000..02fe243
--- /dev/null
@@ -0,0 +1,130 @@
+# -*- coding: utf-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
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+cubeFin = geompy.MakeBoxDXDYDZ(200, 200, 200)
+[DEPL,ENCASTR] = geompy.SubShapes(cubeFin, [27, 23])
+origCoin = geompy.MakeVertex(0, 160, 200)
+Disk_1 = geompy.MakeDiskPntVecR(origCoin, OY, 50)
+Translation_1 = geompy.MakeTranslation(origCoin, 0, 10, 0)
+Vector_1 = geompy.MakeVector(origCoin, Translation_1)
+Rotation_1 = geompy.MakeRotation(Disk_1, Vector_1, 90*math.pi/180.0)
+origMilieu = geompy.MakeVertex(0, 160, 100)
+Translation_2 = geompy.MakeTranslationTwoPoints(Rotation_1, origCoin, origMilieu)
+Scale_1 = geompy.MakeScaleAlongAxes(Translation_2, origMilieu, 0.984, 1, 1.2)
+Vertex_1 = geompy.MakeVertex(-10, 160, 210)
+Vertex_2 = geompy.MakeVertex(50, 160, 210)
+Vertex_3 = geompy.MakeVertex(50, 160, -10)
+Vertex_4 = geompy.MakeVertex(-10, 160, -10)
+Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2)
+Line_2 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3)
+Line_3 = geompy.MakeLineTwoPnt(Vertex_3, Vertex_4)
+Line_4 = geompy.MakeLineTwoPnt(Vertex_4, Vertex_1)
+cubeFin_Transverse = geompy.MakeFaceWires([Line_1, Line_2, Line_3, Line_4], 1)
+Vertex_5 = geompy.MakeVertex(55, 160, 100)
+Line_1_vertex_3 = geompy.GetSubShape(Line_1, [3])
+Line_3_vertex_2 = geompy.GetSubShape(Line_3, [2])
+Arc_1 = geompy.MakeArc(Line_1_vertex_3, Vertex_5, Line_3_vertex_2)
+Face_1 = geompy.MakeFaceWires([Line_1, Line_3, Line_4, Arc_1], 1)
+cubeFin_Coin = geompy.MakeCommonList([Rotation_1, Face_1], True)
+cubeFin_Milieu = geompy.MakeCommonList([Scale_1, cubeFin_Transverse], True)
+O_1 = geompy.MakeVertex(0, 0, 0)
+OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ_1 = geompy.MakeVectorDXDYDZ(0, 0, 1)
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( cubeFin, 'cubeFin' )
+geompy.addToStudyInFather( cubeFin, DEPL, 'DEPL' )
+geompy.addToStudyInFather( cubeFin, ENCASTR, 'ENCASTR' )
+geompy.addToStudy( origCoin, 'origCoin' )
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( Translation_1, 'Translation_1' )
+geompy.addToStudy( Vector_1, 'Vector_1' )
+geompy.addToStudy( Rotation_1, 'Rotation_1' )
+geompy.addToStudy( origMilieu, 'origMilieu' )
+geompy.addToStudy( Translation_2, 'Translation_2' )
+geompy.addToStudy( Scale_1, 'Scale_1' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( Line_1, 'Line_1' )
+geompy.addToStudy( Line_2, 'Line_2' )
+geompy.addToStudy( Line_3, 'Line_3' )
+geompy.addToStudy( Line_4, 'Line_4' )
+geompy.addToStudy( cubeFin_Transverse, 'cubeFin_Transverse' )
+geompy.addToStudyInFather( Line_1, Line_1_vertex_3, 'Line_1:vertex_3' )
+geompy.addToStudy( Vertex_5, 'Vertex_5' )
+geompy.addToStudyInFather( Line_3, Line_3_vertex_2, 'Line_3:vertex_2' )
+geompy.addToStudy( Arc_1, 'Arc_1' )
+geompy.addToStudy( Face_1, 'Face_1' )
+geompy.addToStudy( cubeFin_Coin, 'cubeFin_Coin' )
+geompy.addToStudy( cubeFin_Milieu, 'cubeFin_Milieu' )
+geompy.addToStudy( O_1, 'O' )
+geompy.addToStudy( OX_1, 'OX' )
+geompy.addToStudy( OY_1, 'OY' )
+geompy.addToStudy( OZ_1, 'OZ' )
+geompy.ExportBREP(cubeFin_Transverse, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep"))
+geompy.ExportBREP(cubeFin_Coin, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"))
+geompy.ExportBREP(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"))
+
+###
+### SMESH component
+###
+
+import  SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+cubeFin_1 = smesh.Mesh(cubeFin)
+Regular_1D = cubeFin_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = cubeFin_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = cubeFin_1.Hexahedron(algo=smeshBuilder.Hexa)
+isDone = cubeFin_1.Compute()
+DEPL_1 = cubeFin_1.GroupOnGeom(DEPL,'DEPL',SMESH.FACE)
+ENCASTR_1 = cubeFin_1.GroupOnGeom(ENCASTR,'ENCASTR',SMESH.FACE)
+
+## Set names of Mesh objects
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+smesh.SetName(DEPL_1, 'DEPL')
+smesh.SetName(ENCASTR_1, 'ENCASTR')
+smesh.SetName(cubeFin_1.GetMesh(), 'cubeFin')
+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(1)
index b650fb2e9691c2318ee6bf7b672ba622534154d6..6c55b0e02d1d8b2b7a3fc64b41431463a35e466e 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -62,14 +62,14 @@ FissInCylindre = geompy.MakeFaceWires([Curve_2, Arc_1], 1)
 Divided_Cylinder_1 = geompy.MakeDividedCylinder(145, 800, GEOM.SQUARE)
 CylindreSain = geompy.MakeRotation(Divided_Cylinder_1, OZ, 45*math.pi/180.0)
 [Compound_1, vertical, radial, Compound_4] = geompy.Propagate(CylindreSain)
-geompy.Export(FissInCylindre, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre.brep"), "BREP")
+geompy.ExportBREP(FissInCylindre, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre.brep"))
 Vertex_12 = geompy.MakeVertex(0, -145, 500)
 Circle_2 = geompy.MakeCircle(Vertex_12, None, 145)
 Face_1 = geompy.MakeFaceWires([Circle_2], 1)
 Vertex_13 = geompy.MakeVertex(0, 0, 500)
 Disk_1 = geompy.MakeDiskPntVecR(Vertex_13, OZ_1, 170)
 FissInCylindre2 = geompy.MakeCommon(Face_1, Disk_1)
-geompy.Export(FissInCylindre2, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep"), "BREP")
+geompy.ExportBREP(FissInCylindre2, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
index 8cf26ab68e0701fa22c104347ac175f22d2feb0c..ebb4e40fa6a7ce959f12b1a70952805d1c90bd92 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -54,7 +54,7 @@ geompy.addToStudy( Vertex_4, 'Vertex_4' )
 geompy.addToStudy( Box_1, 'Box_1' )
 geompy.addToStudy( ellipse1, 'ellipse1' )
 geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' )
-geompy.Export(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"), "BREP")
+geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"))
 
 
 if salome.sg.hasDesktop():
index 9e74ff06f763a348cf72bef2c341ccaaca2318b7..1eb504f23c1d948a4383223c6947ac50b07bffde 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -35,7 +35,7 @@ Vertex_2 = geompy.MakeVertex(98, -2, -2)
 Vertex_3 = geompy.MakeVertex(120, 2, 60)
 Box_1 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
 Ellipse_disque = geompy.MakeCommon(Box_1, Scale_1)
-geompy.Export(Ellipse_disque, os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"), "BREP")
+geompy.ExportBREP(Ellipse_disque, os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
index 742197ededd7705953fc8d338b02ab34e13949c8..4fa377ae4dd2e1904c77250aaa8d0e7eb0d826d2 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -52,7 +52,7 @@ geompy.addToStudy( Box_1, 'Box_1' )
 geompy.addToStudy( Vertex_4, 'Vertex_4' )
 geompy.addToStudy( Cut_1, 'Cut_1' )
 geompy.addToStudy( ellipse1, 'ellipse1_pb' )
-geompy.Export(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"), "BREP")
+geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"))
 
 
 if salome.sg.hasDesktop():
index 7cbff0698b4e6e436766b5098d45155132a98fd0..9098f115f54fe7c5921662c636c780503bbe8e10 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -43,7 +43,7 @@ EprouvetteCourbe = geompy.MakeCut(Common_1, Cylinder_3)
 geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
 Sketch_1 = geompy.MakeSketcherOnPlane("Sketcher:F -110.000000 85.000000:T 220.000000 0.000000:T 0.000000 75.000000:T -220.000000 0.000000:WW", geomObj_1 )
 SectionDroite = geompy.MakeFaceWires([Sketch_1], 1)
-geompy.Export(SectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep"), "BREP")
+geompy.ExportBREP(SectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
index 0a70a2685ac153a2695ae9adb3633f900bf01ad5..33199d2e50a2d01661a76be638060cb4de3703f2 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -45,8 +45,8 @@ Plane_2 = geompy.MakePlane(Vertex_1, Line_1, 2000)
 geomObj_4 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
 Sketch_2 = geompy.MakeSketcherOnPlane("Sketcher:F 0.000000 0.000000:T 120.000000 0.000000:T 0.000000 100.000000:T -120.000000 20.000000:WW", Plane_2 )
 SectionInclinee = geompy.MakeFaceWires([Sketch_2], 1)
-geompy.Export(sectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFissPb1.brep"), "BREP")
-geompy.Export(SectionInclinee, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss2.brep"), "BREP")
+geompy.ExportBREP(sectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFissPb1.brep"))
+geompy.ExportBREP(SectionInclinee, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss2.brep"))
 Vertex_2 = geompy.MakeVertex(110, -10, 200)
 Vertex_3 = geompy.MakeVertex(110, 80, 200)
 Vertex_4 = geompy.MakeVertex(-10, 80, 200)
@@ -63,8 +63,8 @@ Line_7 = geompy.MakeLineTwoPnt(Vertex_5, Vertex_6)
 Face_1_vertex_9 = geompy.GetSubShape(Face_1, [9])
 Line_8 = geompy.MakeLineTwoPnt(Vertex_6, Face_1_vertex_9)
 Face_2 = geompy.MakeFaceWires([Line_5, Line_6, Line_7, Line_8], 1)
-geompy.Export(Face_1, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep"), "BREP")
-geompy.Export(Face_2, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_2.brep"), "BREP")
+geompy.ExportBREP(Face_1, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep"))
+geompy.ExportBREP(Face_2, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_2.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
index b378fa5874c2b496d7b971446712cef332ec1837..b7e8188a5a8658b010101b09aa3c21b3e45b36bb 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -42,7 +42,9 @@ Partition_1 = geompy.MakePartition([Box_1], [Fillet_1], [], [], geompy.ShapeType
 geomObj_3 = geompy.MakeCylinderRH(1450, 8000)
 Cylinder_3 = geompy.MakeRotation(geomObj_3, OZ, 180*math.pi/180.0)
 Cut_1 = geompy.MakeCut(Partition_1, Cylinder_3)
+geompy.addToStudy( Cut_1, 'Cut_1' )
 [faceFiss1] = geompy.SubShapes(Cut_1, [61])
+geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' )
 [Vertex_3,geomObj_4] = geompy.SubShapes(faceFiss1, [4, 5])
 Cylinder_4 = geompy.MakeCylinderRH(2000, 4000)
 Cylinder_5 = geompy.MakeCylinderRH(1500, 4000)
@@ -57,7 +59,7 @@ Box_2 = geompy.MakeBoxTwoPnt(Vertex_7, Vertex_6)
 Common_1 = geompy.MakeCommon(Box_2, Cut_2)
 objetSain = geompy.MakePartition([Common_1], [Plane_1, Plane_2, Plane_3], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
 [hauteurs, epaisseurs, Compound_3, Compound_4, Compound_5, Compound_6] = geompy.Propagate(objetSain)
-geompy.Export(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep"), "BREP")
+geompy.ExportBREP(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
@@ -72,8 +74,6 @@ geompy.addToStudy( Vertex_2, 'Vertex_2' )
 geompy.addToStudy( Box_1, 'Box_1' )
 geompy.addToStudy( Partition_1, 'Partition_1' )
 geompy.addToStudy( Cylinder_3, 'Cylinder_3' )
-geompy.addToStudy( Cut_1, 'Cut_1' )
-geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' )
 geompy.addToStudyInFather( faceFiss1, Vertex_3, 'Vertex_3' )
 geompy.addToStudy( Cylinder_4, 'Cylinder_4' )
 geompy.addToStudy( Cylinder_5, 'Cylinder_5' )
index 4316681307725b50261f890875539183fcb5d7e2..9a508a5f9fbf70b5a7504a43bdc35c406e3a5a91 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -36,16 +36,18 @@ Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
 Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
 [Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
 FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
-geompy.Export(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep"), "BREP")
+geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep"))
 Vertex_2 = geompy.MakeVertex(0, -500, 0)
 Vertex_3 = geompy.MakeVertex(400, 500, 800)
 objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
 Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, 180*math.pi/180.0)
 Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+geompy.addToStudy( Partition_2, 'Partition_2' )
 [FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
+geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
 Plane_1 = geompy.MakePlaneLCS(None, 2000, 3)
 FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-geompy.Export(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP")
+geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
@@ -63,8 +65,6 @@ geompy.addToStudy( Vertex_2, 'Vertex_2' )
 geompy.addToStudy( Vertex_3, 'Vertex_3' )
 geompy.addToStudy( objetSain, 'objetSain' )
 geompy.addToStudy( Rotation_1, 'Rotation_1' )
-geompy.addToStudy( Partition_2, 'Partition_2' )
-geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
 geompy.addToStudy( Plane_1, 'Plane_1' )
 geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
 
index 919b2a16a90fed270556f0756720c2e0b32af447..24aaeffc7c292bd22cb7b62d32ece4cb58ddbbce 100644 (file)
@@ -11,3 +11,4 @@ from blocFissure.materielCasTests import ellipse_probleme
 from blocFissure.materielCasTests import disque_perce
 from blocFissure.materielCasTests import ellipse_disque
 from blocFissure.materielCasTests import vis
+from blocFissure.materielCasTests import cubeFin
index 1819a56f77eef9e3a42899cc853d59450f8bb55e..59653c93e9760e732cfdc997f7e548137d1c9fcc 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
@@ -56,11 +56,11 @@ Line_4 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3)
 coupe_vis = geompy.MakePartition([Face_1], [Line_1, Line_2, Line_3, Line_4], [], [], geompy.ShapeType["FACE"], 0, [], 0)
 [tige, section, tige_haute, rond, tete, section_tete] = geompy.Propagate(coupe_vis)
 conge = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(conge, [21])
+geompy.UnionIDs(conge, [25])
 appui = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(appui, [37])
+geompy.UnionIDs(appui, [39])
 p_imp = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(p_imp, [4])
+geompy.UnionIDs(p_imp, [11])
 
 Vertex_4 = geompy.MakeVertex(11.25, 98.75, 0)
 Vertex_5 = geompy.MakeVertexWithRef(Vertex_4, -0.5, 0.5, 0)
@@ -75,7 +75,7 @@ Partition_2 = geompy.MakePartition([Revolution_1], [conge], [], [], geompy.Shape
 Partition_2_vertex_11 = geompy.GetSubShape(Partition_2, [11])
 Plane_1 = geompy.MakePlane(Partition_2_vertex_11, OY, 2000)
 Partition_3 = geompy.MakePartition([Revolution_1], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-Vertex_9 = geompy.MakeVertex(0, 99.633883, 8.977320000000001)
+Vertex_9 = geompy.MakeVertex(0, 99.633883, 1.977320000000001)
 Vertex_10 = geompy.MakeVertex(0, 99.633883, -8.977320000000001)
 Vertex_11 = geompy.MakeVertexWithRef(Vertex_9, 0, 0, -1)
 Vertex11x = geompy.MakeVertexWithRef(Vertex_11, 1, 0, 0)
@@ -98,7 +98,7 @@ Revolution_2 = geompy.MakeRevolution2Ways(generatrice, OY, 65*math.pi/180.0)
 Fissure = geompy.MakeCommonList([Extrusion_1, Revolution_2], True)
 fondFiss = geompy.CreateGroup(Fissure, geompy.ShapeType["EDGE"])
 geompy.UnionIDs(fondFiss, [9, 7, 4])
-geompy.Export(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP")
+geompy.ExportBREP(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"))
 
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
@@ -171,31 +171,13 @@ smesh = smeshBuilder.New(theStudy)
 coupe_vis_1 = smesh.Mesh(coupe_vis)
 Regular_1D = coupe_vis_1.Segment()
 Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
-Nb_Segments_1.SetDistrType( 0 )
 Quadrangle_2D = coupe_vis_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Regular_1D_1 = coupe_vis_1.Segment(geom=tige)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(30)
+Regular_1D_2 = coupe_vis_1.Segment(geom=section)
+Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,1,[ 7, 11, 16, 23 ])
 isDone = coupe_vis_1.Compute()
-Nb_Segments_2 = smesh.CreateHypothesis('NumberOfSegments')
-Nb_Segments_2.SetNumberOfSegments( 30 )
-Nb_Segments_2.SetDistrType( 0 )
-status = coupe_vis_1.AddHypothesis(Regular_1D,tige)
-status = coupe_vis_1.AddHypothesis(Nb_Segments_2,tige)
-isDone = coupe_vis_1.Compute()
-Nb_Segments_3 = smesh.CreateHypothesis('NumberOfSegments')
-Nb_Segments_3.SetNumberOfSegments( 10 )
-Nb_Segments_3.SetScaleFactor( 3 )
-Nb_Segments_3.SetReversedEdges( [  ] )
-Nb_Segments_3.SetObjectEntry( "0:1:1:14" )
-status = coupe_vis_1.AddHypothesis(Regular_1D,section)
-status = coupe_vis_1.AddHypothesis(Nb_Segments_3,section)
-coupe_vis_1.Clear()
-isDone = coupe_vis_1.Compute()
-coupe_vis_1.Clear()
-Nb_Segments_3.SetNumberOfSegments( 10 )
-Nb_Segments_3.SetDistrType( 1 )
-Nb_Segments_3.SetScaleFactor( 3 )
-Nb_Segments_3.SetReversedEdges( [ 23, 4, 9, 16 ] )
-Nb_Segments_3.SetObjectEntry( "0:1:1:14" )
-isDone = coupe_vis_1.Compute()
+isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 )
 tige_1 = coupe_vis_1.GroupOnGeom(tige,'tige',SMESH.EDGE)
 section_1 = coupe_vis_1.GroupOnGeom(section,'section',SMESH.EDGE)
 tige_haute_1 = coupe_vis_1.GroupOnGeom(tige_haute,'tige_haute',SMESH.EDGE)
@@ -205,69 +187,62 @@ section_tete_1 = coupe_vis_1.GroupOnGeom(section_tete,'section_tete',SMESH.EDGE)
 conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE)
 appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
 p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
-isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 )
 visHex80 = smesh.CopyMesh( coupe_vis_1, 'visHex80', 1, 0)
 [ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2 ] = visHex80.GetGroups()
-[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObject2D( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), math.pi/40, 40, 1e-05 ,True)
+[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObjects( [ visHex80 ], [ visHex80 ], [ visHex80 ], SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), 0.0785398, 40, 1e-05, 1 )
 [ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top ] = visHex80.GetGroups()
-[ tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.MirrorObject( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 0, 10 ), SMESH.SMESH_MeshEditor.PLANE ,True,True)
-[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups()
-coincident_nodes_on_part = visHex80.FindCoincidentNodesOnPart( visHex80, 1e-05, [  ] )
-visHex80.MergeNodes(coincident_nodes_on_part)
-equal_elements = visHex80.FindEqualElements( visHex80 )
-visHex80.MergeElements(equal_elements)
-[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups()
-SubMesh_1 = coupe_vis_1.GetSubMesh( tige, 'SubMesh_1' )
-SubMesh_2 = coupe_vis_1.GetSubMesh( section, 'SubMesh_2' )
+Sub_mesh_1 = Regular_1D_1.GetSubMesh()
+Sub_mesh_2 = Regular_1D_2.GetSubMesh()
 visHex80.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/visSain.med"), 0, SMESH.MED_V2_2, 1 )
-
 
 ## Set names of Mesh objects
-smesh.SetName(appui_rotated, 'appui_rotated')
-smesh.SetName(p_imp_rotated, 'p_imp_rotated')
-smesh.SetName(section_tete_rotated, 'section_tete_rotated')
-smesh.SetName(conge_rotated, 'conge_rotated')
-smesh.SetName(rond_rotated, 'rond_rotated')
-smesh.SetName(tete_rotated, 'tete_rotated')
-smesh.SetName(section_rotated, 'section_rotated')
-smesh.SetName(tige_haute_rotated, 'tige_haute_rotated')
-smesh.SetName(tige_rotated, 'tige_rotated')
-smesh.SetName(SubMesh_2, 'SubMesh_2')
-smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(tige_2, 'tige')
 smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
 smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
-smesh.SetName(appui_1, 'appui')
-smesh.SetName(p_imp_1, 'p_imp')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
 smesh.SetName(coupe_vis_1.GetMesh(), 'coupe_vis')
 smesh.SetName(visHex80.GetMesh(), 'visHex80')
+smesh.SetName(p_imp_top, 'p_imp_top')
+smesh.SetName(appui_top, 'appui_top')
+smesh.SetName(conge_top, 'conge_top')
+smesh.SetName(section_tete_top, 'section_tete_top')
+smesh.SetName(tete_top, 'tete_top')
+smesh.SetName(rond_top, 'rond_top')
+smesh.SetName(tige_haute_top, 'tige_haute_top')
+smesh.SetName(section_top, 'section_top')
+smesh.SetName(tige_top, 'tige_top')
+smesh.SetName(Sub_mesh_2, 'Sub-mesh_2')
+smesh.SetName(Sub_mesh_1, 'Sub-mesh_1')
+smesh.SetName(p_imp_1, 'p_imp')
+smesh.SetName(p_imp_rotated, 'p_imp_rotated')
+smesh.SetName(appui_1, 'appui')
+smesh.SetName(appui_rotated, 'appui_rotated')
+smesh.SetName(conge_rotated, 'conge_rotated')
+smesh.SetName(section_tete_rotated, 'section_tete_rotated')
+smesh.SetName(tete_rotated, 'tete_rotated')
+smesh.SetName(rond_rotated, 'rond_rotated')
+smesh.SetName(tige_haute_rotated, 'tige_haute_rotated')
+smesh.SetName(section_rotated, 'section_rotated')
 smesh.SetName(tige_1, 'tige')
-smesh.SetName(p_imp_2, 'p_imp')
-smesh.SetName(section_1, 'section')
-smesh.SetName(appui_2, 'appui')
+smesh.SetName(tige_rotated, 'tige_rotated')
 smesh.SetName(tige_haute_1, 'tige_haute')
-smesh.SetName(conge_2, 'conge')
-smesh.SetName(rond_1, 'rond')
-smesh.SetName(section_tete_2, 'section_tete')
+smesh.SetName(section_1, 'section')
 smesh.SetName(tete_1, 'tete')
-smesh.SetName(tete_2, 'tete')
+smesh.SetName(rond_1, 'rond')
+smesh.SetName(conge_1, 'conge')
+smesh.SetName(appui_2, 'appui')
 smesh.SetName(section_tete_1, 'section_tete')
+smesh.SetName(p_imp_2, 'p_imp')
+smesh.SetName(section_tete_2, 'section_tete')
+smesh.SetName(conge_2, 'conge')
 smesh.SetName(rond_2, 'rond')
-smesh.SetName(conge_1, 'conge')
-smesh.SetName(tige_haute_2, 'tige_haute')
+smesh.SetName(tete_2, 'tete')
 smesh.SetName(section_2, 'section')
-smesh.SetName(tige_2, 'tige')
-smesh.SetName(p_imp_top, 'p_imp_top')
-smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
-smesh.SetName(conge_top, 'conge_top')
-smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
-smesh.SetName(appui_top, 'appui_top')
-smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
-smesh.SetName(tete_top, 'tete_top')
-smesh.SetName(section_tete_top, 'section_tete_top')
-smesh.SetName(tige_haute_top, 'tige_haute_top')
-smesh.SetName(rond_top, 'rond_top')
-smesh.SetName(tige_top, 'tige_top')
-smesh.SetName(section_top, 'section_top')
+smesh.SetName(tige_haute_2, 'tige_haute')
+
 
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser(1)
index 379e593d5a892dc2976b8eee896afaf9b292ff28..accf0ccb704294f8f330447acef990e3ca8cff8e 100644 (file)
@@ -656,7 +656,7 @@ std::vector<std::string> * MeshJobManager_i::_getResourceNames() {
   LOG("### resource list:");
   std::vector<std::string>* resourceNames = new std::vector<std::string>();
   if (resourceList) {
-    for (int i = 0; i < resourceList->length(); i++) {
+    for ( size_t i = 0; i < resourceList->length(); i++) {
       const char* aResourceName = (*resourceList)[i];
       resourceNames->push_back(std::string(aResourceName));
       LOG("resource["<<i<<"] = "<<aResourceName);
index e8798921d31b735624022f8f90952cd638dbde1a..330f4482d7cf183cf926d61810e24a499897066c 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 # Copyright (C) 2011-2015  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 #
 import salome_pluginsmanager
 
-from spadderPlugin import runSpadderPlugin
-from meshcut_plugin import MeshCut
-from yamsplug_plugin import YamsLct
-from MGCleanerplug_plugin import MGCleanerLct
-from blocFissure.ihm.fissureCoude_plugin import fissureCoudeDlg
+try:
+  from spadderPlugin import runSpadderPlugin
+  salome_pluginsmanager.AddFunction('PADDER mesher',
+                                    'Create a mesh with PADDER',
+                                    runSpadderPlugin)
+except:
+  salome_pluginsmanager.logger.info('ERROR: PADDER mesher plug-in is unavailable')
+  pass
 
-salome_pluginsmanager.AddFunction('PADDER mesher',
-                                  'Create a mesh with PADDER',
-                                  runSpadderPlugin)
+try:
+  from meshcut_plugin import MeshCut
+  salome_pluginsmanager.AddFunction('MeshCut',
+                                    'Cut a tetrahedron mesh by a plane',
+                                    MeshCut)
 
-salome_pluginsmanager.AddFunction('MeshCut',
-                                  'Cut a tetrahedron mesh by a plane',
-                                  MeshCut)
+except:
+  salome_pluginsmanager.logger.info('ERROR: MeshCut plug-in is unavailable')
+  pass
 
-salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt ( formerly Yams )',
-                                  'Run Yams',
-                                  YamsLct)
+try:
+  from yamsplug_plugin import YamsLct
+  salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt ( formerly Yams )',
+                                    'Run Yams',
+                                    YamsLct)
+except:
+  salome_pluginsmanager.logger.info('ERROR: MGSurfOpt (Yams) plug-in is unavailable')
+  pass
 
-salome_pluginsmanager.AddFunction('ReMesh with MGCleaner',
-                                  'Run MGCleaner',
-                                  MGCleanerLct)
+try:
+  from MGCleanerplug_plugin import MGCleanerLct
+  salome_pluginsmanager.AddFunction('ReMesh with MGCleaner',
+                                    'Run MGCleaner',
+                                    MGCleanerLct)
+except:
+  salome_pluginsmanager.logger.info('ERROR: MGCleaner plug-in is unavailable')
+  pass
 
-salome_pluginsmanager.AddFunction('Meshed Pipe with a crack',
-                                  'Create a mesh with blocFissure tool',
-                                  fissureCoudeDlg)
+try:
+  from blocFissure.ihm.fissureCoude_plugin import fissureCoudeDlg
+  salome_pluginsmanager.AddFunction('Meshed Pipe with a crack',
+                                    'Create a mesh with blocFissure tool',
+                                    fissureCoudeDlg)
+except:
+  salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable')
+  pass
+try:
+  from blocFissure.ihm.fissureGenerale_plugin import fissureGeneraleDlg
+  salome_pluginsmanager.AddFunction('Add a crack in a mesh',
+                                    'Insert a crack in an hexahedral mesh with blocFissure tool',
+                                    fissureGeneraleDlg)
+except:
+  salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable')
+  pass
 
 # ZCracks plugin requires the module EFICAS to be installed
 # thus it is first tested if this module is available before
 # adding the plugin to salome_pluginsmanager
-enable_zcracks = True
 try:
   import eficasSalome
-except:
-  enable_zcracks = False
-
-if enable_zcracks:
   from zcracks_plugin import ZcracksLct
   salome_pluginsmanager.AddFunction('Run Zcrack',
                                     'Run Zcrack',
                                     ZcracksLct)
+except:
+  salome_pluginsmanager.logger.info('ERROR: Zcrack plug-in is unavailable')
+  pass