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 b720853..da52e07 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 253219d..c7014f2 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 b297cf6..b1f562e 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 441d71f..31f16a6 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 1cf6e35..92a51bf 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 ea5c5fe..c7d806b 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 757238e..2cf0575 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;
@@ -776,6 +778,16 @@ bool SMESHGUI_Selection::isImported( const int ind ) const
 }
 
 //=======================================================================
+//function : guiState
+//purpose  : 
+//=======================================================================
+
+int SMESHGUI_Selection::guiState()
+{
+  return SMESHGUI::GetSMESHGUI() ? SMESHGUI::GetSMESHGUI()->GetState() : -1;
+}
+
+//=======================================================================
 //function : groupType
 //purpose  : 
 //=======================================================================
index c7b7915..5847126 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 a0c988e..fde04d7 100644 (file)
             <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>
         </message>
index 5d052e3..ec55371 100644 (file)
         <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>
     </message>
index fc618a7..5957a63 100644 (file)
             <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>
         </message>