Salome HOME
Bug #168: filter for invalid polyline.
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.cxx
index 12b146a048d913cd2eaadbb4465c59f6f52b5aee..a418024d6f5c685a090fa941453d3227fad02b8d 100644 (file)
@@ -540,11 +540,20 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY&
     return aResAltitude;
   }
 
+  HYDROData_IInterpolator* aZoneInterpolator = theZone->GetInterpolator();
   if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
   {
     Handle(HYDROData_IAltitudeObject) aMergeAltitude = theZone->GetMergeAltitude();
     if ( !aMergeAltitude.IsNull() )
-      aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
+    {
+      if ( aZoneInterpolator != NULL )
+      {
+        aZoneInterpolator->SetAltitudeObject( aMergeAltitude );
+        aResAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
+      }
+      else
+        aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
+    }
   }
   else
   {
@@ -561,7 +570,15 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY&
       if ( anObjAltitude.IsNull() )
         continue;
 
-      double aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
+      double aPointAltitude = 0.0;
+      if ( aZoneInterpolator != NULL )
+      {
+        aZoneInterpolator->SetAltitudeObject( anObjAltitude );
+        aPointAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
+      }
+      else
+        aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
+
       if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
         continue;