Salome HOME
Join modifications from V3_2_0_maintainance (V3_2_6pre4 - T32x_16Aug2007_16h00m)
[modules/smesh.git] / src / SMESH_I / SMESH_subMesh_i.cxx
index 4df569cb6ba46c1461f203ee2cdb73fe8365b7ce..da14ee1f78247bd32654d4f30b7d4e3b2aceabe8 100644 (file)
@@ -458,8 +458,14 @@ GEOM::GEOM_Object_ptr SMESH_subMesh_i::GetSubShape()
   try {
     if ( _mesh_i->_mapSubMesh.find( _localId ) != _mesh_i->_mapSubMesh.end()) {
       TopoDS_Shape S = _mesh_i->_mapSubMesh[ _localId ]->GetSubShape();
-      if ( !S.IsNull() )
+      if ( !S.IsNull() ) {
         aShapeObj = _gen_i->ShapeToGeomObject( S );
+       //mzn: N7PAL16232, N7PAL16233
+       //In some cases it's possible that GEOM_Client contains the shape same to S, but
+       //with another orientation.
+       if (aShapeObj->_is_nil())
+         aShapeObj = _gen_i->ShapeToGeomObject( S.Reversed() );
+      }
     }
   }
   catch(SALOME_Exception & S_ex) {