From: eap Date: Thu, 21 Jun 2012 11:04:58 +0000 (+0000) Subject: 0021678: [CEA 567] import stp ou wrong stp files X-Git-Tag: V6_6_0a1~107 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e4f95964ec40b3f28da8a8a58c9a2fb53b72799;p=modules%2Fgeom.git 0021678: [CEA 567] import stp ou wrong stp files Report an error in a file contains no geometrical information --- diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index 3b51c6e57..f3f0c06c1 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -27,42 +27,35 @@ #include "utilities.h" #include - #include #include - #include - +#include +#include #include +#include #include #include -#include -#include -#include -#include -#include #include - -#include -#include -#include -#include -#include - +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include - -#include #include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include #include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC @@ -171,6 +164,13 @@ extern "C" if (aResShape.IsNull()) aResShape = compound; + // Check if any BRep entity has been read, there must be at least a vertex + if ( !TopExp_Explorer( aResShape, TopAbs_VERTEX ).More() ) + { + theError = "No geometrical data in the imported file."; + return TopoDS_Shape(); + } + // BEGIN: Store names of sub-shapes from file TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(aResShape, anIndices);