]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
53935: "Add" item of sub-mesh pop-up does not work and is not documented
authoreap <eap@opencascade.com>
Thu, 2 Feb 2017 14:32:11 +0000 (17:32 +0300)
committereap <eap@opencascade.com>
Thu, 2 Feb 2017 14:32:11 +0000 (17:32 +0300)
    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)

13 files changed:
resources/CMakeLists.txt
resources/mesh_quality.png [new file with mode: 0644]
resources/mesh_tree_hypo_cartesian.png [new file with mode: 0644]
src/OBJECT/SMESH_Object.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_Selection.h
src/SMESHGUI/SMESH_images.ts
src/SMESHGUI/SMESH_msg_en.ts
src/StdMeshersGUI/StdMeshers_images.ts

index b7208534e303d6da8d31724bfde8b717ae2e0e12..da52e07836d4198b4fabc59d36fcea51f54c1780 100755 (executable)
@@ -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 (file)
index 0000000..9a5c974
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 (file)
index 0000000..d34ea42
Binary files /dev/null and b/resources/mesh_tree_hypo_cartesian.png differ
index 253219d0b2b565a1466f7d4eb66823d0e3259ec0..c7014f268ac10d11a5683586aecff77c9694c0fa 100644 (file)
@@ -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<SMESHDS_Mesh*>( GetMesh() )) // IPAL53915
+      m->GetScript()->SetModified(false); // drop IsModified set in compactMesh()
     updateEntitiesFlags();
     vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
     myGrid->ShallowCopy(theGrid);
index b297cf60945552487f4f9a0c72e7e98ebff68bc3..b1f562e24214c2c522ced80a1f9c96768714f586 100644 (file)
@@ -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;
     }
   }
index 441d71f47c98e41f0047c88aa84d16d40b17a205..31f16a61f7bf2468e1c5d30ec3549290f5266c6b 100644 (file)
@@ -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 );
index 1cf6e353b9102a2832d14363983e8cddf24d0820..92a51bf56bb073f03f6c8a6dec22384d713d0f44 100644 (file)
@@ -115,6 +115,7 @@ public :
 
   void                            ResetState();
   void                            SetState( int );
+  int                             GetState() const { return myState; }
   bool                            DefineDlgPosition( QWidget*, int&, int& );
   void                            switchToOperation( int );
 
index ea5c5fe03781907c56d462672127e189e23070cf..c7d806b7da09362543e0ff236a00ef96c5072eb5 100644 (file)
@@ -444,7 +444,6 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
 
   /* Init selection */
   mySMESHGUI->SetActiveDialogBox(this);
-  mySMESHGUI->SetState(800);
 
   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( 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();
   }
 }
 
index 757238eab9af524f9f3240ebd82fe8b8fa7b9cb5..2cf05756e7480781cc7be8c15a5fabcb9d9a35b0 100644 (file)
 // 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 <SMESH_Type.h>
 #include <SMESH_Actor.h>
@@ -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  : 
index c7b7915abf5628b1dc082009de09b9f6d8a12e4c..5847126f746d57ddcd01a7a562d0b5122b104ef0 100644 (file)
@@ -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:
index a0c988e6c11c36ef49c160a5ad539f8f33255856..fde04d78c00dff0795c0639ed7e9bb84c04ea338 100644 (file)
             <source>ICON_COMPUTE</source>
             <translation>mesh_compute.png</translation>
         </message>
+        <message>
+            <source>ICON_OVL_MESH_QUALITY</source>
+            <translation>mesh_quality.png</translation>
+        </message>
         <message>
             <source>ICON_EVALUATE</source>
             <translation>mesh_evaluate.png</translation>
index 5d052e3dd296932b0c7a220c48ad1d9b49c0e717..ec5537169aa316a1538b9125f80885d8110c8155 100644 (file)
         <source>MEN_DEL_GROUP</source>
         <translation>Delete Groups with Contents</translation>
     </message>
+    <message>
+        <source>MEN_ADD_TO_GROUP</source>
+        <translation>Add to Group</translation>
+    </message>
+    <message>
+        <source>MEN_REMOVE_FROM_GROUP</source>
+        <translation>Remove from Group</translation>
+    </message>
+    <message>
+        <source>STB_ADD_TO_GROUP</source>
+        <translation>Add selected elements to group</translation>
+    </message>
+    <message>
+        <source>STB_REMOVE_FROM_GROUP</source>
+        <translation>Remove selected elements from group</translation>
+    </message>
     <message>
         <source>MEN_FACE_ORIENTATION</source>
         <translation>Orientation of Faces</translation>
index fc618a74fb172f6c2a7c9cde20c961f3cd7a8c09..5957a63ad08c50c6d127314f0fbd0cdeda715001 100644 (file)
             <source>ICON_SMESH_TREE_HYPO_Arithmetic1D</source>
             <translation>mesh_tree_hypo_length.png</translation>
         </message>
+        <message>
+            <source>ICON_SMESH_TREE_HYPO_CartesianParameters3D</source>
+            <translation>mesh_tree_hypo_cartesian.png</translation>
+        </message>
         <message>
             <source>ICON_SMESH_TREE_HYPO_Geometric1D</source>
             <translation>mesh_tree_hypo_length.png</translation>