Salome HOME
Merge master branch into V9_dev.
[modules/geom.git] / src / GEOMBase / GEOMBase_Helper.cxx
index c38769a9abb432c5d390d4a0a7f431f7a9a7ed7e..9fb40605e4b87a0f2f4c932fd21d6fa52b9849c5 100755 (executable)
@@ -595,12 +595,10 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t
   if ( !aStudy || theObj->_is_nil() )
     return QString();
 
-  SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy);
-
   GEOM::GEOM_Object_ptr aFatherObj = getFather( theObj );
 
   SALOMEDS::SObject_var aSO =
-    getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj);
+    getGeomEngine()->AddInStudy(theObj, theName, aFatherObj);
 
   QString anEntry;
   if ( !aSO->_is_nil() ) {
@@ -609,7 +607,7 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t
   }
   // Each dialog is responsible for this method implementation,
   // default implementation does nothing
-  restoreSubShapes(aStudyDS, aSO);
+  restoreSubShapes(aSO);
   aSO->UnRegister();
 
   return anEntry;
@@ -619,15 +617,14 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t
 // Function : restoreSubShapes
 // Purpose  : restore tree of argument's sub-shapes under the resulting shape
 //================================================================
-void GEOMBase_Helper::restoreSubShapes (SALOMEDS::Study_ptr   /*theStudy*/,
-                                        SALOMEDS::SObject_ptr /*theSObject*/)
+void GEOMBase_Helper::restoreSubShapes (SALOMEDS::SObject_ptr /*theSObject*/)
 {
   // do nothing by default
 
   // example of implementation in particular dialog:
   // GEOM::ListOfGO anArgs;
   // anArgs.length(0); // empty list means that all arguments should be restored
-  // getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+  // getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
   //                                     /*theFindMethod=*/GEOM::FSM_GetInPlace,
   //                                     /*theInheritFirstArg=*/false);
 }
@@ -643,7 +640,7 @@ void GEOMBase_Helper::updateObjBrowser() const
     CAM_Module* module = app->module( "Geometry" );
     SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>( module );
     if ( appMod ) {
-      appMod->updateObjBrowser( true );
+      appMod->updateObjBrowser();
     }
   }
 }
@@ -657,18 +654,6 @@ void GEOMBase_Helper::updateViewer()
   getDisplayer()->UpdateViewer();
 }
 
-//================================================================
-// Function : getStudyId
-// Purpose  : Get study Id
-//================================================================
-int GEOMBase_Helper::getStudyId() const
-{
-  int anId = -1;
-  if ( getStudy() )
-    anId = getStudy()->id();
-  return anId;
-}
-
 //================================================================
 // Function : getStudy
 // Purpose  : Returns the active study. It is recommended to use
@@ -719,7 +704,7 @@ QString GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const
 GEOM_Displayer* GEOMBase_Helper::getDisplayer()
 {
   if ( !myDisplayer )
-    myDisplayer = new GEOM_Displayer( getStudy() );
+    myDisplayer = new GEOM_Displayer();
   return myDisplayer;
 }
 
@@ -1365,7 +1350,7 @@ QList<GEOM::GeomObjPtr> GEOMBase_Helper::getSelected( const QList<TopAbs_ShapeEn
               GEOM::GeomObjPtr subShape = findObjectInFather( object.get(), idx );
               if ( !subShape ) {
                 // sub-shape is not yet published in the study
-                GEOM::ShapesOpPtr shapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+                GEOM::ShapesOpPtr shapesOp = getGeomEngine()->GetIShapesOperations();
                 subShape.take( shapesOp->GetSubShape( object.get(), idx ) ); // take ownership!
               }
               if ( typeInList( (TopAbs_ShapeEnum)(subShape->GetShapeType()), types ) ) {