Salome HOME
Fix for '54677: TC-9.5.0: SMESH: ball visualization failed'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index c5404494a9bb390a259e578a6e29e0d0fe70f7e9..28862787daa3b8614bb156b8678091824669913e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include "SMESH_version.h"
 
-#include "SMESH_ControlsDef.hxx"
 #include "SMESH_Actor.h"
 #include "SMESH_ActorUtils.h"
 #include "SMESH_Client.hxx"
+#include "SMESH_Comment.hxx"
+#include "SMESH_ControlsDef.hxx"
 #include "SMESH_ScalarBarActor.h"
-#include <SMESH_Comment.hxx>
 #include "SMESH_TypeFilter.hxx"
 
 // SALOME GUI includes
@@ -1457,7 +1457,7 @@ namespace
       if ( !io->hasEntry() ) continue;
       _PTR(SObject) so = SMESH::getStudy()->FindObjectID( io->getEntry() );
       SMESH::SMESH_Mesh_var mesh;
-      while ( mesh->_is_nil() && so )
+      while ( mesh->_is_nil() && so && so->GetID() != "0:" )
       {
         CORBA::Object_var obj = SMESH::SObjectToObject( so );
         SMESH::SMESH_IDSource_var isrc = SMESH::SMESH_IDSource::_narrow( obj );
@@ -5068,8 +5068,9 @@ bool SMESHGUI::isSelectionCompatible()
   SALOME_ListIteratorOfListIO It( selected );
   for ( ; isCompatible && It.More(); It.Next())
     isCompatible =
-      ( strcmp("GEOM", It.Value()->getComponentDataType()) == 0 ) ||
-      ( strcmp("SMESH", It.Value()->getComponentDataType()) == 0 );
+      ( strcmp("GEOM",        It.Value()->getComponentDataType()) == 0 ) ||
+      ( strcmp("SHAPERSTUDY", It.Value()->getComponentDataType()) == 0 ) ||
+      ( strcmp("SMESH",       It.Value()->getComponentDataType()) == 0 );
 
   return isCompatible;
 }
@@ -5115,9 +5116,9 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
   if ( aDesk ) {
     QList<SUIT_ViewWindow*> wndList = aDesk->windows();
     SUIT_ViewWindow* wnd;
-    foreach(wnd, wndList)
+    foreach ( wnd, wndList )
     {
-      connectView(wnd);
+      connectView( wnd );
 
       // remove actors whose objects are removed in GetSMESHGen()->UpdateStudy()
       SMESH::UpdateActorsAfterUpdateStudy(wnd);
@@ -5404,6 +5405,7 @@ void SMESHGUI::createPreferences()
                              "SMESH", "nb_segments_per_edge" );
   setPreferenceProperty( nbSeg, "min", 1 );
   setPreferenceProperty( nbSeg, "max", 10000000 );
+  addPreference( tr( "PREF_USE_MESHGEMS_HYPOSET" ), segGroup, LightApp_Preferences::Bool, "SMESH", "use-meshgems-hypo-sets" );
 
   int loadGroup = addPreference( tr( "SMESH_PREF_MESH_LOADING" ), genTab );
   addPreference( tr( "PREF_FORGET_MESH_AT_HYP_MODIF" ), loadGroup, LightApp_Preferences::Bool,
@@ -6331,8 +6333,6 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
 
   // componentName is used for encoding of entries when storing them in IParameters
   std::string componentName = myComponentSMESH->ComponentDataType();
-  //_PTR(SComponent) aSComponent = studyDS->FindComponent("GEOM");
-  //if (!aSComponent) return;
 
   // IParameters
   _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative",