]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #724
authorisn <isn@opencascade.com>
Thu, 19 Nov 2015 12:24:29 +0000 (15:24 +0300)
committerisn <isn@opencascade.com>
Thu, 19 Nov 2015 12:24:29 +0000 (15:24 +0300)
src/HYDROData/HYDROData_LandCoverMap.cxx

index ac6a787cdd2f20fc116335794fc6a637a65e7c3f..9d9d21e5e063dfc8e8bf0c6f5fe2ddbf55cfb564 100644 (file)
@@ -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 );
 }