Salome HOME
Fix exception at Break Link after shaper group modification
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ComputeDlg.cxx
index 74b9f61e37cbbf737308aec55b919136f71e9fe2..b5720d7970379a272dfa9264dbf978c1fba86ab0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -575,11 +575,7 @@ QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent, bool ForEval)
   myTable->hideColumn( COL_PUBLISHED );
   myTable->hideColumn( COL_SHAPEID );
   myTable->hideColumn( COL_BAD_MESH );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-  myTable->horizontalHeader()->setResizeMode( COL_ERROR, QHeaderView::Interactive );
-#else
   myTable->horizontalHeader()->setSectionResizeMode( COL_ERROR, QHeaderView::Interactive );
-#endif
   myTable->setWordWrap( true );
   myTable->horizontalHeader()->setStretchLastSection( true );
   myTable->setMinimumWidth( 500 );
@@ -657,7 +653,7 @@ SMESHGUI_BaseComputeOp::SMESHGUI_BaseComputeOp()
   myBadMeshDisplayer = 0;
 
   //myHelpFileName = "/files/about_meshes.htm"; // V3
-  myHelpFileName = "about_meshes_page.html"; // V4
+  myHelpFileName = "about_meshes.html"; // V4
 }
 
 SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
@@ -925,10 +921,6 @@ void SMESHGUI_BaseComputeOp::computeMesh()
 
     // NPAL16631: if ( !memoryLack )
     {
-      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID(myIObject->getEntry());
-      SMESH::ModifiedMesh( sobj,
-                           !computeFailed && aHypErrors.isEmpty(),
-                           myMesh->NbNodes() == 0);
       update( UF_ObjBrowser | UF_Model );
 
       // SHOW MESH
@@ -959,7 +951,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
           SMESH::SMESH_IDSource_var aSubMeshObj =
             SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
           SMESH_Actor *anActor = SMESH::FindActorByObject( aSubMeshObj );
-          if ( anActor && anActor->GetVisibility() )
+          if ( anActor /*&& anActor->GetVisibility()*/ )
             aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj ));
         }
         // put Groups into list
@@ -975,7 +967,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
           SMESH::SMESH_IDSource_var aGroupObj =
             SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
           SMESH_Actor *anActor = SMESH::FindActorByObject( aGroupObj );
-          if ( anActor && anActor->GetVisibility() )
+          if ( anActor /*&& anActor->GetVisibility()*/ )
             aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO ));
         }
 
@@ -991,22 +983,25 @@ void SMESHGUI_BaseComputeOp::computeMesh()
           {
             try {
               OCC_CATCH_SIGNALS;
-              bool toDisplay = false;
+              std::string entry = (*anIter).second->GetID();
               if ( !aMesh->_is_nil() ) // display only a mesh
               {
-                toDisplay = true;
                 SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
-                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetID().c_str(),
-                                                              /*clearLog =*/ true );
+                if ( !anActor ) anActor = SMESH::CreateActor( entry.c_str(), /*clearLog =*/true );
                 if ( anActor ) // actor is not created for an empty mesh
                 {
                   anActor->SetEntityMode( entities );
-                  SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor );
+                  //SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor ); -- 23615
                 }
               }
-              Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
-                ( (*anIter).second->GetID().c_str(), "SMESH", (*anIter).second->GetName().c_str() );
-              SMESH::Update(anIO, toDisplay);
+              else
+              {
+                SMESH_Actor *anActor = SMESH::FindActorByEntry( entry.c_str() );
+                anActor->Update();
+                if ( !anActor->GetVisibility() )
+                  continue;
+              }
+              SMESH::UpdateView( SMESH::eDisplay, entry.c_str() );
 
               if ( SVTK_ViewWindow* vtkWnd = SMESH::GetVtkViewWindow(SMESH::GetActiveWindow() ))
                 if ( vtkWnd->getRenderer() )
@@ -1142,7 +1137,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
       aCompDlg->myFullInfo->hide();
     }
 
-    // pbs of hypo dfinitions
+    // pbs of hypo definitions
     if ( theNoHypoError ) {
       aCompDlg->myHypErrorGroup->hide();
     } else {
@@ -1263,8 +1258,8 @@ void SMESHGUI_BaseComputeOp::stopOperation()
 
 void SMESHGUI_BaseComputeOp::onPublishShape()
 {
-  GEOM::GEOM_Gen_var      geomGen = SMESH::GetGEOMGen();
   GEOM::GEOM_Object_var meshShape = myMesh->GetShapeToMesh();
+  GEOM::GEOM_Gen_var      geomGen = SMESH::GetGEOMGen( meshShape );
 
   QStringList entryList;
   QList<int> rows;
@@ -1285,7 +1280,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
         // look for myMainShape in the table
         for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
           if ( table()->item( r, COL_SHAPEID )->text() == "1" ) {
-            if ( so->_is_nil() ) {
+            if ( !so->_is_nil() ) {
               CORBA::String_var name  = so->GetName();
               CORBA::String_var entry = so->GetID();
               QString       shapeText = QString("%1 (%2)").arg( name.in() ).arg( entry.in() );
@@ -1343,7 +1338,7 @@ void SMESHGUI_BaseComputeOp::onShowBadMesh()
       prop->SetPointSize( aPointSize * 3 );
       prop->SetColor( 250, 0, 250 );
       myBadMeshDisplayer->GetActor()->SetProperty( prop );
-      myBadMeshDisplayer->SetData( aMeshData._retn() );
+      myBadMeshDisplayer->SetData( aMeshData.in() );
       prop->Delete();
     }
   }
@@ -1529,7 +1524,7 @@ QTableWidget* SMESHGUI_BaseComputeOp::table()
 SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
  : SMESHGUI_BaseComputeOp()
 {
-  myHelpFileName = "constructing_meshes_page.html#compute_anchor";
+  myHelpFileName = "constructing_meshes.html#compute-anchor";
 }
 
 
@@ -1639,7 +1634,7 @@ LightApp_Dialog* SMESHGUI_PrecomputeOp::dlg() const
 
 void SMESHGUI_PrecomputeOp::startOperation()
 {
-  myHelpFileName = "constructing_meshes_page.html#preview_anchor"; // other anchor onCompute()
+  myHelpFileName = "constructing_meshes.html#preview-anchor"; // other anchor onCompute()
 
   if ( !myDlg )
   {
@@ -1876,7 +1871,7 @@ void SMESHGUI_PrecomputeOp::onCompute()
     myOrderMgr->SetMeshOrder();
   myMapShapeId.clear();
   myActiveDlg = computeDlg();
-  myHelpFileName = "constructing_meshes_page.html#compute_anchor";
+  myHelpFileName = "constructing_meshes.html#compute-anchor";
   computeMesh();
 }
 
@@ -1983,12 +1978,11 @@ void SMESHGUI_PrecomputeOp::onPreview()
     SMESH::MeshPreviewStruct_var previewData =
       gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId);
 
-    SMESH::MeshPreviewStruct* previewRes = previewData._retn();
-    if ( previewRes && previewRes->nodesXYZ.length() > 0 )
+    if ( & previewData.in() && previewData->nodesXYZ.length() > 0 )
     {
       computeFailed = false;
-      myPreviewDisplayer->SetData( previewRes );
-      // append shape indeces with computed mesh entities
+      myPreviewDisplayer->SetData( previewData );
+      // append shape indices with computed mesh entities
       for ( int i = 0, n = aShapesId->length(); i < n; i++ )
         myMapShapeId[ aShapesId[ i ] ] = 0;
     }
@@ -2142,7 +2136,7 @@ SMESHGUI_MeshOrderBox* SMESHGUI_PrecomputeDlg::getMeshOrderBox() const
 SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp()
  : SMESHGUI_BaseComputeOp()
 {
-  myHelpFileName = "constructing_meshes_page.html#evaluate_anchor";
+  myHelpFileName = "constructing_meshes.html#evaluate-anchor";
 }