X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_XAOImport.cpp;h=7647f71227d11368c6f34ad96ab366005e3c30e2;hb=2e672b9dcc8e975fa44f6bd687a47a298b152826;hp=1440c8142503e8284ae24a4bf4cb336fd257be1a;hpb=081612e9534dedf1c51b7c22f2fe2b467e5a112f;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_XAOImport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_XAOImport.cpp index 1440c8142..7647f7122 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_XAOImport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_XAOImport.cpp @@ -6,8 +6,6 @@ #include -#include - #include #include @@ -19,20 +17,21 @@ */ //============================================================================= std::shared_ptr XAOImport(const std::string& theFileName, - const std::string&, std::string& theError, XAO::Xao* theXao) { - assert(theXao); - #ifdef _DEBUG std::cout << "Import XAO from file " << theFileName << std::endl; #endif + if (theFileName.empty() || !theXao) { + theError = "An invalid argument."; + return std::shared_ptr(); + } + TopoDS_Shape aShape; try { -// XAO::Xao aXao; - if (XAO::XaoExporter::readFromFile(theFileName, theXao/*&aXao*/)) { - XAO::Geometry* aGeometry = /*aXao*/theXao->getGeometry(); + if (XAO::XaoExporter::readFromFile(theFileName, theXao)) { + XAO::Geometry* aGeometry = theXao->getGeometry(); XAO::Format aFormat = aGeometry->getFormat(); if (aFormat == XAO::BREP) { if (XAO::BrepGeometry* aBrepGeometry = dynamic_cast(aGeometry))