X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_ImportFeature.cpp;h=a0e7ebaaf1fd5faf309e0069699598563b43a292;hb=1490e92974d2c0bdcdbecd6fa9388e31dccfa363;hp=adc678657a778b0a92b77a9510d30607aab369f1;hpb=0479361746467f244b7ccfd1d25443677bdea8a6;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index adc678657..a0e7ebaaf 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -17,13 +17,12 @@ #include #include +#include #include #include #include #include -#include - #include #include #ifdef _DEBUG @@ -79,16 +78,16 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) // Perform the import std::string anError; - TopoDS_Shape aShape; + std::shared_ptr aGeomShape; if (anExtension == "BREP" || anExtension == "BRP") { - aShape = BREPImport(theFileName, anExtension, anError); + aGeomShape = BREPImport(theFileName, anExtension, anError); } else if (anExtension == "STEP" || anExtension == "STP") { - aShape = STEPImport(theFileName, anExtension, anError); + aGeomShape = STEPImport(theFileName, anExtension, anError); } else if (anExtension == "IGES" || anExtension == "IGS") { - aShape = IGESImport(theFileName, anExtension, anError); + aGeomShape = IGESImport(theFileName, anExtension, anError); } // Check if shape is valid - if ( aShape.IsNull() ) { + if ( aGeomShape->isNull() ) { const static std::string aShapeError = "An error occurred while importing " + theFileName + ": " + anError; setError(aShapeError); @@ -99,8 +98,6 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) std::string anObjectName = GeomAlgoAPI_Tools::File_Tools::name(theFileName); data()->setName(anObjectName); std::shared_ptr aResultBody = document()->createBody(data()); - std::shared_ptr aGeomShape(new GeomAPI_Shape); - aGeomShape->setImpl(new TopoDS_Shape(aShape)); //LoadNamingDS of the imported shape loadNamingDS(aGeomShape, aResultBody);