From: isn Date: Thu, 19 Nov 2015 12:24:29 +0000 (+0300) Subject: refs #724 X-Git-Tag: v1.5~14^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e283d8eb2b1910720879128e8aeae69d559a596;p=modules%2Fhydro.git refs #724 --- diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index ac6a787c..9d9d21e5 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -469,10 +469,25 @@ bool HYDROData_LandCoverMap::Add( const Handle( HYDROData_Object )& theObject, c return false; TopoDS_Shape aShape = theObject->GetTopShape(); - if( aShape.ShapeType()!=TopAbs_FACE ) - return false; + TopoDS_Face aFace; - TopoDS_Face aFace = TopoDS::Face( aShape ); + if( aShape.ShapeType() ==TopAbs_FACE ) + { + aFace = TopoDS::Face(aShape); + } + else if ( aShape.ShapeType() ==TopAbs_COMPOUND ) + { + TopoDS_Iterator It(aShape); + for (; It.More(); It.Next()) + if (It.Value().ShapeType() == TopAbs_FACE) + { + aFace = TopoDS::Face(It.Value()); + break; + } + } + + if (aFace.IsNull()) + return false; return LocalPartition( aFace, theType ); }