X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSTLPlugin%2FSTLPlugin_OperationsCreator.cxx;h=401dbff865af69498bd2946b3481ec8593783953;hb=c4999d16551e5ac1eae8329faf1ab65cf023a844;hp=f2a47a07b9ce04aa58ffad73399f37ecc5dca18e;hpb=aeddae77192d933be1aee8855d8f7c525878cad9;p=modules%2Fgeom.git diff --git a/src/STLPlugin/STLPlugin_OperationsCreator.cxx b/src/STLPlugin/STLPlugin_OperationsCreator.cxx index f2a47a07b..401dbff86 100644 --- a/src/STLPlugin/STLPlugin_OperationsCreator.cxx +++ b/src/STLPlugin/STLPlugin_OperationsCreator.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2014-2016 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 STLPlugin_OperationsCreator::_mapOfOperations; +STLPlugin_IOperations* STLPlugin_OperationsCreator::_operation; STLPlugin_OperationsCreator::STLPlugin_OperationsCreator() { @@ -53,19 +53,17 @@ STLPlugin_OperationsCreator::~STLPlugin_OperationsCreator() } GEOM_IOperations_i* STLPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ) { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "STLPlugin_OperationsCreator::Create" ); - return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); + return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, - int theStudyId ) +STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) - _mapOfOperations[theStudyId] = new STLPlugin_IOperations( theGenImpl, theStudyId ); - return _mapOfOperations[theStudyId]; + if( !_operation ) + _operation = new STLPlugin_IOperations( theGenImpl ); + return _operation; }