Salome HOME
updated copyright message
[modules/geom.git] / src / AdvancedEngine / AdvancedEngine_OperationsCreator.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "AdvancedEngine_OperationsCreator.hxx"
24 #include "AdvancedEngine_IOperations_i.hh"
25 #include "AdvancedEngine_IOperations.hxx"
26 #include <AdvancedEngine_PipeTShapeDriver.hxx>
27 #include <AdvancedEngine_DividedDiskDriver.hxx>
28 #include <AdvancedEngine_SmoothingSurfaceDriver.hxx>
29
30 #include <TFunction_Driver.hxx>
31 #include <TFunction_DriverTable.hxx>
32
33 #include "Utils_ExceptHandlers.hxx"
34 #include "utilities.h"
35
36 AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::_operation;
37
38 AdvancedEngine_OperationsCreator::AdvancedEngine_OperationsCreator()
39 {
40   // Register drivers
41   TFunction_DriverTable::Get()->AddDriver(AdvancedEngine_PipeTShapeDriver::GetID(),
42                                           new AdvancedEngine_PipeTShapeDriver());
43   TFunction_DriverTable::Get()->AddDriver(AdvancedEngine_DividedDiskDriver::GetID(),
44                                           new AdvancedEngine_DividedDiskDriver());
45   TFunction_DriverTable::Get()->AddDriver(AdvancedEngine_SmoothingSurfaceDriver::GetID(),
46                                           new AdvancedEngine_SmoothingSurfaceDriver());
47 }
48
49 AdvancedEngine_OperationsCreator::~AdvancedEngine_OperationsCreator()
50 {
51 }
52
53 GEOM_IOperations_i* AdvancedEngine_OperationsCreator::Create (PortableServer::POA_ptr thePOA,
54                                                               GEOM::GEOM_Gen_ptr      theEngine,
55                                                               ::GEOMImpl_Gen*         theGenImpl)
56 {
57   Unexpect aCatch(SALOME_SalomeException);
58   MESSAGE( "AdvancedEngine_OperationsCreator::Create" );
59   return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
60 }
61
62 AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
63 {
64   if( !_operation )
65     _operation = new AdvancedEngine_IOperations( theGenImpl );
66   return _operation;
67 }