+}
+
+int HYDROData_IProfilesInterpolator::GetNbProfilesToCompute() const
+{
+ return myResultProfilesNumber;
+}
+
+void HYDROData_IProfilesInterpolator::InsertResultProfile( const std::vector<double>& theProfile )
+{
+ myResultProfiles.push_back( theProfile );
+}
+
+void HYDROData_IProfilesInterpolator::InsertResultProfile( const NCollection_Sequence<gp_XYZ>& theProfile )
+{
+ std::vector<double> aCoords;
+
+ for ( int i = theProfile.Lower(); i <= theProfile.Upper(); i++ ) {
+ const gp_XYZ& aPnt = theProfile.Value( i );
+ aCoords.push_back( aPnt.X() );
+ aCoords.push_back( aPnt.Y() );
+ aCoords.push_back( aPnt.Z() );
+ }
+
+ myResultProfiles.push_back( aCoords );
+}
+
+NCollection_Sequence<gp_XYZ> HYDROData_IProfilesInterpolator::GetFirstProfilePoints() const
+{
+ return GetPoints( GetFirstProfileCoords() );
+}
+
+NCollection_Sequence<gp_XYZ> HYDROData_IProfilesInterpolator::GetSecondProfilePoints() const
+{
+ return GetPoints( GetSecondProfileCoords() );
+}
+
+NCollection_Sequence<gp_XYZ> HYDROData_IProfilesInterpolator::GetPoints( const std::vector<double>& theCoords ) const
+{
+ NCollection_Sequence<gp_XYZ> aProfilePoints;
+
+ int aNbCoords = (int) theCoords.size();
+ div_t aDiv = std::div( aNbCoords, 3 );
+ if ( aDiv.rem == 0 ) {
+ for ( int i = 0; i < aNbCoords; i += 3 ) {
+ aProfilePoints.Append( gp_XYZ( theCoords[i], theCoords[i+1], theCoords[i+2] ) );
+ }
+ }
+
+ return aProfilePoints;