+void HYDROData_ImmersibleZone::createGroupObjects()
+{
+ TopoDS_Shape aZoneShape = GetTopShape();
+
+ // Temporary solution while the restriction for polylines is not implemented
+ // and shape for zone can be compound and not face only
+ if ( !aZoneShape.IsNull() && aZoneShape.ShapeType() != TopAbs_FACE )
+ {
+ TopExp_Explorer aZoneFaceExp( aZoneShape, TopAbs_FACE );
+ if ( aZoneFaceExp.More() )
+ aZoneShape = aZoneFaceExp.Current(); // Take only first face into account
+ }
+
+ if ( aZoneShape.IsNull() || aZoneShape.ShapeType() != TopAbs_FACE )
+ return;
+
+ TopoDS_Face aZoneFace = TopoDS::Face( aZoneShape );
+
+ TopoDS_Wire aZoneOuterWire = ShapeAnalysis::OuterWire( aZoneFace );
+
+ TopTools_SequenceOfShape anInnerEdges;
+
+ TopExp_Explorer aZoneFaceExp( aZoneFace, TopAbs_WIRE );
+ for ( ; aZoneFaceExp.More(); aZoneFaceExp.Next() )
+ {
+ TopoDS_Wire aZoneWire = TopoDS::Wire( aZoneFaceExp.Current() );
+ if ( aZoneWire.IsEqual( aZoneOuterWire ) )
+ continue; // Skip the outer wire
+
+ TopTools_SequenceOfShape anEdges;
+ HYDROData_Tool::ExploreShapeToShapes( aZoneWire, TopAbs_EDGE, anEdges );
+ anInnerEdges.Append( anEdges );
+ }
+
+ // Create outer edges group
+ QString anOutWiresGroupName = GetName() + "_Outer_Wire";
+
+ Handle(HYDROData_ShapesGroup) anOutWiresGroup = createGroupObject();
+ anOutWiresGroup->SetName( anOutWiresGroupName );
+
+ TopTools_SequenceOfShape anEdges;
+ HYDROData_Tool::ExploreShapeToShapes( aZoneOuterWire, TopAbs_EDGE, anEdges );
+ anOutWiresGroup->SetShapes( anEdges );
+
+ // Create group for inner edges only if edges is not empty
+ if ( !anInnerEdges.IsEmpty() )
+ {
+ QString anInWiresGroupName = GetName() + "_Inner_Wires";
+
+ Handle(HYDROData_ShapesGroup) anInWiresGroup = createGroupObject();
+ anInWiresGroup->SetName( anInWiresGroupName );
+
+ anInWiresGroup->SetShapes( anInnerEdges );
+ }
+}
+