+ SUIT_MessageBox::critical( module()->getApp()->desktop(),
+ tr( "BAD_SELECTED_POLYLINE_TLT" ),
+ tr( "BAD_SELECTED_POLYLINE_MSG" ).arg( theNewAxis ) );
+ // To restore the old axis
+ updatePanelData();
+ return;
+ }
+
+ QStringList aNewProfiles;
+ QList<double> aNewProfileParams;
+ QStringList aHasNoIntersectionProfiles;
+
+ // Get list of profiles which do not intersect the axis
+ for ( int i = 0; i < myProfiles.length(); ++i )
+ {
+ QString aProfileName = myProfiles.value( i );
+
+ Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast(
+ HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
+ if ( aProfile.IsNull() )
+ continue;
+
+ Standard_Real aProfilePar = 0.0;
+ if ( HYDROData_Stream::HasIntersection( aNewAxis, aProfile, aPlane, aProfilePar ) )
+ {
+ // Insert profile in correct place
+ insertProfileInToOrder( aProfileName, aProfilePar, aNewProfiles, aNewProfileParams );
+ }
+ else
+ {
+ aHasNoIntersectionProfiles << aProfile->GetName();
+ }
+ }
+
+ // If there are profiles which don't intersect the new axis - show confirmation message box
+ bool isConfirmed = true;
+ if ( !aHasNoIntersectionProfiles.isEmpty() )
+ {
+ SUIT_MessageBox::StandardButtons aButtons =
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No;
+
+ QString aMsg = aHasNoIntersectionProfiles.join( "\n" );
+ isConfirmed = SUIT_MessageBox::question( module()->getApp()->desktop(),
+ tr( "CONFIRMATION" ),
+ tr( "CONFIRM_AXIS_CHANGE" ).arg( aMsg ),
+ aButtons,
+ SUIT_MessageBox::Yes) == SUIT_MessageBox::Yes;