Salome HOME
Update of CheckDone
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshOp.cxx
index 95b51a474ac0d372bf6d7610f553a7838f08b165..50132b41eee3cc0ea8f78e9816099d0e92af0036 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -125,6 +125,57 @@ LightApp_Dialog* SMESHGUI_MeshOp::dlg() const
   return myDlg;
 }
 
+//================================================================================
+/*!
+ * \brief Log meshers info
+*/
+//================================================================================
+void SMESHGUI_MeshOp::logSmeshParams()
+{
+  QString mesherType;
+  int curMeshType = myDlg->currentMeshType();
+  switch ( curMeshType ) {
+  case MT_ANY:
+    mesherType = "Any";
+    break;
+  case MT_TRIANGULAR:
+    mesherType = "Triangular";
+    break;
+  case MT_QUADRILATERAL:
+    mesherType = "Quadrilateral";
+    break;
+  case MT_TETRAHEDRAL:
+    mesherType = "Tetrahedral";
+    break;
+  case MT_HEXAHEDRAL:
+    mesherType = "Hexahedral";
+    break;
+  default:
+    mesherType = "";
+  }
+
+  QString aMessage = QString("Mesh type is %1").arg(mesherType);
+  CAM_Application::logStructuredUserEvent( "Mesh",
+                                           "create mesh",
+                                           "",
+                                           "",
+                                           aMessage);
+
+  for ( int dim = 0; dim <= 3; ++dim )
+  {
+    HypothesisData * curAlgo = hypData( dim, Algo, currentHyp( dim, Algo ));
+    if(curAlgo)
+    {
+      aMessage = QString("%1D algorithm is %2").arg(dim).arg(curAlgo->Label);
+      CAM_Application::logStructuredUserEvent( "Mesh",
+                                           "create mesh",
+                                           "",
+                                           "",
+                                           aMessage);
+    }
+  }
+}
+
 //================================================================================
 /*!
  * \brief Creates or edits mesh
@@ -182,6 +233,7 @@ bool SMESHGUI_MeshOp::onApply()
   {
     if ( myToCreate )
       setDefaultName();
+    //connect(aAction, SIGNAL(triggered(bool)), this, SLOT(logSmeshParams()));
   }
   else
   {
@@ -190,6 +242,7 @@ bool SMESHGUI_MeshOp::onApply()
     SUIT_MessageBox::warning( myDlg, tr( "SMESH_ERROR" ), aMess );
   }
 
+  logSmeshParams();
   myHypoSet = 0;
 
   return aResult;
@@ -1292,6 +1345,7 @@ void SMESHGUI_MeshOp::createHypothesis(const int      theDim,
       initHypCreator( aCreator );
 
       myDlg->setEnabled( false );
+      myDlg->hide();
       aCreator->create(initParamHyp, aHypName, myDlg, this, SLOT( onHypoCreated( int ) ) );
       dialog = true;
     }
@@ -1323,6 +1377,7 @@ void SMESHGUI_MeshOp::onHypoCreated( int result )
     int obj = myDlg->getActiveObject();
     onActivateObject( obj ); // Issue 0020170. Restore filters
     myDlg->setEnabled( true );
+    myDlg->show();
   }
 
   _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent("SMESH");
@@ -1379,6 +1434,7 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
 
     removeCustomFilters(); // Issue 0020170
     myDlg->setEnabled( false );
+    myDlg->hide();
 
     aCreator->edit( aHyp.in(), aHypItem.second, dlg(), this, SLOT( onHypoEdited( int ) ) );
   }
@@ -1397,6 +1453,7 @@ void SMESHGUI_MeshOp::onHypoEdited( int /*result*/ )
   int obj = myDlg->getActiveObject();
   onActivateObject( obj ); // Issue 0020170. Restore filters
   myDlg->setEnabled( true );
+  myDlg->show();
 }
 
 //================================================================================
@@ -2631,7 +2688,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess, QStringList& theEntry
 
   _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh.in());
   if (aMeshSO) {
-    SMESH::SetName(aMeshSO, myDlg->objectText(SMESHGUI_MeshDlg::Obj));
+    if (aSubMeshVar->_is_nil()) SMESH::SetName(aMeshSO, myDlg->objectText(SMESHGUI_MeshDlg::Obj));
     theEntryList.append(aMeshSO->GetID().c_str());
   }