From 3e4f95964ec40b3f28da8a8a58c9a2fb53b72799 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 21 Jun 2012 11:04:58 +0000 Subject: [PATCH] 0021678: [CEA 567] import stp ou wrong stp files Report an error in a file contains no geometrical information --- src/STEPImport/STEPImport.cxx | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) 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); -- 2.39.2