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 );
}
}
} else {
+ TopExp_Explorer anExp( aPolylineShape, TopAbs_WIRE );
for ( ; anExp.More(); anExp.Next() ) {
TopoDS_Wire aWire = TopoDS::Wire( anExp.Current() );
aWiresList.Append( aWire );
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 );
+ }
}
}