From: mzn Date: Fri, 22 Nov 2013 07:34:41 +0000 (+0000) Subject: Bugs 113, 114: if the immersible zone is a compound of faces - create split data... X-Git-Tag: BR_hydro_v_0_3_1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf760f54f1c4db789f50f25bff055eb6127f81db;p=modules%2Fhydro.git Bugs 113, 114: if the immersible zone is a compound of faces - create split data for each face contained in the compound. --- diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 05a46823..c31dac11 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -83,8 +83,8 @@ TopoDS_Shape HYDROData_ImmersibleZone::GetTopShape() const TopoDS_Shape aPolylineShape = aPolyline->GetTopShape(); TopTools_ListOfShape aWiresList; - TopExp_Explorer anExp( aPolylineShape, TopAbs_WIRE ); - if ( !anExp.More() ) { + if ( !aPolylineShape.IsNull() && + aPolylineShape.ShapeType() == TopAbs_WIRE ) { TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape ); if ( !aPolylineWire.IsNull() ) { BRepBuilderAPI_MakeFace aMakeFace( aPolylineWire, Standard_True ); @@ -94,6 +94,7 @@ TopoDS_Shape HYDROData_ImmersibleZone::GetTopShape() const } } } else { + TopExp_Explorer anExp( aPolylineShape, TopAbs_WIRE ); for ( ; anExp.More(); anExp.Next() ) { TopoDS_Wire aWire = TopoDS::Wire( anExp.Current() ); aWiresList.Append( aWire ); diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.cxx b/src/HYDROData/HYDROData_SplitToZonesTool.cxx index 2e29c18e..24e53396 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.cxx +++ b/src/HYDROData/HYDROData_SplitToZonesTool.cxx @@ -48,8 +48,21 @@ HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& the Handle(HYDROData_Object)::DownCast( theObjectList.Value( anIndex ) ); if( !aGeomObj.IsNull() ) { - SplitData aSplitData( aGeomObj->GetTopShape(), aGeomObj->GetName() ); - anInputSplitDataList.append( aSplitData ); + TopoDS_Shape aShape = aGeomObj->GetTopShape(); + if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND ) { + // Create split data for each face contained in the compound + TopExp_Explorer anExp( aShape, TopAbs_FACE ); + for ( ; anExp.More(); anExp.Next() ) { + TopoDS_Face aFace = TopoDS::Face( anExp.Current() ); + if ( !aFace.IsNull() ) { + SplitData aSplitData( aFace, aGeomObj->GetName() ); + anInputSplitDataList.append( aSplitData ); + } + } + } else { + SplitData aSplitData( aShape, aGeomObj->GetName() ); + anInputSplitDataList.append( aSplitData ); + } } }