X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_IGESImport.cpp;h=f9f9cdfb418d2ab06c554340b5f4f2e106c5dabe;hb=665435f0512e2f26abdbe7832b90af6f560b6451;hp=b15b0d19e63504d4b020190d94298d1531b657b7;hpb=2dd4d315bde6af849d68f1d3cd190ac3ec219527;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp index b15b0d19e..f9f9cdfb4 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp @@ -1,7 +1,27 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include +#include + // OOCT includes #include #include @@ -11,16 +31,14 @@ * */ //============================================================================= -namespace IGESImport { - -TopoDS_Shape Import(const std::string& theFileName, - const std::string&, - std::string& theError) +std::shared_ptr IGESImport(const std::string& theFileName, + const std::string&, + std::string& theError) { #ifdef _DEBUG std::cout << "Import IGES from file " << theFileName << std::endl; #endif - TopoDS_Shape aResShape; + TopoDS_Shape aShape; IGESControl_Reader aReader; try { IFSelect_ReturnStatus status = aReader.ReadFile( theFileName.c_str() ); @@ -35,7 +53,7 @@ TopoDS_Shape Import(const std::string& theFileName, #ifdef _DEBUG std::cout << "ImportIGES : count of shapes produced = " << aReader.NbShapes() << std::endl; #endif - aResShape = aReader.OneShape(); + aShape = aReader.OneShape(); } else { switch (status) { @@ -55,16 +73,16 @@ TopoDS_Shape Import(const std::string& theFileName, theError = "Wrong format of the imported file. Can't import file."; break; } - aResShape.Nullify(); + aShape.Nullify(); } } catch( Standard_Failure ) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); theError = aFail->GetMessageString(); - aResShape.Nullify(); + aShape.Nullify(); } - return aResShape; + std::shared_ptr aGeomShape(new GeomAPI_Shape); + aGeomShape->setImpl(new TopoDS_Shape(aShape)); + return aGeomShape; } - -} // namespace IGESImport