Salome HOME
Creat\Edit stream operation.
[modules/hydro.git] / src / HYDROData / HYDROData_Stream.cxx
index 2b5d29ea8d4bb09c46c83f32a4fc1a6529160676..0512e90a24474f6bc725a619338f792daac1ab70 100644 (file)
@@ -121,6 +121,9 @@ void HYDROData_Stream::Update()
     {
       a2dShellBuilder.Add( a2dShell, aMakeFace.Face() );
     }
+
+    aPrevFirstPoint = aCurFirstPoint;
+    aPrevLastPoint = aCurLastPoint;
   }
 
   SetTopShape( a2dShell );
@@ -132,9 +135,16 @@ void HYDROData_Stream::Update()
 bool HYDROData_Stream::SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis )
 {
   Handle(HYDROData_PolylineXY) aPrevAxis = GetHydraulicAxis();
-  if ( theAxis.IsNull() || IsEqual( aPrevAxis, theAxis ) )
+
+  if ( theAxis.IsNull() )
+  {
+    RemoveHydraulicAxis();
+    return !aPrevAxis.IsNull();
+  }
+
+  if ( IsEqual( aPrevAxis, theAxis ) )
     return false;
-  
+
   TopoDS_Wire aHydraulicWire = TopoDS::Wire( theAxis->GetShape() );
   if ( aHydraulicWire.IsNull() )
     return false; // The polyline must be a single wire
@@ -243,6 +253,7 @@ void HYDROData_Stream::insertProfileInToOrder( const Handle(HYDROData_Profile)&
     return;
 
   // TODO
+  AddReferenceObject( theProfile, DataTag_Profile ); // temporary for testing only
 }
 
 void HYDROData_Stream::updateProfilesOrder()