+
+ 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;
+ }
+
+ // Check if the user has confirmed axis change
+ if ( !isConfirmed )
+ {
+ // To restore the old axis
+ updatePanelData();
+ }
+ else
+ {
+ // Update data
+ myHydAxis = theNewAxis;
+ myProfiles = aNewProfiles;
+ myProfileParams = aNewProfileParams;
+
+ // Update the panel
+ updatePanelData();
+
+ // Update preview
+ createPreview();
+ }
+}
+
+void HYDROGUI_StreamOp::updatePanelData()
+{
+ HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+
+ aPanel->setAxisName( myHydAxis );
+ aPanel->setProfiles( myProfiles );