From: eap Date: Thu, 2 Feb 2017 14:32:11 +0000 (+0300) Subject: 53935: "Add" item of sub-mesh pop-up does not work and is not documented X-Git-Tag: V8_3_0a2~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b5e94caaa397f2f5d4bf3b001d743b1525786b76;p=modules%2Fsmesh.git 53935: "Add" item of sub-mesh pop-up does not work and is not documented Rename "Add" -> "Add to Group" Show "Add" only if manual edition is enabled in Group dialog + Do not clear a sub-mesh if it's algorithm is same as a global one (SMESH_submesh.cxx) --- diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index b7208534e..da52e0783 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -109,6 +109,7 @@ SET(SMESH_RESOURCES_FILES mesh_tree_hypo.png mesh_tree_hypo_segment.png mesh_tree_hypo_volume.png + mesh_tree_hypo_cartesian.png mesh_tree_mesh.png mesh_tree_importedmesh.png mesh_tree_mesh_warn.png @@ -224,6 +225,7 @@ SET(SMESH_RESOURCES_FILES mesh_extmeth_node_offset.png mesh_extmeth_surf_offset_smooth.png mesh_extmeth_face_offset.png + mesh_quality.png ) INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA}) diff --git a/resources/mesh_quality.png b/resources/mesh_quality.png new file mode 100644 index 000000000..9a5c97464 Binary files /dev/null and b/resources/mesh_quality.png differ diff --git a/resources/mesh_tree_hypo_cartesian.png b/resources/mesh_tree_hypo_cartesian.png new file mode 100644 index 000000000..d34ea4206 Binary files /dev/null and b/resources/mesh_tree_hypo_cartesian.png differ diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 253219d0b..c7014f268 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -577,6 +577,8 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid() { NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh() GetMesh()->compactMesh(); + if ( SMESHDS_Mesh* m = dynamic_cast( GetMesh() )) // IPAL53915 + m->GetScript()->SetModified(false); // drop IsModified set in compactMesh() updateEntitiesFlags(); vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); myGrid->ShallowCopy(theGrid); diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index b297cf609..b1f562e24 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -646,7 +646,7 @@ SMESH_Hypothesis::Hypothesis_Status filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 )); filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 )); if ( SMESH_Algo * curAlgo = (SMESH_Algo*)_father->GetHypothesis( this, filter, true )) - if ( !curAlgo->NeedDiscreteBoundary() ) + if ( !curAlgo->NeedDiscreteBoundary() && curAlgo != anHyp ) algoRequiringCleaning = curAlgo; } } diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 441d71f47..31f16a61f 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3853,7 +3853,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" ); createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" ); createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" ); - createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" ); + createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" ); createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" ); createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" ); createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER"); @@ -3866,8 +3866,8 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpIntersectGroups, "INT_GROUP", "ICON_INTERSECT" ); createSMESHAction( SMESHOp::OpCutGroups, "CUT_GROUP", "ICON_CUT" ); createSMESHAction( SMESHOp::OpGroupUnderlyingElem, "UNDERLYING_ELEMS", "ICON_UNDERLYING_ELEMS" ); - createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD" ); - createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE" ); + createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD_TO_GROUP" ); + createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE_FROM_GROUP" ); createSMESHAction( SMESHOp::OpDeleteGroup, "DEL_GROUP", "ICON_DEL_GROUP" ); createSMESHAction( SMESHOp::OpMeshInformation , "ADV_INFO", "ICON_ADV_INFO" ); //createSMESHAction( SMESHOp::OpStdInfo, "STD_INFO", "ICON_STD_INFO" ); @@ -3901,7 +3901,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpBareBorderVolume, "BARE_BORDER_VOLUME", "ICON_BARE_BORDER_VOLUME", 0, true ); createSMESHAction( SMESHOp::OpOverConstrainedVolume, "OVER_CONSTRAINED_VOLUME", "ICON_OVER_CONSTRAINED_VOLUME", 0, true ); createSMESHAction( SMESHOp::OpEqualVolume, "EQUAL_VOLUME", "ICON_EQUAL_VOLUME", 0, true ); - createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY" ); + createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY", "ICON_OVL_MESH_QUALITY" ); createSMESHAction( SMESHOp::OpNode, "NODE", "ICON_DLG_NODE" ); createSMESHAction( SMESHOp::OpElem0D, "ELEM0D", "ICON_DLG_ELEM0D" ); @@ -4441,8 +4441,8 @@ void SMESHGUI::initialize( CAM_Application* app ) // popup for viewer createPopupItem( SMESHOp::OpEditGroup, View, group ); - createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems ); - createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems ); + createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems, "&& guiState = 800" ); + createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems, "&& guiState = 800" ); popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpUpdate, View, mesh_part ); diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 1cf6e353b..92a51bf56 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -115,6 +115,7 @@ public : void ResetState(); void SetState( int ); + int GetState() const { return myState; } bool DefineDlgPosition( QWidget*, int&, int& ); void switchToOperation( int ); diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index ea5c5fe03..c7d806b7d 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -444,7 +444,6 @@ void SMESHGUI_GroupDlg::initDialog( bool create) /* Init selection */ mySMESHGUI->SetActiveDialogBox(this); - mySMESHGUI->SetState(800); SalomeApp_Study* aStudy = dynamic_cast( mySMESHGUI->application()->activeStudy() ); mySelectionMode = grpNoSelection; @@ -1609,6 +1608,8 @@ void SMESHGUI_GroupDlg::onSelectAll() mySortBtn->setEnabled ( !noElemsModif ); mySelectBox->setEnabled ( !noElemsModif ); myAllowElemsModif->setEnabled( !mySelectAll->isChecked() ); + if ( noElemsModif ) mySMESHGUI->ResetState(); + else mySMESHGUI->SetState(800); int selMode = mySelectionMode; mySelectionMode = grpNoSelection; @@ -2332,9 +2333,9 @@ void SMESHGUI_GroupDlg::enterEvent (QEvent*) setEnabled(true); mySelectionMode = grpNoSelection; setSelectionMode(myTypeId); - //mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox(this); - mySMESHGUI->SetState(800); + if ( mySelectBox->isEnabled() ) mySMESHGUI->SetState(800); + else mySMESHGUI->ResetState(); } } diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 757238eab..2cf05756e 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -28,11 +28,12 @@ // SMESH includes #include "SMESHGUI_Selection.h" -#include "SMESHGUI_Utils.h" -#include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_GEOMGenUtils.h" +#include "SMESHGUI.h" #include "SMESHGUI_ComputeDlg.h" #include "SMESHGUI_ConvToQuadOp.h" +#include "SMESHGUI_GEOMGenUtils.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_VTKUtils.h" #include #include @@ -142,6 +143,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const else if ( p=="hasChildren") val = QVariant( hasChildren( ind ) ); else if ( p=="nbChildren") val = QVariant( nbChildren( ind ) ); else if ( p=="isContainer") val = QVariant( isContainer( ind ) ); + else if ( p=="guiState") val = QVariant( guiState() ); if ( val.isValid() ) return val; @@ -775,6 +777,16 @@ bool SMESHGUI_Selection::isImported( const int ind ) const return res; } +//======================================================================= +//function : guiState +//purpose : +//======================================================================= + +int SMESHGUI_Selection::guiState() +{ + return SMESHGUI::GetSMESHGUI() ? SMESHGUI::GetSMESHGUI()->GetState() : -1; +} + //======================================================================= //function : groupType //purpose : diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index c7b7915ab..5847126f7 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -87,7 +87,8 @@ public: static int type( const QString&, _PTR(Study) ); static QString typeName( const int ); - + static int guiState(); + bool isImported( const int ) const; private: diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index a0c988e6c..fde04d78c 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -39,6 +39,10 @@ ICON_COMPUTE mesh_compute.png + + ICON_OVL_MESH_QUALITY + mesh_quality.png + ICON_EVALUATE mesh_evaluate.png diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 5d052e3dd..ec5537169 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -384,6 +384,22 @@ MEN_DEL_GROUP Delete Groups with Contents + + MEN_ADD_TO_GROUP + Add to Group + + + MEN_REMOVE_FROM_GROUP + Remove from Group + + + STB_ADD_TO_GROUP + Add selected elements to group + + + STB_REMOVE_FROM_GROUP + Remove selected elements from group + MEN_FACE_ORIENTATION Orientation of Faces diff --git a/src/StdMeshersGUI/StdMeshers_images.ts b/src/StdMeshersGUI/StdMeshers_images.ts index fc618a74f..5957a63ad 100644 --- a/src/StdMeshersGUI/StdMeshers_images.ts +++ b/src/StdMeshersGUI/StdMeshers_images.ts @@ -175,6 +175,10 @@ ICON_SMESH_TREE_HYPO_Arithmetic1D mesh_tree_hypo_length.png + + ICON_SMESH_TREE_HYPO_CartesianParameters3D + mesh_tree_hypo_cartesian.png + ICON_SMESH_TREE_HYPO_Geometric1D mesh_tree_hypo_length.png