- QStringList anInvalidProfiles, anExistingProfiles, aHasNoIntersectionProfiles;
-
- HYDROData_SequenceOfObjects aSeqOfProfiles;
- HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
- for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ ) {
- Handle(HYDROData_Profile) aProfile =
- Handle(HYDROData_Profile)::DownCast( aSeq.Value( anIndex ) );
- if ( !aProfile.IsNull() ) {
- QString aProfileName = aProfile->GetName();
-
- // Check the profile, if all is ok - add it to the list
- if ( !aProfile->IsValid() ) { // check whether the profile is valid
- anInvalidProfiles << aProfileName;
- } else if ( aCurrentProfiles.contains( aProfileName ) ) { // check whether the profile is already added
- anExistingProfiles << aProfileName;
- } else if ( !myEditedObject->HasIntersection( aProfile ) ) { // check whether the profile has intersection
- aHasNoIntersectionProfiles << aProfile->GetName();
- } else {
- aSeqOfProfiles.Append( aProfile );
- }
+ QStringList anInvalidProfiles;
+ QStringList anExistingProfiles;
+ QStringList aHasNoIntersectionProfiles;
+ QStringList aVerifiedProfiles;
+
+ HYDROData_SequenceOfObjects aSelectedProfiles = HYDROGUI_Tool::GetSelectedObjects( module() );
+
+ for( int i = 1, n = aSelectedProfiles.Length(); i <= n; i++ )
+ {
+ Handle(HYDROData_Profile) aProfile =
+ Handle(HYDROData_Profile)::DownCast( aSelectedProfiles.Value( i ) );
+ if ( aProfile.IsNull() )
+ continue;
+
+ QString aProfileName = aProfile->GetName();
+ Standard_Real aProfilePar = 0.0;
+
+ // Check the profile, if all is ok - add it to the list
+ if ( !aProfile->IsValid() )
+ {
+ // check whether the profile is valid
+ anInvalidProfiles << aProfileName;
+ }
+ else if ( aCurrentProfiles.contains( aProfileName ) )
+ {
+ // check whether the profile is already added
+ anExistingProfiles << aProfileName;
+ }
+ else if ( !HYDROData_Stream::HasIntersection( aHydAxis, aProfile, aPlane, aProfilePar ) )
+ {
+ // check whether the profile has intersection
+ aHasNoIntersectionProfiles << aProfileName;
+ }
+ else
+ {
+ // Insert profile in correct place
+ insertProfileInToOrder( aProfileName, aProfilePar, myProfiles, myProfileParams );
+ aVerifiedProfiles << aProfileName;