Salome HOME
NOMINMAX definition has been moved into CONFIGURATION repository.
[modules/geom.git] / src / GEOM_I_Superv / GEOM_Superv_i.cc
index 449a3c6b8ae3c8a325ed2c5459ccc3952ffbdee1..99ce60b7192380cafc9aaf02a9d518d7b408671e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  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
@@ -22,6 +22,7 @@
 
 #include "GEOM_Superv_i.hh"
 #include "SALOME_LifeCycleCORBA.hxx"
+#include "Utils_CorbaException.hxx"
 
 #include CORBA_SERVER_HEADER(SALOME_Session)
 #include "SALOMEDSClient_ClientFactory.hxx"
@@ -50,9 +51,6 @@ GEOM_Superv_i::GEOM_Superv_i(CORBA::ORB_ptr orb,
 
   setGeomEngine();
 
-  myStudyID = -1;
-  myLastStudyID = -1;
-
   myBasicOp = GEOM::GEOM_IBasicOperations::_nil();
   my3DPrimOp = GEOM::GEOM_I3DPrimOperations::_nil();
   myBoolOp = GEOM::GEOM_IBooleanOperations::_nil();
@@ -110,50 +108,6 @@ void GEOM_Superv_i::setGeomEngine()
   myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
 }
 
-//=============================================================================
-//  SetStudyID:
-//=============================================================================
-void GEOM_Superv_i::SetStudyID( CORBA::Long theId )
-{
-  // mkr : PAL10770 -->
-  myLastStudyID = myStudyID;
-
-  CORBA::Object_ptr anObject = name_service->Resolve("/Kernel/Session");
-  if ( !CORBA::is_nil(anObject) ) {
-    SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
-    if ( !CORBA::is_nil(aSession) ) {
-      int aStudyID = aSession->GetActiveStudyId();
-      if ( theId != aStudyID && aStudyID > 0) { // mkr : IPAL12128
-        MESSAGE("Warning : given study ID theId="<<theId<<" is wrong and will be replaced by the value "<<aStudyID);
-        myStudyID = aStudyID;
-      }
-      else
-        myStudyID = theId; // mkr : IPAL12128
-    }
-  }
-
-  if ( isNewStudy(myLastStudyID,myStudyID) ) {
-    if (CORBA::is_nil(myGeomEngine)) setGeomEngine();
-    std::string anEngine = _orb->object_to_string( myGeomEngine );
-
-    CORBA::Object_var anObj = name_service->Resolve("/myStudyManager");
-    if ( !CORBA::is_nil(anObj) ) {
-      SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(anObj);
-      if ( !CORBA::is_nil(aStudyManager) ) {
-        _PTR(Study) aDSStudy = ClientFactory::Study(aStudyManager->GetStudyByID(myStudyID));
-        if ( aDSStudy ) {
-          _PTR(SComponent) aSCO = aDSStudy->FindComponent(myGeomEngine->ComponentDataType());
-          if ( aSCO ) {
-            _PTR(StudyBuilder) aBuilder = aDSStudy->NewBuilder();
-            if ( aBuilder ) aBuilder->LoadWith( aSCO, anEngine );
-          }
-        }
-      }
-    }
-  }
-  // mkr : PAL10770 <--
-}
-
 //=============================================================================
 //  CreateListOfGO:
 //=============================================================================
@@ -235,11 +189,8 @@ void GEOM_Superv_i::getBasicOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_IBasicOperations interface
-  if (CORBA::is_nil(myBasicOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myBasicOp = myGeomEngine->GetIBasicOperations(myStudyID);
+  if (CORBA::is_nil(myBasicOp)) {
+    myBasicOp = myGeomEngine->GetIBasicOperations();
   }
 }
 
@@ -251,11 +202,8 @@ void GEOM_Superv_i::get3DPrimOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_I3DPrimOperations interface
-  if (CORBA::is_nil(my3DPrimOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    my3DPrimOp = myGeomEngine->GetI3DPrimOperations(myStudyID);
+  if (CORBA::is_nil(my3DPrimOp)) {
+    my3DPrimOp = myGeomEngine->GetI3DPrimOperations();
   }
 }
 
@@ -267,11 +215,8 @@ void GEOM_Superv_i::getBoolOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_IBooleanOperations interface
-  if (CORBA::is_nil(myBoolOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myBoolOp = myGeomEngine->GetIBooleanOperations(myStudyID);
+  if (CORBA::is_nil(myBoolOp)) {
+    myBoolOp = myGeomEngine->GetIBooleanOperations();
   }
 }
 
@@ -283,11 +228,8 @@ void GEOM_Superv_i::getInsOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_IInsertOperations interface
-  if (CORBA::is_nil(myInsOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myInsOp = myGeomEngine->GetIInsertOperations(myStudyID);
+  if (CORBA::is_nil(myInsOp)) {
+    myInsOp = myGeomEngine->GetIInsertOperations();
   }
 }
 
@@ -299,11 +241,8 @@ void GEOM_Superv_i::getTransfOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_ITransformOperations interface
-  if (CORBA::is_nil(myTransfOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myTransfOp = myGeomEngine->GetITransformOperations(myStudyID);
+  if (CORBA::is_nil(myTransfOp)) {
+    myTransfOp = myGeomEngine->GetITransformOperations();
   }
 }
 
@@ -315,11 +254,8 @@ void GEOM_Superv_i::getShapesOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_IShapesOperations interface
-  if (CORBA::is_nil(myShapesOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myShapesOp = myGeomEngine->GetIShapesOperations(myStudyID);
+  if (CORBA::is_nil(myShapesOp)) {
+    myShapesOp = myGeomEngine->GetIShapesOperations();
   }
 }
 
@@ -331,11 +267,8 @@ void GEOM_Superv_i::getBlocksOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_IBlocksOperations interface
-  if (CORBA::is_nil(myBlocksOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myBlocksOp = myGeomEngine->GetIBlocksOperations(myStudyID);
+  if (CORBA::is_nil(myBlocksOp)) {
+    myBlocksOp = myGeomEngine->GetIBlocksOperations();
   }
 }
 
@@ -347,11 +280,8 @@ void GEOM_Superv_i::getCurvesOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_ICurvesOperations interface
-  if (CORBA::is_nil(myCurvesOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myCurvesOp = myGeomEngine->GetICurvesOperations(myStudyID);
+  if (CORBA::is_nil(myCurvesOp)) {
+    myCurvesOp = myGeomEngine->GetICurvesOperations();
   }
 }
 
@@ -363,11 +293,8 @@ void GEOM_Superv_i::getLocalOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_ILocalOperations interface
-  if (CORBA::is_nil(myLocalOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myLocalOp = myGeomEngine->GetILocalOperations(myStudyID);
+  if (CORBA::is_nil(myLocalOp)) {
+    myLocalOp = myGeomEngine->GetILocalOperations();
   }
 }
 
@@ -379,11 +306,8 @@ void GEOM_Superv_i::getGroupOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM_IGroupOperations interface
-  if (CORBA::is_nil(myGroupOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myGroupOp = myGeomEngine->GetIGroupOperations(myStudyID);
+  if (CORBA::is_nil(myGroupOp)) {
+    myGroupOp = myGeomEngine->GetIGroupOperations();
   }
 }
 
@@ -395,11 +319,8 @@ void GEOM_Superv_i::getAdvancedOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM::IAdvancedOperations interface
-  if (CORBA::is_nil(myAdvancedOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "AdvancedEngine"));
+  if (CORBA::is_nil(myAdvancedOp)) {
+    myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations("AdvancedEngine"));
   }
 }
 
@@ -411,11 +332,8 @@ void GEOM_Superv_i::getSTLPluginOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM::ISTLOperations interface
-  if (CORBA::is_nil(mySTLOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    mySTLOp = GEOM::ISTLOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "STLPluginEngine"));
+  if (CORBA::is_nil(mySTLOp)) {
+    mySTLOp = GEOM::ISTLOperations::_narrow(myGeomEngine->GetPluginOperations("STLPluginEngine"));
   }
 }
 
@@ -427,11 +345,8 @@ void GEOM_Superv_i::getBREPPluginOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM:IBREPOperations interface
-  if (CORBA::is_nil(myBREPOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myBREPOp = GEOM::IBREPOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "BREPPluginEngine"));
+  if (CORBA::is_nil(myBREPOp)) {
+    myBREPOp = GEOM::IBREPOperations::_narrow(myGeomEngine->GetPluginOperations("BREPPluginEngine"));
   }
 }
 
@@ -443,11 +358,8 @@ void GEOM_Superv_i::getSTEPPluginOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM::ISTEPOperations interface
-  if (CORBA::is_nil(mySTEPOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    mySTEPOp = GEOM::ISTEPOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "STEPPluginEngine"));
+  if (CORBA::is_nil(mySTEPOp)) {
+    mySTEPOp = GEOM::ISTEPOperations::_narrow(myGeomEngine->GetPluginOperations("STEPPluginEngine"));
   }
 }
 
@@ -459,11 +371,8 @@ void GEOM_Superv_i::getIGESPluginOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM::IIGESOperations interface
-  if (CORBA::is_nil(myIGESOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myIGESOp = GEOM::IIGESOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "IGESPluginEngine"));
+  if (CORBA::is_nil(myIGESOp)) {
+    myIGESOp = GEOM::IIGESOperations::_narrow(myGeomEngine->GetPluginOperations("IGESPluginEngine"));
   }
 }
 
@@ -475,14 +384,12 @@ void GEOM_Superv_i::getXAOPluginOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM::IXAOOperations interface
-  if (CORBA::is_nil(myXAOOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myXAOOp = GEOM::IXAOOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "XAOPluginEngine"));
+  if (CORBA::is_nil(myXAOOp)) {
+    myXAOOp = GEOM::IXAOOperations::_narrow(myGeomEngine->GetPluginOperations("XAOPluginEngine"));
   }
 }
 
+#ifdef WITH_VTK
 //=============================================================================
 //  getVTKPluginOp:
 //=============================================================================
@@ -491,13 +398,11 @@ void GEOM_Superv_i::getVTKPluginOp()
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
   // get GEOM::IVTKOperations interface
-  if (CORBA::is_nil(myVTKOp) || isNewStudy(myLastStudyID,myStudyID)) {
-    //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
-    //     Try to get id of the study from the SALOME Session
-    if(myStudyID < 0 ) SetStudyID(-1);
-    myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine"));
+  if (CORBA::is_nil(myVTKOp)) {
+    myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations("VTKPluginEngine"));
   }
 }
+#endif
 
 //=============================================================================
 //  GetServant:
@@ -514,9 +419,9 @@ PortableServer::ServantBase_var GEOM_Superv_i::GetServant(CORBA::Object_ptr
 // function : Save()
 // purpose  : save OCAF/Geom document
 //============================================================================
-SALOMEDS::TMPFile* GEOM_Superv_i::Save(SALOMEDS::SComponent_ptr theComponent,
-                                       const char* theURL,
-                                       CORBA::Boolean isMultiFile)
+SALOMEDS::TMPFile* GEOM_Superv_i::Save(SALOMEDS::SComponent_ptr /*theComponent*/,
+                                       const char* /*theURL*/,
+                                       CORBA::Boolean /*isMultiFile*/)
 {
   SALOMEDS::TMPFile_var aStreamFile;
   return aStreamFile._retn();
@@ -526,9 +431,9 @@ SALOMEDS::TMPFile* GEOM_Superv_i::Save(SALOMEDS::SComponent_ptr theComponent,
 // function : SaveASCII()
 // purpose  :
 //============================================================================
-SALOMEDS::TMPFile* GEOM_Superv_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
-                                            const char* theURL,
-                                            CORBA::Boolean isMultiFile)
+SALOMEDS::TMPFile* GEOM_Superv_i::SaveASCII(SALOMEDS::SComponent_ptr /*theComponent*/,
+                                            const char* /*theURL*/,
+                                            CORBA::Boolean /*isMultiFile*/)
 {
   SALOMEDS::TMPFile_var aStreamFile;
   return aStreamFile._retn();
@@ -538,10 +443,10 @@ SALOMEDS::TMPFile* GEOM_Superv_i::SaveASCII(SALOMEDS::SComponent_ptr theComponen
 // function : Load()
 // purpose  :
 //============================================================================
-CORBA::Boolean GEOM_Superv_i::Load(SALOMEDS::SComponent_ptr theComponent,
-                                   const SALOMEDS::TMPFile& theStream,
-                                   const char* theURL,
-                                   CORBA::Boolean isMultiFile)
+CORBA::Boolean GEOM_Superv_i::Load(SALOMEDS::SComponent_ptr /*theComponent*/,
+                                   const SALOMEDS::TMPFile& /*theStream*/,
+                                   const char* /*theURL*/,
+                                   CORBA::Boolean /*isMultiFile*/)
 {
   return false;
 }
@@ -550,10 +455,10 @@ CORBA::Boolean GEOM_Superv_i::Load(SALOMEDS::SComponent_ptr theComponent,
 // function : LoadASCII()
 // purpose  :
 //============================================================================
-CORBA::Boolean GEOM_Superv_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
-                                        const SALOMEDS::TMPFile& theStream,
-                                        const char* theURL,
-                                        CORBA::Boolean isMultiFile)
+CORBA::Boolean GEOM_Superv_i::LoadASCII(SALOMEDS::SComponent_ptr /*theComponent*/,
+                                        const SALOMEDS::TMPFile& /*theStream*/,
+                                        const char* /*theURL*/,
+                                        CORBA::Boolean /*isMultiFile*/)
 {
   return false;
 }
@@ -562,7 +467,7 @@ CORBA::Boolean GEOM_Superv_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
 // function : Close()
 // purpose  :
 //============================================================================
-void GEOM_Superv_i::Close(SALOMEDS::SComponent_ptr theComponent)
+void GEOM_Superv_i::Close(SALOMEDS::SComponent_ptr /*theComponent*/)
 {
 }
 
@@ -579,10 +484,10 @@ char* GEOM_Superv_i::ComponentDataType()
 // function : IORToLocalPersistentID()
 // purpose  :
 //============================================================================
-char* GEOM_Superv_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
-                                            const char* IORString,
-                                            CORBA::Boolean isMultiFile,
-                                            CORBA::Boolean isASCII)
+char* GEOM_Superv_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr /*theSObject*/,
+                                            const char* /*IORString*/,
+                                            CORBA::Boolean /*isMultiFile*/,
+                                            CORBA::Boolean /*isASCII*/)
 {
   return 0;
 }
@@ -593,10 +498,10 @@ char* GEOM_Superv_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
 //          : Used when a study is loaded
 //          : The IOR (IORName) of object created is returned
 //============================================================================
-char* GEOM_Superv_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
-                                            const char* aLocalPersistentID,
-                                            CORBA::Boolean isMultiFile,
-                                            CORBA::Boolean isASCII)
+char* GEOM_Superv_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr /*theSObject*/,
+                                            const char* /*aLocalPersistentID*/,
+                                            CORBA::Boolean /*isMultiFile*/,
+                                            CORBA::Boolean /*isASCII*/)
 {
   return 0;
 }
@@ -616,14 +521,13 @@ CORBA::Boolean GEOM_Superv_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
 // function : PublishInStudy
 // purpose  :
 //============================================================================
-SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
-                                                    SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
                                                     CORBA::Object_ptr theObject,
-                                                    const char* theName) throw (SALOME::SALOME_Exception)
+                                                    const char* theName) 
 {
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
-  return myGeomEngine->PublishInStudy(theStudy, theSObject, theObject, theName);
+  return myGeomEngine->PublishInStudy(theSObject, theObject, theName);
 }
 
 //============================================================================
@@ -631,20 +535,19 @@ SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::Study_ptr theStudy
 // purpose  :
 //============================================================================
 GEOM::ListOfGO*
-GEOM_Superv_i::PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
-                                         //SALOMEDS::SObject_ptr theSObject,
+GEOM_Superv_i::PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject,
                                          CORBA::Object_ptr theObject)
 {
   if (CORBA::is_nil(myGeomEngine))
     setGeomEngine();
-  return myGeomEngine->PublishNamedShapesInStudy(theStudy, theObject);
+  return myGeomEngine->PublishNamedShapesInStudy(theObject);
 }
 
 //============================================================================
 // function : CanCopy()
 // purpose  :
 //============================================================================
-CORBA::Boolean GEOM_Superv_i::CanCopy(SALOMEDS::SObject_ptr theObject)
+CORBA::Boolean GEOM_Superv_i::CanCopy(SALOMEDS::SObject_ptr /*theObject*/)
 {
   return false;
 }
@@ -653,7 +556,7 @@ CORBA::Boolean GEOM_Superv_i::CanCopy(SALOMEDS::SObject_ptr theObject)
 // function : CopyFrom()
 // purpose  :
 //============================================================================
-SALOMEDS::TMPFile* GEOM_Superv_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID)
+SALOMEDS::TMPFile* GEOM_Superv_i::CopyFrom(SALOMEDS::SObject_ptr /*theObject*/, CORBA::Long& /*theObjectID*/)
 {
   SALOMEDS::TMPFile_var aStreamFile;
   return aStreamFile._retn();
@@ -663,7 +566,7 @@ SALOMEDS::TMPFile* GEOM_Superv_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORB
 // function : CanPaste()
 // purpose  :
 //============================================================================
-CORBA::Boolean GEOM_Superv_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID)
+CORBA::Boolean GEOM_Superv_i::CanPaste(const char* /*theComponentName*/, CORBA::Long /*theObjectID*/)
 {
   return false;
 }
@@ -672,9 +575,9 @@ CORBA::Boolean GEOM_Superv_i::CanPaste(const char* theComponentName, CORBA::Long
 // function : PasteInto()
 // purpose  :
 //============================================================================
-SALOMEDS::SObject_ptr GEOM_Superv_i::PasteInto(const SALOMEDS::TMPFile& theStream,
-                                               CORBA::Long theObjectID,
-                                               SALOMEDS::SObject_ptr theObject)
+SALOMEDS::SObject_ptr GEOM_Superv_i::PasteInto(const SALOMEDS::TMPFile& /*theStream*/,
+                                               CORBA::Long /*theObjectID*/,
+                                               SALOMEDS::SObject_ptr /*theObject*/)
 {
   SALOMEDS::SObject_var aNewSO;
   return aNewSO._retn();
@@ -2061,7 +1964,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShape (GEOM::GEOM_Object_ptr theObjec
   beginService( " GEOM_Superv_i::OffsetShape" );
   MESSAGE("GEOM_Superv_i::OffsetShape");
   getTransfOp();
-  GEOM::GEOM_Object_ptr anObj = myTransfOp->OffsetShape(theObject, theOffset);
+  GEOM::GEOM_Object_ptr anObj = myTransfOp->OffsetShape(theObject, theOffset, true);
   endService( " GEOM_Superv_i::OffsetShape" );
   return anObj;
 }
@@ -2075,7 +1978,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theO
   beginService( " GEOM_Superv_i::OffsetShapeCopy" );
   MESSAGE("GEOM_Superv_i::OffsetShapeCopy");
   getTransfOp();
-  GEOM::GEOM_Object_ptr anObj = myTransfOp->OffsetShapeCopy(theObject, theOffset);
+  GEOM::GEOM_Object_ptr anObj = myTransfOp->OffsetShapeCopy(theObject, theOffset, true);
   endService( " GEOM_Superv_i::OffsetShapeCopy" );
   return anObj;
 }
@@ -3512,14 +3415,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportSTL( const char* theFileName )
   MESSAGE("GEOM_Superv_i::ImportSTL");
   getSTLPluginOp();
   GEOM::ListOfGO* aSeq = mySTLOp->ImportSTL(theFileName );
-  GEOM::GEOM_Object_ptr anObj;
+  GEOM::GEOM_Object_var anObj;
 
   if (aSeq->length() > 0) {
     anObj = aSeq->operator[](0);
   }
 
   endService( " GEOM_Superv_i::ImportSTL" );
-  return anObj;
+  return anObj._retn();
 }
 
 //=============================================================================
@@ -3544,14 +3447,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportBREP( const char* theFileName )
   MESSAGE("GEOM_Superv_i::ImportBREP");
   getBREPPluginOp();
   GEOM::ListOfGO* aSeq = myBREPOp->ImportBREP(theFileName );
-  GEOM::GEOM_Object_ptr anObj;
+  GEOM::GEOM_Object_var anObj;
 
   if (aSeq->length() > 0) {
     anObj = aSeq->operator[](0);
   }
 
   endService( " GEOM_Superv_i::ImportBREP" );
-  return anObj;
+  return anObj._retn();
 }
 
 //=============================================================================
@@ -3563,7 +3466,10 @@ void GEOM_Superv_i::ExportSTEP( GEOM::GEOM_Object_ptr theObject,
   beginService( " GEOM_Superv_i::ExportSTEP" );
   MESSAGE("GEOM_Superv_i::ExportSTEP");
   getSTEPPluginOp();
-  mySTEPOp->ExportSTEP( theObject, theFileName );
+
+  const GEOM::length_unit aUnit = GEOM::LU_METER;
+
+  mySTEPOp->ExportSTEP( theObject, theFileName, aUnit );
   endService( " GEOM_Superv_i::ExportSTEP" );
 }
 
@@ -3576,15 +3482,15 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportSTEP( const char* theFileName,
   beginService( " GEOM_Superv_i::ImportSTEP" );
   MESSAGE("GEOM_Superv_i::ImportSTEP");
   getSTEPPluginOp();
-  GEOM::ListOfGO* aSeq = mySTEPOp->ImportSTEP(theFileName, theIsIgnoreUnits );
-  GEOM::GEOM_Object_ptr anObj;
+  GEOM::ListOfGO* aSeq = mySTEPOp->ImportSTEP(theFileName, theIsIgnoreUnits, false );
+  GEOM::GEOM_Object_var anObj;
 
   if (aSeq->length() > 0) {
     anObj = aSeq->operator[](0);
   }
 
   endService( " GEOM_Superv_i::ImportSTEP" );
-  return anObj;
+  return anObj._retn();
 }
 
 //=============================================================================
@@ -3611,14 +3517,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportIGES( const char* theFileName,
   MESSAGE("GEOM_Superv_i::ImportIGES");
   getIGESPluginOp();
   GEOM::ListOfGO* aSeq = myIGESOp->ImportIGES(theFileName, theIsIgnoreUnits );
-  GEOM::GEOM_Object_ptr anObj;
+  GEOM::GEOM_Object_var anObj;
 
   if (aSeq->length() > 0) {
     anObj = aSeq->operator[](0);
   }
 
   endService( " GEOM_Superv_i::ImportIGES" );
-  return anObj;
+  return anObj._retn();
 }
 
 //=============================================================================
@@ -3627,12 +3533,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportIGES( const char* theFileName,
 CORBA::Boolean GEOM_Superv_i::ExportXAO( GEOM::GEOM_Object_ptr shape,
                                          const GEOM::ListOfGO& groups,
                                          const GEOM::ListOfFields& fields,
-                                         const char* author, const char* fileName )
+                                         const char* author,
+                                         const char* fileName,
+                                         const char* shapeFileName )
 {
   beginService( " GEOM_Superv_i::ExportXAO" );
   MESSAGE("GEOM_Superv_i::ExportXAO");
   getXAOPluginOp();
-  CORBA::Boolean isGood = myXAOOp->ExportXAO( shape, groups, fields, author, fileName );
+  CORBA::Boolean isGood = myXAOOp->ExportXAO( shape, groups, fields, author, fileName, shapeFileName );
   endService( " GEOM_Superv_i::ExportXAO" );
   return isGood;
 }
@@ -3640,15 +3548,16 @@ CORBA::Boolean GEOM_Superv_i::ExportXAO( GEOM::GEOM_Object_ptr shape,
 //=============================================================================
 //  Import XAO
 //=============================================================================
-CORBA::Boolean GEOM_Superv_i::ImportXAO( const char* fileName,
-                                         GEOM::GEOM_Object_out shape,
-                                         GEOM::ListOfGO_out subShapes,
-                                         GEOM::ListOfGO_out groups,
-                                         GEOM::ListOfFields_out fields )
+CORBA::Boolean GEOM_Superv_i::ImportXAO( const char* /*fileName*/,
+                                         GEOM::GEOM_Object_out /*shape*/,
+                                         GEOM::ListOfGO_out /*subShapes*/,
+                                         GEOM::ListOfGO_out /*groups*/,
+                                         GEOM::ListOfFields_out /*fields*/ )
 {
   return false;
 }
 
+
 //=============================================================================
 //  Export VTK
 //=============================================================================
@@ -3656,11 +3565,16 @@ void GEOM_Superv_i::ExportVTK(  GEOM::GEOM_Object_ptr theObject,
                                const char*           theFileName,
                                CORBA::Double         theDeflection )
 {
+  #ifdef WITH_VTK
   beginService( " GEOM_Superv_i::ExportVTK" );
   MESSAGE("GEOM_Superv_i::ExportVTK");
   getVTKPluginOp();
   myVTKOp->ExportVTK( theObject, theFileName, theDeflection );
   endService( " GEOM_Superv_i::ExportVTK" );
+#else
+  std::string message("GEOM_Superv_i::ExportVTK functionality is unavailable");
+  THROW_SALOME_CORBA_EXCEPTION(message.c_str(), SALOME::INTERNAL_ERROR);
+#endif
 }
 
 //=============================== Advanced Operations =============================