-
-HYDROGUI_PolylineExtractionOp::ShapeInfoList HYDROGUI_PolylineExtractionOp::extract( const Handle(HYDROData_Stream)& theStream ) const
-{
- ShapeInfoList aList;
- if ( !theStream.IsNull() )
- {
- aList.append( ShapeInfo( theStream->GetLeftShape(), QString( "Left bank" ) ) );
- aList.append( ShapeInfo( theStream->GetRightShape(), QString( "Right bank" ) ) );
-
- HYDROData_SequenceOfObjects aProfiles = theStream->GetProfiles();
- for ( int i = 1; i <= aProfiles.Length(); i++ )
- {
- Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( aProfiles.Value( i ) );
- aList.append( ShapeInfo( aProfile->GetTopShape(), QString( "Profile_%1" ).arg( i ) ) );
- }
- }
- return aList;
-}
-
-HYDROGUI_PolylineExtractionOp::ShapeInfoList HYDROGUI_PolylineExtractionOp::extract( const Handle(HYDROData_Channel)& aChannel ) const
-{
- ShapeInfoList aList;
- if ( !aChannel.IsNull() )
- {
- HYDROData_SequenceOfObjects aGroups = aChannel->GetGroups();
- int aNum = qMin( aGroups.Length(), 2 );
- for ( int i = 1; i <= aNum; i++ )
- {
- Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( i ) );
- TopTools_SequenceOfShape aShapes;
- aGroup->GetShapes( aShapes );
- if ( !aShapes.IsEmpty() )
- {
- TopoDS_Wire aWire;
- BRep_Builder aBuilder;
- aBuilder.MakeWire( aWire );
-
- for ( int s = 1; s <= aShapes.Length(); s++ )
- aBuilder.Add( aWire, aShapes.Value( s ) );
- aList.append( ShapeInfo( aWire, i > 1 ? "Right bank" : "Left bank" ) );
- }
- }
- }
- return aList;
-}
-
-HYDROGUI_PolylineExtractionOp::ShapeInfoList HYDROGUI_PolylineExtractionOp::extract( const Handle(HYDROData_Obstacle)& theObstacle ) const
-{
- ShapeInfoList aList;
- if ( !theObstacle.IsNull() )
- {
- TopoDS_Wire aWire;
- BRep_Builder aBuilder;
- aBuilder.MakeWire( aWire );
- HYDROData_SequenceOfObjects aGroups = theObstacle->GetGroups();
- for ( int i = 1; i <= aGroups.Length(); i++ )
- {
- Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( i ) );
- TopTools_SequenceOfShape aShapes;
- aGroup->GetShapes( aShapes );
- for ( int s = 1; s <= aShapes.Length(); s++ )
- aBuilder.Add( aWire, aShapes.Value( s ) );
- }
- aList.append( ShapeInfo( aWire, QString( "Contour" ) ) );
- }
- return aList;
-}