Salome HOME
IPAL54157: Empty bounding box of a non-empty mesh
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index 69a8f73b0288ff85c195d275d3bc0213627100d9..1d7301ffe8b59f524767d6d77671cbf5ea5b026a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -237,7 +237,8 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha
     if ( aClient && aClient->Find( theShape, IOR ))
     {
       CORBA::Object_var obj = GetORB()->string_to_object( IOR.ToCString() );
-      aShapeObj = GEOM::GEOM_Object::_narrow ( obj );
+      if ( !obj->_non_existent() )
+        aShapeObj = GEOM::GEOM_Object::_narrow ( obj );
     }
   }
   return aShapeObj._retn();
@@ -251,7 +252,7 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha
 TopoDS_Shape SMESH_Gen_i::GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject)
 {
   TopoDS_Shape S;
-  if ( !theGeomObject->_is_nil() ) {
+  if ( !theGeomObject->_is_nil() && !theGeomObject->_non_existent() ) {
     GEOM_Client* aClient = GetShapeReader();
     GEOM::GEOM_Gen_ptr aGeomEngine = GetGeomEngine();
     if ( aClient && !aGeomEngine->_is_nil () )