From e2ed82ab76826fe71cb635add1926e389c2fff9f Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 29 Mar 2017 14:05:00 +0300 Subject: [PATCH] Fix SIGSEGV at SALOME termination after performing SALOME_TESTS/Grids/smesh/imps_05/F0 --- doc/salome/gui/SMESH/input/skew.doc | 4 ++-- resources/CMakeLists.txt | 2 ++ resources/mesh_hide.png | Bin 0 -> 344 bytes resources/mesh_show.png | Bin 0 -> 3184 bytes src/SMESH/SMESH_Gen.cxx | 26 ++++++++++++++++++--- src/SMESH/SMESH_Hypothesis.cxx | 35 ++++++++++++++-------------- src/SMESHGUI/SMESHGUI.cxx | 4 ++-- src/SMESHGUI/SMESH_images.ts | 8 +++++++ src/SMESHUtils/SMESH_TypeDefs.hxx | 1 + 9 files changed, 56 insertions(+), 24 deletions(-) create mode 100644 resources/mesh_hide.png create mode 100644 resources/mesh_show.png diff --git a/doc/salome/gui/SMESH/input/skew.doc b/doc/salome/gui/SMESH/input/skew.doc index 036c70d83..01f3c5fea 100644 --- a/doc/salome/gui/SMESH/input/skew.doc +++ b/doc/salome/gui/SMESH/input/skew.doc @@ -3,8 +3,8 @@ \page skew_page Skew \n \b Skew mesh quality criterion reflects the angle between the lines -that join opposite sides of a quadrangle element or the greatesr angle -between three medians in triangle elements. This mesh quality +that join opposite sides of a quadrangle element or the greatest angle +between a median and a midline in a triangle element. This mesh quality criterion can be applied to elements composed of 4 and 3 nodes (quadrangles and triangles). diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index da52e0783..d2801c905 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -226,6 +226,8 @@ SET(SMESH_RESOURCES_FILES mesh_extmeth_surf_offset_smooth.png mesh_extmeth_face_offset.png mesh_quality.png + mesh_show.png + mesh_hide.png ) INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA}) diff --git a/resources/mesh_hide.png b/resources/mesh_hide.png new file mode 100644 index 0000000000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&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde00d`2O+f$vv5tKEQIh}w03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(` z>RI+y?e7jKeZ#YO-C0gXvSK~#9!?32H1T5%M`Ki`)aoA??DLPdmPL;{8U5JB8J z6oSptq2SQXRsRA92f+sp6&DwW{sBVVk_=|fkPs4HG(#Xr+oUvvXxdt};iTkj}r(4)PpGp{a%yy$3xuCaXOz)_%`^tZ6=dZx~@~HRAh7m z!!X3_^%99h6u_I+9X=ecGiaI&hJtlZ(=Hy5|78j*0GJ=U;^9s4$bxuO;fyj z=4ErEOrz1DR;!KDP}i%R&*x=t|A5`vTNs-}h8Awu6b}24h5303g~A_Es{g;hj{yL# WTb=;+;gt>m0000::iterator i_sc = _mapStudyContext.begin(); for ( ; i_sc != _mapStudyContext.end(); ++i_sc ) { - delete i_sc->second->myDocument; - delete i_sc->second; - } + StudyContextStruct* context = i_sc->second; + std::map < int, SMESH_Hypothesis * >::iterator i_hyp = context->mapHypothesis.begin(); + for ( ; i_hyp != context->mapHypothesis.end(); ++i_hyp ) + { + if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second )) + h->NullifyGen(); + } + delete context->myDocument; + delete context; + } } //============================================================================= diff --git a/src/SMESH/SMESH_Hypothesis.cxx b/src/SMESH/SMESH_Hypothesis.cxx index 2d1e10c16..c4107fb38 100644 --- a/src/SMESH/SMESH_Hypothesis.cxx +++ b/src/SMESH/SMESH_Hypothesis.cxx @@ -25,20 +25,18 @@ // Author : Paul RASCLE, EDF // Module : SMESH // -#include "SMESH_Hypothesis.hxx" -#include "SMESHDS_Mesh.hxx" #include "SMESH_Gen.hxx" -#include "SMESH_Mesh.hxx" -#include "SMESH_subMesh.hxx" -#include "utilities.h" +#include "SMESHDS_Mesh.hxx" +#include "SMESH_Hypothesis.hxx" +#include "SMESH_Mesh.hxx" using namespace std; //============================================================================= /*! - * + * */ //============================================================================= @@ -63,8 +61,11 @@ SMESH_Hypothesis::SMESH_Hypothesis(int hypId, SMESH_Hypothesis::~SMESH_Hypothesis() { - StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId); - myStudyContext->mapHypothesis[_hypId] = 0; + if ( _gen ) + { + StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId); + myStudyContext->mapHypothesis[_hypId] = 0; + } } //============================================================================= @@ -77,20 +78,20 @@ int SMESH_Hypothesis::GetDim() const { int dim = 0; switch (_type) - { - 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; - } + { + 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; + } return dim; } //============================================================================= /*! - * + * */ //============================================================================= diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 0f08808d0..526b6c650 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4020,8 +4020,8 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpPropertiesArea, "MEASURE_AREA", "ICON_MEASURE_AREA" ); createSMESHAction( SMESHOp::OpPropertiesVolume, "MEASURE_VOLUME", "ICON_MEASURE_VOLUME" ); - createSMESHAction( SMESHOp::OpHide, "HIDE" ); - createSMESHAction( SMESHOp::OpShow, "SHOW" ); + createSMESHAction( SMESHOp::OpHide, "HIDE", "ICON_HIDE" ); + createSMESHAction( SMESHOp::OpShow, "SHOW", "ICON_SHOW" ); createSMESHAction( SMESHOp::OpShowOnly, "DISPLAY_ONLY" ); createSMESHAction( SMESHOp::OpSortChild, "SORT_CHILD_ITEMS" ); diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index fde04d78c..9531e409f 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -631,5 +631,13 @@ ICON_MEASURE_BND_BOX mesh_bounding_box.png + + ICON_SHOW + mesh_show.png + + + ICON_HIDE + mesh_hide.png + diff --git a/src/SMESHUtils/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx index 77c095cc1..c9be990f6 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -169,6 +169,7 @@ struct SMESH_TNodeXYZ : public gp_XYZ double SquareDistance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).SquareModulus(); } bool operator==(const SMESH_TNodeXYZ& other) const { return _node == other._node; } }; +typedef SMESH_TNodeXYZ SMESH_NodeXYZ; //-------------------------------------------------- /*! -- 2.39.2