Salome HOME
Porting to ParaView 5.8
[modules/geom.git] / src / STLPlugin / STLPlugin_GUI.cxx
index 7d0ced2eb3438db50ea42c179bad0f14e3675c5e..9cd0163d0bb0fc02503b15319f165104aae4b15f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-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
@@ -96,7 +96,7 @@ bool STLPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* paren
     getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
   }
 
-  return true;
+  return true; // ?????????
 }
 
 //=======================================================================
@@ -107,11 +107,8 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
 {
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return false;
-  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
-  if ( !study ) return false;
 
-  SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
-  GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
+  GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" );
   STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
   if ( stlOp.isNull() ) return false;
 
@@ -138,14 +135,13 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
         {
           GEOM::GEOM_Object_var main = result[0];
           QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
-          SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
-                                                                                SALOMEDS::SObject::_nil(),
+          SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(),
                                                                                 main.in(),
                                                                                 publishName.toUtf8().constData() );
 
           entryList.append( so->GetID() );
           transaction.commit();
-          GEOM_Displayer( study ).Display( main.in() );
+          GEOM_Displayer().Display( main.in() );
           main->UnRegister();
         }
         else
@@ -159,7 +155,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
         transaction.abort();
       }
     }
-    getGeometryGUI()->updateObjBrowser( true );
+    getGeometryGUI()->updateObjBrowser();
     app->browseObjects( entryList );
 
     if ( errors.count() > 0 )
@@ -180,11 +176,8 @@ bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent )
 {
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return false;
-  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
-  if ( !study ) return false;
 
-  SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
-  GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
+  GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" );
   STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
   if ( stlOp.isNull() ) return false;