Salome HOME
Merge remote-tracking branch 'origin/V9_5_BR'
authoreap <eap@opencascade.com>
Fri, 10 Jul 2020 16:33:14 +0000 (19:33 +0300)
committereap <eap@opencascade.com>
Fri, 10 Jul 2020 16:33:14 +0000 (19:33 +0300)
Conflicts:
src/SMESH_I/SMESH_Mesh_i.cxx

17 files changed:
CMakeLists.txt
resources/CMakeLists.txt
resources/mesh_auto_colors.png [new file with mode: 0644]
resources/mesh_compute_error.png [new file with mode: 0644]
resources/mesh_export.png [new file with mode: 0644]
src/SMDS/chrono.cxx
src/SMDS/chrono.hxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.h
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/SMESHGUI/SMESHGUI_Operations.h
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_Selection.h
src/SMESHGUI/SMESH_images.ts
src/SMESHGUI/SMESH_msg_en.ts
src/SMESH_I/SMESH_Mesh_i.cxx

index 2dd08cb4087c6074b9f490f9a76d87e7288938af..6e6839abd3aeef2b325a8e7fba5c51fef88879ea 100644 (file)
@@ -31,7 +31,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 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)
 
 # Common CMake macros
 # ===================
index e6d26d4e422131d9b86ee66e7b1580cd4ab5d32a..fe0d107fb5e685da12fc84f2624e8c2b0b2bcea5 100644 (file)
@@ -44,6 +44,7 @@ SET(SMESH_RESOURCES_FILES
   mesh_area.png
   mesh_aspect.png
   mesh_aspect_3d.png
+  mesh_auto_colors.png
   mesh_ball.png
   mesh_biquad_quadrangle.png
   mesh_biquad_triangle.png
@@ -53,6 +54,7 @@ SET(SMESH_RESOURCES_FILES
   mesh_choose_all.png
   mesh_clear.png
   mesh_compute.png
+  mesh_compute_error.png
   mesh_conv_to_quad.png
   mesh_cutGroups.png
   mesh_cutquad.png
@@ -71,6 +73,7 @@ SET(SMESH_RESOURCES_FILES
   mesh_equal_node.png
   mesh_equal_volume.png
   mesh_evaluate.png
+  mesh_export.png
   mesh_extmeth_face_offset.png
   mesh_extmeth_node_offset.png
   mesh_extmeth_surf_offset_smooth.png
diff --git a/resources/mesh_auto_colors.png b/resources/mesh_auto_colors.png
new file mode 100644 (file)
index 0000000..7c4dc29
Binary files /dev/null and b/resources/mesh_auto_colors.png differ
diff --git a/resources/mesh_compute_error.png b/resources/mesh_compute_error.png
new file mode 100644 (file)
index 0000000..0cea548
Binary files /dev/null and b/resources/mesh_compute_error.png differ
diff --git a/resources/mesh_export.png b/resources/mesh_export.png
new file mode 100644 (file)
index 0000000..3b0d820
Binary files /dev/null and b/resources/mesh_export.png differ
index ae198d95f993638e0d28b436c660fa2a275eb55b..c4ad47ec40c4b01758ac9f5a043783e734275d7e 100644 (file)
@@ -21,6 +21,7 @@
 #include "utilities.h"
 
 using namespace std;
+using namespace SMDS;
 
 cntStruct* counters::_ctrs = 0;
 int counters::_nbChrono = 0;
index 3fdae2eb22a3132fd07993bf74ba2c127d555a15..032ac935c2f8ad8b1f8737173f0c80b69ae06771 100644 (file)
@@ -27,6 +27,8 @@
 #include <iostream>
 #include <ctime>
 
+namespace SMDS
+{
 typedef struct acnt
 {
   char*  _ctrNames;
@@ -57,9 +59,11 @@ protected:
   int _ctr;
   clock_t _start, _end;
 };
-
+}
 #ifdef CHRONODEF
-#define CHRONO(i) counters::_ctrs[i]._ctrNames = (char *)__FILE__; \
+#define CHRONO(i)
+  using namespace SMDS; \
+  counters::_ctrs[i]._ctrNames = (char *)__FILE__;  \
   counters::_ctrs[i]._ctrLines = __LINE__; \
   salome_chrono aChrono##i(i);
 
@@ -67,7 +71,7 @@ protected:
 
 #else  // CHRONODEF
 
-#define CHRONO(i)
+#define CHRONO(i) using namespace SMDS;
 #define CHRONOSTOP(i)
 
 #endif // CHRONODEF
index 28862787daa3b8614bb156b8678091824669913e..f638d0391b8722e5ca7be3470c7fdd2a7d138a2b 100644 (file)
@@ -2870,8 +2870,24 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case SMESHOp::OpComputeSubMesh:
   case SMESHOp::OpPreCompute:
   case SMESHOp::OpEvaluate:
+  case SMESHOp::OpShowErrors:
     startOperation( theCommandID );
     break;
+  case SMESHOp::OpRecompute:
+    {
+      if ( isStudyLocked() )
+        break;
+      SALOME_ListIO selected;
+      if ( LightApp_SelectionMgr *sel = selectionMgr() )
+        sel->selectedObjects( selected );
+      if ( selected.Extent() == 1 ) {
+        SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( selected.First() );
+        if ( !aMesh->_is_nil() )
+          aMesh->Clear();
+        startOperation( SMESHOp::OpCompute );
+      }
+    }
+    break;
   case SMESHOp::OpCopyMesh:
     {
       if (isStudyLocked()) break;
@@ -3998,7 +4014,7 @@ void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QStr
   if ( !icon_id.isEmpty() )
     pix = resMgr->loadPixmap( "SMESH", tr( icon_id.toLatin1().data() ) );
   else
-    pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data() ), false );
+    pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICON_%1" ).arg( po_id ).toLatin1().data() ), false );
   if ( !pix.isNull() )
     icon = QIcon( pix );
 
@@ -4105,7 +4121,9 @@ void SMESHGUI::initialize( CAM_Application* app )
   createSMESHAction( SMESHOp::OpCopyMesh,             "COPY_MESH",               "ICON_COPY_MESH" );
   createSMESHAction( SMESHOp::OpCompute,              "COMPUTE",                 "ICON_COMPUTE" );
   createSMESHAction( SMESHOp::OpComputeSubMesh,       "COMPUTE_SUBMESH",         "ICON_COMPUTE" );
+  createSMESHAction( SMESHOp::OpRecompute,            "RE_COMPUTE",              "ICON_COMPUTE" );
   createSMESHAction( SMESHOp::OpPreCompute,           "PRECOMPUTE",              "ICON_PRECOMPUTE" );
+  createSMESHAction( SMESHOp::OpShowErrors,           "SHOW_ERRORS",             "ICON_SHOW_ERRORS" );
   createSMESHAction( SMESHOp::OpEvaluate,             "EVALUATE",                "ICON_EVALUATE" );
   createSMESHAction( SMESHOp::OpMeshOrder,            "MESH_ORDER",              "ICON_MESH_ORDER");
   createSMESHAction( SMESHOp::OpCreateGroup,          "CREATE_GROUP",            "ICON_CREATE_GROUP" );
@@ -4659,20 +4677,22 @@ void SMESHGUI::initialize( CAM_Application* app )
     hasVolumes("({'Volume'} in elemTypes)"),
     hasFacesOrVolumes("(({'Face'} in elemTypes) || ({'Volume'} in elemTypes)) ");
 
-  createPopupItem( SMESHOp::OpFileInformation,   OB, mesh, "&& selcount=1 && isImported" );
-  createPopupItem( SMESHOp::OpCreateSubMesh,     OB, mesh, "&& hasGeomReference");
   createPopupItem( SMESHOp::OpEditMesh,          OB, mesh, "&& selcount=1" );
+  createPopupItem( SMESHOp::OpCreateSubMesh,     OB, mesh, "&& hasGeomReference");
+  createPopupItem( SMESHOp::OpMeshOrder,         OB, mesh, "&& selcount=1 && hasAlgo && hasGeomReference" );
   createPopupItem( SMESHOp::OpEditSubMesh,       OB, subMesh, "&& selcount=1 && hasGeomReference" );
   createPopupItem( SMESHOp::OpEditGroup,         OB, group );
   createPopupItem( SMESHOp::OpEditGeomGroupAsGroup, OB, group, "&& groupType != 'Group'" );
 
   popupMgr()->insert( separator(), -1, 0 );
-  createPopupItem( SMESHOp::OpCompute,           OB, mesh, "&& selcount=1 && isComputable" );
-  createPopupItem( SMESHOp::OpComputeSubMesh,    OB, subMesh, "&& selcount=1 && isComputable" );
-  createPopupItem( SMESHOp::OpPreCompute,        OB, mesh, "&& selcount=1 && isPreComputable" );
-  createPopupItem( SMESHOp::OpEvaluate,          OB, mesh, "&& selcount=1 && isComputable" );
-  createPopupItem( SMESHOp::OpMeshOrder,         OB, mesh, "&& selcount=1 && isComputable && hasGeomReference" );
-  createPopupItem( SMESHOp::OpUpdate,            OB, mesh_part );
+  createPopupItem( SMESHOp::OpCompute,           OB, mesh, "&& selcount=1 && hasAlgo && isComputable" );
+  createPopupItem( SMESHOp::OpRecompute,         OB, mesh, "&& selcount=1 && hasAlgo && " + isNotEmpty );
+  createPopupItem( SMESHOp::OpShowErrors,        OB, mesh, "&& selcount=1 && hasErrors" );
+  createPopupItem( SMESHOp::OpComputeSubMesh,    OB, subMesh, "&& selcount=1 && hasAlgo && isComputable" );
+  createPopupItem( SMESHOp::OpPreCompute,        OB, mesh, "&& selcount=1 && hasAlgo && isPreComputable" );
+  createPopupItem( SMESHOp::OpEvaluate,          OB, mesh, "&& selcount=1 && hasAlgo && isComputable" );
+  popupMgr()->insert( separator(), -1, 0 );
+  createPopupItem( SMESHOp::OpFileInformation,   OB, mesh, "&& selcount=1 && isImported" );
   createPopupItem( SMESHOp::OpMeshInformation,   OB, mesh_part );
   createPopupItem( SMESHOp::OpFindElementByPoint,OB, mesh_group, "&& selcount=1" );
   createPopupItem( SMESHOp::OpOverallMeshQuality,OB, mesh_part );
@@ -4686,8 +4706,8 @@ void SMESHGUI::initialize( CAM_Application* app )
   popupMgr()->insert( separator(), -1, 0 );
   createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh );
   createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2");
-  popupMgr()->insert( separator(), -1, 0 );
-  createPopupItem( SMESHOp::OpClearMesh,              OB, mesh );
+  //popupMgr()->insert( separator(), -1, 0 );
+
   //popupMgr()->insert( separator(), -1, 0 );
 
   QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
@@ -4695,6 +4715,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   QString only_one_2D        = only_one_non_empty + " && dim>1";
 
   int anId = popupMgr()->insert( tr( "MEN_EXPORT" ), -1, -1 );        // EXPORT submenu
+  popupMgr()->findMenu( anId )->menuAction()->setIcon( resourceMgr()->loadPixmap( "SMESH", tr( "ICON_EXPORT" )));
   createPopupItem( SMESHOp::OpPopupExportMED,  OB, mesh_group, multiple_non_empty, anId );
   createPopupItem( SMESHOp::OpPopupExportUNV,  OB, mesh_group, only_one_non_empty, anId );
   createPopupItem( SMESHOp::OpPopupExportSTL,  OB, mesh_group, only_one_2D, anId );
@@ -4704,8 +4725,6 @@ void SMESHGUI::initialize( CAM_Application* app )
   createPopupItem( SMESHOp::OpPopupExportSAUV, OB, mesh_group, only_one_non_empty, anId );
   createPopupItem( SMESHOp::OpPopupExportGMF,  OB, mesh_group, only_one_non_empty, anId );
   createPopupItem( SMESHOp::OpPopupExportDAT,  OB, mesh_group, only_one_non_empty, anId );
-  createPopupItem( SMESHOp::OpDelete,          OB, mesh_part + " " + hyp_alg );
-  createPopupItem( SMESHOp::OpDeleteGroup,     OB, group );
 
   anId = popupMgr()->insert( tr( "MEN_IMPORT" ), -1, -1 );        // IMPORT submenu
   createPopupItem( SMESHOp::OpPopupImportMED,  OB, smesh, "", anId );
@@ -4719,18 +4738,22 @@ void SMESHGUI::initialize( CAM_Application* app )
   createPopupItem( SMESHOp::OpPopupImportDAT,  OB, smesh, "", anId );
   popupMgr()->insert( separator(), -1, 0 );
 
+  createPopupItem( SMESHOp::OpClearMesh,         OB, mesh );
+  createPopupItem( SMESHOp::OpDelete,            OB, mesh_part + " " + hyp_alg );
+  createPopupItem( SMESHOp::OpDeleteGroup,       OB, group );
+
   // popup for viewer
   createPopupItem( SMESHOp::OpEditGroup,            View, group );
   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 );
   createPopupItem( SMESHOp::OpMeshInformation,    View, mesh_part );
   createPopupItem( SMESHOp::OpOverallMeshQuality, View, mesh_part );
   createPopupItem( SMESHOp::OpFindElementByPoint, View, mesh );
   popupMgr()->insert( separator(), -1, 0 );
 
+  createPopupItem( SMESHOp::OpUpdate,           OB + " " + View, mesh_part );
   createPopupItem( SMESHOp::OpAutoColor,        OB + " " + View, mesh, "&& (not isAutoColor)" );
   createPopupItem( SMESHOp::OpDisableAutoColor, OB + " " + View, mesh, "&& isAutoColor" );
   popupMgr()->insert( separator(), -1, 0 );
@@ -5079,7 +5102,7 @@ bool SMESHGUI::isSelectionCompatible()
 bool SMESHGUI::reusableOperation( const int id )
 {
   // compute, evaluate and precompute are not reusable operations
-  return ( id == SMESHOp::OpCompute || id == SMESHOp::OpPreCompute || id == SMESHOp::OpEvaluate ) ? false : SalomeApp_Module::reusableOperation( id );
+  return ( id == SMESHOp::OpCompute || id == SMESHOp::OpPreCompute || id == SMESHOp::OpEvaluate || id == SMESHOp::OpRecompute ) ? false : SalomeApp_Module::reusableOperation( id );
 }
 
 bool SMESHGUI::activateModule( SUIT_Study* study )
@@ -5831,55 +5854,55 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
   // to do : create operation here
   switch( id )
   {
-    case SMESHOp::OpSplitBiQuadratic:
-      op = new SMESHGUI_SplitBiQuadOp();
+  case SMESHOp::OpSplitBiQuadratic:
+    op = new SMESHGUI_SplitBiQuadOp();
     break;
-    case SMESHOp::OpConvertMeshToQuadratic:
-      op = new SMESHGUI_ConvToQuadOp();
+  case SMESHOp::OpConvertMeshToQuadratic:
+    op = new SMESHGUI_ConvToQuadOp();
     break;
-    case SMESHOp::OpCreateBoundaryElements: // create 2D mesh as boundary on 3D
-      op = new SMESHGUI_Make2DFrom3DOp();
+  case SMESHOp::OpCreateBoundaryElements: // create 2D mesh as boundary on 3D
+    op = new SMESHGUI_Make2DFrom3DOp();
     break;
-    case SMESHOp::OpReorientFaces:
-      op = new SMESHGUI_ReorientFacesOp();
-      break;
-    case SMESHOp::OpCreateMesh:
-      op = new SMESHGUI_MeshOp( true, true );
+  case SMESHOp::OpReorientFaces:
+    op = new SMESHGUI_ReorientFacesOp();
     break;
-    case SMESHOp::OpCreateSubMesh:
-      op = new SMESHGUI_MeshOp( true, false );
+  case SMESHOp::OpCreateMesh:
+    op = new SMESHGUI_MeshOp( true, true );
     break;
-    case SMESHOp::OpEditMeshOrSubMesh:
-    case SMESHOp::OpEditMesh:
-    case SMESHOp::OpEditSubMesh:
-      op = new SMESHGUI_MeshOp( false );
+  case SMESHOp::OpCreateSubMesh:
+    op = new SMESHGUI_MeshOp( true, false );
     break;
-    case SMESHOp::OpCompute:
-    case SMESHOp::OpComputeSubMesh:
-      op = new SMESHGUI_ComputeOp();
+  case SMESHOp::OpEditMeshOrSubMesh:
+  case SMESHOp::OpEditMesh:
+  case SMESHOp::OpEditSubMesh:
+    op = new SMESHGUI_MeshOp( false );
     break;
-    case SMESHOp::OpPreCompute:
-      op = new SMESHGUI_PrecomputeOp();
+  case SMESHOp::OpCompute:
+  case SMESHOp::OpComputeSubMesh:
+    op = new SMESHGUI_ComputeOp();
     break;
-    case SMESHOp::OpEvaluate:
-      op = new SMESHGUI_EvaluateOp();
+  case SMESHOp::OpPreCompute:
+    op = new SMESHGUI_PrecomputeOp();
     break;
-    case SMESHOp::OpMeshOrder:
-      op = new SMESHGUI_MeshOrderOp();
+  case SMESHOp::OpEvaluate:
+    op = new SMESHGUI_EvaluateOp();
     break;
-    case SMESHOp::OpCreateGeometryGroup:
-      op = new SMESHGUI_GroupOnShapeOp();
-      break;
-    case SMESHOp::OpFindElementByPoint:
-      op = new SMESHGUI_FindElemByPointOp();
-      break;
-    case SMESHOp::OpMoveNode: // Make mesh pass through point
-      op = new SMESHGUI_MakeNodeAtPointOp();
-      break;
-    case SMESHOp::OpElem0DOnElemNodes: // Create 0D elements on all nodes
-      op = new SMESHGUI_Add0DElemsOnAllNodesOp();
-      break;
-    default:
+  case SMESHOp::OpMeshOrder:
+    op = new SMESHGUI_MeshOrderOp();
+    break;
+  case SMESHOp::OpCreateGeometryGroup:
+    op = new SMESHGUI_GroupOnShapeOp();
+    break;
+  case SMESHOp::OpFindElementByPoint:
+    op = new SMESHGUI_FindElemByPointOp();
+    break;
+  case SMESHOp::OpMoveNode: // Make mesh pass through point
+    op = new SMESHGUI_MakeNodeAtPointOp();
+    break;
+  case SMESHOp::OpElem0DOnElemNodes: // Create 0D elements on all nodes
+    op = new SMESHGUI_Add0DElemsOnAllNodesOp();
+    break;
+  default:
     break;
   }
 
index 76b91dd9ab4a10bdb3db97cdad91efc63d6e56fa..a7cb0d0dc7840c6dd8231e4d28f67027bd08caaf 100644 (file)
@@ -656,6 +656,24 @@ SMESHGUI_BaseComputeOp::SMESHGUI_BaseComputeOp()
   myHelpFileName = "about_meshes.html"; // V4
 }
 
+//================================================================================
+/*!
+ * \brief Gets dialog of this operation
+ * \retval LightApp_Dialog* - pointer to dialog of this operation
+ */
+//================================================================================
+
+LightApp_Dialog* SMESHGUI_BaseComputeOp::dlg() const
+{
+  return myCompDlg;
+}
+
+//================================================================================
+/*!
+ * \brief Return a selected mesh
+ */
+//================================================================================
+
 SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
 {
   LightApp_SelectionMgr* Sel = selectionMgr();
@@ -665,6 +683,23 @@ SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
   return myMesh->_is_nil() ? aMesh._retn() : SMESH::SMESH_Mesh::_duplicate( myMesh );
 }
 
+//================================================================================
+/*!
+ * \brief check the same operations on the same mesh
+ */
+//================================================================================
+
+bool SMESHGUI_BaseComputeOp::isValid(  SUIT_Operation* theOp  ) const
+{
+  SMESHGUI_BaseComputeOp* baseOp = dynamic_cast<SMESHGUI_BaseComputeOp*>( theOp );
+  bool ret = true;
+  if ( !myMesh->_is_nil() && baseOp ) {
+    SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh();
+    if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false;
+  }
+  return ret;
+}
+
 //================================================================================
 /*!
  * \brief Start operation
@@ -720,6 +755,8 @@ void SMESHGUI_BaseComputeOp::startOperation()
     return;
   }
 
+  myCompDlg->myMeshName->setText( SMESH::GetName( myIObject ));
+
   myMainShape = myMesh->GetShapeToMesh();
 
   SMESHGUI_Operation::startOperation();
@@ -883,7 +920,6 @@ void SMESHGUI_BaseComputeOp::computeMesh()
   bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
   if ( shapeOK )
   {
-    myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
     SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
     SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape);
     if ( errors->length() > 0 ) {
@@ -1552,23 +1588,6 @@ void SMESHGUI_ComputeOp::startOperation()
   computeMesh();
 }
 
-//================================================================================
-/*!
- * \brief check the same operations on the same mesh
- */
-//================================================================================
-
-bool SMESHGUI_BaseComputeOp::isValid(  SUIT_Operation* theOp  ) const
-{
-  SMESHGUI_BaseComputeOp* baseOp = dynamic_cast<SMESHGUI_BaseComputeOp*>( theOp );
-  bool ret = true;
-  if ( !myMesh->_is_nil() && baseOp ) {
-    SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh();
-    if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false;
-  }
-  return ret;
-}
-
 //================================================================================
 /*!
  * \brief Gets dialog of this operation
@@ -1956,7 +1975,6 @@ void SMESHGUI_PrecomputeOp::onPreview()
   bool computeFailed = true, memoryLack = false;
 
   SMESHGUI_ComputeDlg* aCompDlg = computeDlg();
-  aCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
 
   SMESHGUI* gui = getSMESHGUI();
   SMESH::SMESH_Gen_var gen = gui->GetSMESHGen();
@@ -2203,7 +2221,6 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
   bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
   if ( shapeOK )
   {
-    myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
     SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
     SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape);
     if ( errors->length() > 0 ) {
@@ -2407,3 +2424,43 @@ SMESHGUI_ComputeDlg* SMESHGUI_BaseComputeOp::evaluateDlg() const
   return myCompDlg;
 }
 
+//================================================================================
+/*!
+ * \brief SMESHGUI_BaseComputeOp constructor
+ */
+//================================================================================
+
+SMESHGUI_ShowErrorsOp::SMESHGUI_ShowErrorsOp():
+  SMESHGUI_BaseComputeOp()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Start SMESHGUI_ShowErrorsOp
+ */
+//================================================================================
+
+void SMESHGUI_ShowErrorsOp::startOperation()
+{
+  SMESHGUI_BaseComputeOp::startOperation();
+
+  if ( myMesh->_is_nil() )
+    return;
+
+  SMESH::SMESH_Gen_var                  gen = getSMESHGUI()->GetSMESHGen();
+  SMESH::compute_error_array_var compErrors = gen->GetComputeErrors( myMesh, myMainShape );
+  QString                        hypErrors;
+  if ( compErrors->length() == 0 )
+    return;
+
+  showComputeResult( /*MemoryLack=*/false, /*NoCompError=*/false, compErrors,
+                     /*NoHypoError=*/true, hypErrors );
+
+  SMESHGUI_ComputeDlg* aCompDlg = computeDlg();
+  aCompDlg->setWindowTitle( tr( "SMESH_WRN_COMPUTE_FAILED" ));
+  aCompDlg->myFullInfo->hide();
+  aCompDlg->myBriefInfo->hide();
+
+  return;
+}
index bcac87d09332c36f78765111106805dcef197671..c72fb097b33f2461454c21d804b32ea70e9bed31 100644 (file)
@@ -72,6 +72,7 @@ public:
   virtual ~SMESHGUI_BaseComputeOp();
 
   SMESH::SMESH_Mesh_ptr          getMesh();
+  virtual LightApp_Dialog*       dlg() const;
 
 protected:
   virtual void                   startOperation();
@@ -204,6 +205,20 @@ protected:
 protected slots:
 };
 
+/*!
+ * \brief Operation to show meshing errors
+ */
+class SMESHGUI_EXPORT SMESHGUI_ShowErrorsOp: public SMESHGUI_BaseComputeOp
+{
+  Q_OBJECT
+
+public:
+  SMESHGUI_ShowErrorsOp();
+
+protected:
+  virtual void                   startOperation();
+};
+
 /*!
  * \brief Dialog to compute a mesh and show computation errors
  */
@@ -236,6 +251,7 @@ protected:
 
   friend class SMESHGUI_BaseComputeOp;
   friend class SMESHGUI_PrecomputeOp;
+  friend class SMESHGUI_ShowErrorsOp;
 };
 
 class SMESHGUI_MeshOrderBox;
index cb3185b888f67320a432eb7123b5110577bc3d7b..f143b01368028d22786f5fbffe3f0f18907da481 100644 (file)
@@ -1913,6 +1913,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName )
   if ( aHypoSet->toUseCommonSize() && !getAverageSize( myAverageSize ))
     return;
 
+  int maxDim = -1;
   for ( int isAlgo = 1; isAlgo >= 0; --isAlgo )
     for ( aHypoSet->init( isAlgo, setType ); aHypoSet->more(); aHypoSet->next() )
     {
@@ -1930,6 +1931,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName )
         {
           setCurrentHyp( myDim, Algo, index );
           onAlgoSelected( index, myDim );
+          maxDim = Max( maxDim, myDim );
         }
       }
       else
@@ -1963,6 +1965,9 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName )
       }
     }
 
+  if ( maxDim > 0 )
+    myDlg->setCurrentTab( maxDim );
+
   return;
 }
 
index b817815933f3c1f4f243fd031fd38a4ce25a4fe8..2782458aa29a4ba138e613e0f2f6e7dbbc9651e5 100644 (file)
@@ -77,6 +77,8 @@ namespace SMESHOp {
     OpPreCompute             = 2042,   // MENU MESH  - PREVIEW
     OpEvaluate               = 2043,   // MENU MESH  - EVALUATE
     OpMeshOrder              = 2044,   // MENU MESH  - CHANGE SUBMESH PRIORITY
+    OpRecompute              = 2045,   // MENU MESH  - Clear + COMPUTE
+    OpShowErrors             = 2046,   // MENU MESH  - Show compute errors
     OpCreateGroup            = 2050,   // MENU MESH  - CREATE GROUP
     OpCreateGeometryGroup    = 2051,   // MENU MESH  - CREATE GROUPS FROM GEOMETRY
     OpConstructGroup         = 2052,   // MENU MESH  - CONSTRUCT GROUP
index 5abe5c5be61812c0d1b17777e7a921e28c191f5a..3a32c569bf53cbceee1f916f7bba38c427dcaf06 100644 (file)
@@ -125,6 +125,8 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
   else if ( p=="entityMode" )           val = QVariant( entityMode( ind ) );
   else if ( p=="isNumFunctor" )         val = QVariant( isNumFunctor( ind ) );
   else if ( p=="displayMode" )          val = QVariant( displayMode( ind ) );
+  else if ( p=="hasAlgo" )              val = QVariant( hasAlgo( ind ) );
+  else if ( p=="hasErrors" )            val = QVariant( hasErrors( ind ) );
   else if ( p=="isComputable" )         val = QVariant( isComputable( ind ) );
   else if ( p=="isPreComputable" )      val = QVariant( isPreComputable( ind ) );
   else if ( p=="hasGeomReference" )     val = QVariant( hasGeomReference( ind ) );
@@ -544,22 +546,17 @@ int SMESHGUI_Selection::dim( int ind ) const
 }
 
 //=======================================================================
-//function : isComputable
-//purpose  : return true for a ready-to-compute mesh
+//function : hasAlgo
+//purpose  : return true for a ready-to-compute [sub-]mesh
 //=======================================================================
 
-bool SMESHGUI_Selection::isComputable( int ind ) const
+bool SMESHGUI_Selection::hasAlgo( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh" ||
                                               myTypes[ind].startsWith("Mesh " )))
   {
     QMap<int,int> modeMap;
-    _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
-
-    _PTR(SComponent) component = meshSO->GetFatherComponent();
-    if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
-      while ( meshSO->Depth() - component->Depth() > 1 )
-        meshSO = meshSO->GetFather();
+    _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() );
 
     SMESHGUI_PrecomputeOp::getAssignedAlgos( meshSO, modeMap );
     return modeMap.size() > 0;
@@ -567,6 +564,51 @@ bool SMESHGUI_Selection::isComputable( int ind ) const
   return false;
 }
 
+
+//=======================================================================
+//function : hasAlgo
+//purpose  : return true if a mesh was computed with errors
+//=======================================================================
+
+bool SMESHGUI_Selection::hasErrors( int ind ) const
+{
+  if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh"))
+  {
+    _PTR(SObject)       meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() );
+    CORBA::Object_var      obj = SMESH::SObjectToObject( meshSO );
+    SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
+    if ( !CORBA::is_nil( mesh ) )
+    {
+      SMESH::SMESH_Gen_var   gen = SMESHGUI::GetSMESHGUI()->GetSMESHGen();
+      GEOM::GEOM_Object_var geom = mesh->GetShapeToMesh();
+      SMESH::compute_error_array_var compErrors = gen->GetComputeErrors( mesh, geom );
+      return compErrors->length();
+    }
+  }
+  return false;
+}
+
+//=======================================================================
+//function : isComputable
+//purpose  : Return true if a [sub-]mesh does not have "computed" icon
+//=======================================================================
+
+bool SMESHGUI_Selection::isComputable( int ind ) const
+{
+  if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh" ||
+                                              myTypes[ind].startsWith("Mesh " )))
+  {
+    _PTR(GenericAttribute) attr;
+    if ( _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() ))
+      if ( meshSO->FindAttribute( attr, "AttributePixMap" ))
+      {
+        _PTR(AttributePixMap) pixmap = attr;
+        return ( pixmap->GetPixMap() != "ICON_SMESH_TREE_MESH" );
+      }
+  }
+  return false;
+}
+
 //=======================================================================
 //function : isPreComputable
 //purpose  : returns true for a mesh with algorithms
index e4b0641e0099c6a973aa34a9bf7e9487b82d647f..710cfcf83c880d2d9b85f609d5044c87225608e1 100644 (file)
@@ -57,6 +57,8 @@ public:
   virtual int             numberOfNodes( int ) const;
   virtual int             dim( int ) const;
   virtual bool            isComputable( int ) const;
+  virtual bool            hasAlgo( int ) const;
+  virtual bool            hasErrors( int ) const;
   virtual bool            isPreComputable( int ) const;
   virtual bool            hasGeomReference( int ) const;
   virtual bool            isEditableHyp( int ) const;
index 9f0e4a7774d0cff8b77ed3e89833e98d902232e3..932d60f07320568287b663ffda635aa94b9fc6e4 100644 (file)
             <source>ICON_COMPUTE</source>
             <translation>mesh_compute.png</translation>
         </message>
+        <message>
+            <source>ICON_SHOW_ERRORS</source>
+            <translation>mesh_compute_error.png</translation>
+        </message>
         <message>
             <source>ICON_OVL_MESH_QUALITY</source>
             <translation>mesh_quality.png</translation>
             <source>ICON_CUTQUAD</source>
             <translation>mesh_cutquad.png</translation>
         </message>
+        <message>
+            <source>ICON_EXPORT</source>
+            <translation>mesh_export.png</translation>
+        </message>
+        <message>
+            <source>ICON_AUTO_COLOR</source>
+            <translation>mesh_auto_colors.png</translation>
+        </message>
+        <message>
+            <source>ICON_DISABLE_AUTO_COLOR</source>
+            <translation>mesh_auto_colors.png</translation>
+        </message>
         <message>
             <source>ICON_DELETE</source>
             <translation>delete.png</translation>
index eba5718ed9ebc01b9573f3dcd5cf4ee7920f0dd1..ccad8714f9a9a6c01edeb60112cc57053918b452 100644 (file)
         <source>MEN_COMPUTE</source>
         <translation>Compute</translation>
     </message>
+    <message>
+        <source>MEN_RE_COMPUTE</source>
+        <translation>Clear + Compute</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_ERRORS</source>
+        <translation>Show Compute Errors</translation>
+    </message>
     <message>
         <source>MEN_COMPUTE_SUBMESH</source>
         <translation>Compute Sub-mesh</translation>
index 470ca6587eb262b98525d7ae8979df388ae08c25..9c00cb31ee2073aa8d0f54e6090ba84c4c3d4ed8 100644 (file)
@@ -6425,8 +6425,8 @@ class SMESH_DimHyp
   //! fields
   int _dim;    //!< a dimension the algo can build (concurrent dimension)
   int _ownDim; //!< dimension of shape of _subMesh (>=_dim)
-  TopTools_MapOfShape _shapeMap; //!< [sub-]shapes of dimension == _dim
-  SMESH_subMesh*      _subMesh;
+  TopTools_MapOfShape  _shapeMap; //!< [sub-]shapes of dimension == _dim
+  const SMESH_subMesh* _subMesh;
   list<const SMESHDS_Hypothesis*> _hypotheses; //!< algo is first, then its parameters
 
   //-----------------------------------------------------------------------------
@@ -6440,7 +6440,7 @@ class SMESH_DimHyp
                const int            theDim,
                const TopoDS_Shape&  theShape)
   {
-    _subMesh = (SMESH_subMesh*)theSubMesh;
+    _subMesh = theSubMesh;
     SetShape( theDim, theShape );
   }
 
@@ -6523,7 +6523,7 @@ class SMESH_DimHyp
     if ( !isSame )
     {
       return true;
-      // commented for IPAL54678
+      // commented off for IPAL54678
       // if ( !a1 || !a2 )
       //   return false; // pb?
       // return a1->GetDim() == a2->GetDim(); // different algorithms of same dim -> concurrency !
@@ -6571,7 +6571,8 @@ void addDimHypInstance(const int                               theDim,
        theAlgo->NeedLowerHyps( theDim )) // IPAL54678
     return;
   TDimHypList& listOfdimHyp = theDimHypListArr[theDim];
-  if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh ) {
+  if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh )
+  {
     SMESH_DimHyp* dimHyp = new SMESH_DimHyp( theSubMesh, theDim, theShape );
     dimHyp->_hypotheses.push_front(theAlgo);
     listOfdimHyp.push_back( dimHyp );
@@ -6627,7 +6628,8 @@ void unionLists(TListOfInt&       theListOfId,
                 const int         theIndx )
 {
   TListOfListOfInt::iterator it = theListOfListOfId.begin();
-  for ( int i = 0; it != theListOfListOfId.end(); it++, i++ ) {
+  for ( int i = 0; it != theListOfListOfId.end(); it++, i++ )
+  {
     if ( i < theIndx )
       continue; //skip already treated lists
     // check if other list has any same submesh object
@@ -6750,82 +6752,86 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes()
 {
   TListOfListOfInt anOrder;
   ::SMESH_Mesh& mesh = GetImpl();
-  {
-    // collect submeshes and detect concurrent algorithms and hypothesises
-    TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
-
-    map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
-    for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) {
-      ::SMESH_subMesh* sm = (*i_sm).second;
-      // shape of submesh
-      const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
-
-      // list of assigned hypothesises
-      const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
-      // Find out dimensions where the submesh can be concurrent.
-      // We define the dimensions by algo of each of hypotheses in hypList
-      list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
-      for( ; hypIt != hypList.end(); hypIt++ ) {
-        SMESH_Algo* anAlgo = 0;
-        const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
-        if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
-          // hyp it-self is algo
-          anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
-        else {
-          // try to find algorithm with help of sub-shapes
-          TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
-          for ( ; !anAlgo && anExp.More(); anExp.Next() )
-            anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
-        }
-        if (!anAlgo)
-          continue; // no algorithm assigned to a current submesh
 
-        int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
-        // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDiscreteBoundary()
-        // and !anAlgo->NeedLowerHyps( dim ))
+  // collect submeshes and detect concurrent algorithms and hypothesises
+  TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
 
-        // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
-        for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
-          addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
+  map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
+  for ( ; i_sm != _mapSubMesh.end(); i_sm++ )
+  {
+    ::SMESH_subMesh* sm = (*i_sm).second;
+    // shape of submesh
+    const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
+
+    // list of assigned hypothesises
+    const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
+    // Find out dimensions where the submesh can be concurrent.
+    // We define the dimensions by algo of each of hypotheses in hypList
+    list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
+    for( ; hypIt != hypList.end(); hypIt++ )
+    {
+      SMESH_Algo* anAlgo = 0;
+      const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
+      if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
+        // hyp it-self is algo
+        anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
+      else {
+        // try to find algorithm with help of sub-shapes
+        TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
+        for ( ; !anAlgo && anExp.More(); anExp.Next() )
+          anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
       }
-    } // end iterations on submesh
+      if (!anAlgo)
+        continue; // no algorithm assigned to a current submesh
+
+      int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
+      // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDiscreteBoundary()
+      // and !anAlgo->NeedLowerHyps( dim ))
+
+      // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
+      for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
+        addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
+    }
+  } // end iterations on submesh
 
     // iterate on created dimension-hypotheses and check for concurrents
-    for ( int i = 0; i < 4; i++ ) {
-      const TDimHypList& listOfDimHyp = dimHypListArr[i];
-      // check for concurrents in own and other dimensions (step-by-step)
-      TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
-      for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) {
-        const SMESH_DimHyp* dimHyp = *dhIt;
-        TDimHypList listOfConcurr;
-        set<int>    setOfConcurrIds;
-        // looking for concurrents and collect into own list
-        for ( int j = i; j < 4; j++ )
-          findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds );
-        // check if any concurrents found
-        if ( listOfConcurr.size() > 0 ) {
-          // add own submesh to list of concurrent
-          addInOrderOfPriority( dimHyp, listOfConcurr );
-          list<int> listOfConcurrIds;
-          TDimHypList::iterator hypIt = listOfConcurr.begin();
-          for ( ; hypIt != listOfConcurr.end(); ++hypIt )
-            listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() );
-          anOrder.push_back( listOfConcurrIds );
-        }
+  for ( int i = 0; i < 4; i++ )
+  {
+    const TDimHypList& listOfDimHyp = dimHypListArr[i];
+    // check for concurrents in own and other dimensions (step-by-step)
+    TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
+    for ( ; dhIt != listOfDimHyp.end(); dhIt++ )
+    {
+      const SMESH_DimHyp* dimHyp = *dhIt;
+      TDimHypList listOfConcurr;
+      set<int>    setOfConcurrIds;
+      // looking for concurrents and collect into own list
+      for ( int j = i; j < 4; j++ )
+        findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds );
+      // check if any concurrents found
+      if ( listOfConcurr.size() > 0 )
+      {
+        // add own submesh to list of concurrent
+        addInOrderOfPriority( dimHyp, listOfConcurr );
+        list<int> listOfConcurrIds;
+        TDimHypList::iterator hypIt = listOfConcurr.begin();
+        for ( ; hypIt != listOfConcurr.end(); ++hypIt )
+          listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() );
+        anOrder.push_back( listOfConcurrIds );
       }
     }
+  }
 
-    removeDimHyps(dimHypListArr);
+  removeDimHyps(dimHypListArr);
 
-    // now, minimize the number of concurrent groups
-    // Here we assume that lists of submeshes can have same submesh
-    // in case of multi-dimension algorithms, as result
-    //  list with common submesh has to be united into one list
-    int listIndx = 0;
-    TListOfListOfInt::iterator listIt = anOrder.begin();
-    for(; listIt != anOrder.end(); listIt++, listIndx++ )
-      unionLists( *listIt,  anOrder, listIndx + 1 );
-  }
+  // now, minimize the number of concurrent groups
+  // Here we assume that lists of submeshes can have same submesh
+  // in case of multi-dimension algorithms, as result
+  //  list with common submesh has to be united into one list
+  int listIndx = 0;
+  TListOfListOfInt::iterator listIt = anOrder.begin();
+  for(; listIt != anOrder.end(); listIt++, listIndx++ )
+    unionLists( *listIt,  anOrder, listIndx + 1 );
 
   return anOrder;
 }
@@ -6913,7 +6919,8 @@ void SMESH_Mesh_i::convertMeshOrder (const TListOfListOfInt&     theIdsOrder,
   theResOrder.length(nbSet);
   TListOfListOfInt::const_iterator it = theIdsOrder.begin();
   int listIndx = 0;
-  for( ; it != theIdsOrder.end(); it++ ) {
+  for( ; it != theIdsOrder.end(); it++ )
+  {
     // translate submesh identificators into submesh objects
     //  takeing into account real number of concurrent lists
     const TListOfInt& aSubOrder = (*it);
@@ -6926,7 +6933,8 @@ void SMESH_Mesh_i::convertMeshOrder (const TListOfListOfInt&     theIdsOrder,
     aResSubSet->length(aSubOrder.size());
     TListOfInt::const_iterator subIt = aSubOrder.begin();
     int j;
-    for( j = 0; subIt != aSubOrder.end(); subIt++ ) {
+    for( j = 0; subIt != aSubOrder.end(); subIt++ )
+    {
       if ( _mapSubMeshIor.find(*subIt) == _mapSubMeshIor.end() )
         continue;
       SMESH::SMESH_subMesh_var subMesh =