X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_IGESImport.cpp;h=79830e43f221a0ec7b79b3de7f4699ba767ad515;hb=b2a662eec6a0258d51a67ee7e341541e7a710752;hp=872d8b3f5a7339521e3e044ff8332c30934a9d2d;hpb=0479361746467f244b7ccfd1d25443677bdea8a6;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp index 872d8b3f5..79830e43f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp @@ -1,7 +1,13 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// File: GEOMALGOAPI_IGESImport.cpp +// Created: May 14, 2015 +// Author: Sergey POKHODENKO + #include +#include + // OOCT includes #include #include @@ -11,14 +17,14 @@ * */ //============================================================================= -TopoDS_Shape IGESImport(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() ); @@ -33,7 +39,7 @@ TopoDS_Shape IGESImport(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) { @@ -53,14 +59,16 @@ TopoDS_Shape IGESImport(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; }