]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOM_I/GEOM_Gen_i.cc
Salome HOME
bos #29469: Advanced geometry features: Detect type of shape
[modules/geom.git] / src / GEOM_I / GEOM_Gen_i.cc
index 2f8c4882d7a8335433b3af337d65fa8d4fcc2691..00e58ed8af2e1fde929ea9b27e1c8f4ad561c5a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  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
@@ -98,13 +98,12 @@ GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr            orb,
                        PortableServer::POA_ptr   poa,
                        PortableServer::ObjectId* contId,
                        const char*               instanceName,
-                       const char*               interfaceName) :
-  Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
+                       const char*               interfaceName,
+                       bool withRegistry) :
+  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, withRegistry)
 {
   _thisObj = this;
   _id = _poa->activate_object(_thisObj);
-  name_service = new SALOME_NamingService(_orb);
-
   _impl = new ::GEOMImpl_Gen;
 
   //PAL10867: disable signals catching with "noexcepthandler" option
@@ -140,10 +139,8 @@ GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr            orb,
 // purpose  : destructor
 //============================================================================
 GEOM_Gen_i::~GEOM_Gen_i() {
-  delete name_service;
   delete _impl;
-  std::map<std::string, GEOM_GenericOperationsCreator*>::const_iterator it;
-  for ( it = myOpCreatorMap.begin(); it != myOpCreatorMap.end(); ++it)
+  for (auto it = myOpCreatorMap.cbegin(); it != myOpCreatorMap.cend(); ++it)
     delete (*it).second;
 }
 
@@ -2155,30 +2152,6 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr
   return aParts._retn();
 }
 
-//============================================================================
-// function : register()
-// purpose  : register 'name' in 'name_service'
-//============================================================================
-void GEOM_Gen_i::register_name(char * name)
-{
-  GEOM::GEOM_Gen_var g = _this();
-  name_service->Register(g, name);
-}
-
-//============================================================================
-// function : getStudyServant()
-// purpose  : Get Study
-//============================================================================
-SALOMEDS::Study_var GEOM_Gen_i::getStudyServant()
-{
-  static SALOMEDS::Study_var aStudy;
-  if(CORBA::is_nil(aStudy)){
-    CORBA::Object_ptr anObject = name_service->Resolve("/Study");
-    aStudy = SALOMEDS::Study::_narrow(anObject);
-  }
-  return aStudy;
-}
-
 //============================================================================
 // function : findOrCreateComponent()
 // purpose  : Find root study component; create if it does not exist
@@ -2493,6 +2466,44 @@ GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations()
   return operations._retn();
 }
 
+//============================================================================
+// function : GetITestOperations
+// purpose  :
+//============================================================================
+GEOM::GEOM_ITestOperations_ptr GEOM_Gen_i::GetITestOperations()
+{
+  Unexpect aCatch(SALOME_SalomeException);
+  MESSAGE( "GEOM_Gen_i::GetITestOperations" );
+
+  GEOM::GEOM_Gen_ptr engine = _this();
+
+  GEOM_ITestOperations_i* aServant =
+    new GEOM_ITestOperations_i(_poa, engine, _impl->GetITestOperations());
+
+  // activate the CORBA servant
+  GEOM::GEOM_ITestOperations_var operations = aServant->_this();
+  return operations._retn();
+}
+
+//============================================================================
+// function : GetICanonicalRecognition
+// purpose  :
+//============================================================================
+GEOM::GEOM_ICanonicalRecognition_ptr GEOM_Gen_i::GetICanonicalRecognition()
+{
+  Unexpect aCatch(SALOME_SalomeException);
+  MESSAGE("GEOM_Gen_i::GetICanonicalRecognition");
+
+  GEOM::GEOM_Gen_ptr engine = _this();
+
+  GEOM_ICanonicalRecognition_i* aServant =
+    new GEOM_ICanonicalRecognition_i(_poa, engine, _impl->GetICanonicalRecognition());
+
+  // activate the CORBA servant
+  GEOM::GEOM_ICanonicalRecognition_var operations = aServant->_this();
+  return operations._retn();
+}
+
 //============================================================================
 // function : GetPluginOperations
 // purpose  :
@@ -3351,24 +3362,4 @@ void GEOM_Gen_i::includeSubObjects(const std::string& aSelectedEntry,
     includeSubObjects( aSubEntryStr, aSelected, aParents, aChildren, anOthers );
   }
 }
-//=====================================================================================
-// EXPORTED METHODS
-//=====================================================================================
-extern "C"
-{
-  /*
-  GEOM_I_EXPORT
-  PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB*, PortableServer::POA*, PortableServer::ObjectId*, const char*, const char*);
-  */
-
-  GEOM_I_EXPORT
-  PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB_ptr            orb,
-                                               PortableServer::POA_ptr   poa,
-                                               PortableServer::ObjectId* contId,
-                                               const char*               instanceName,
-                                               const char*               interfaceName)
-  {
-    GEOM_Gen_i* myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName);
-    return myGEOM_Gen_i->getId();
-  }
-}
+