Salome HOME
bos #29484 Merge branch 'vsr/29484'
[modules/geom.git] / src / XAOPlugin / XAOPlugin_OperationsCreator.cxx
index 21827c0be95d9ec3ad2cfa530298f77a2d143240..ad666c8df63abae8ba1d40e685c401081ba0fbed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2021  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
@@ -31,7 +31,7 @@
 // OCCT includes
 #include <TFunction_DriverTable.hxx>
 
-std::map <int, XAOPlugin_IOperations*> XAOPlugin_OperationsCreator::_mapOfOperations;
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::_operation;
 
 XAOPlugin_OperationsCreator::XAOPlugin_OperationsCreator()
 {
@@ -48,19 +48,17 @@ XAOPlugin_OperationsCreator::~XAOPlugin_OperationsCreator()
 }
 
 GEOM_IOperations_i* XAOPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
-                                                         int                     theStudyId,
                                                          GEOM::GEOM_Gen_ptr      theEngine,
                                                          ::GEOMImpl_Gen*         theGenImpl )
 {
   Unexpect aCatch( SALOME_SalomeException );
   MESSAGE( "XAOPlugin_OperationsCreator::Create" );
-  return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+  return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
 }
 
-XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
-                                                        int             theStudyId )
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
 {
-  if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
-    _mapOfOperations[theStudyId] = new XAOPlugin_IOperations( theGenImpl, theStudyId );
-  return _mapOfOperations[theStudyId];
+  if( !_operation )
+    _operation = new XAOPlugin_IOperations( theGenImpl );
+  return _operation;
 }