X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBREPPlugin%2FBREPPlugin_OperationsCreator.cxx;h=fd8cdb15eef73af2bdef2e23275f4d58d8cba89e;hb=d6f16273ade8fc4eba4d41c1ffa0d5d79baaf47b;hp=27808c748fd0e08e6a125338913aec5cdd0abdbb;hpb=6f000dfe28cad33bcf7053913e1a2f24b3fa3e33;p=modules%2Fgeom.git diff --git a/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx b/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx index 27808c748..fd8cdb15e 100644 --- a/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx +++ b/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx @@ -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 @@ -32,7 +32,7 @@ // OCCT includes #include -std::map BREPPlugin_OperationsCreator::_mapOfOperations; +BREPPlugin_IOperations* BREPPlugin_OperationsCreator::_operation; BREPPlugin_OperationsCreator::BREPPlugin_OperationsCreator() { @@ -51,19 +51,17 @@ BREPPlugin_OperationsCreator::~BREPPlugin_OperationsCreator() } GEOM_IOperations_i* BREPPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "BREPPlugin_OperationsCreator::Create" ); - return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new BREPPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new BREPPlugin_IOperations( theGenImpl ); + return _operation; }