Salome HOME
refs #1327: debug of scaling operations
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ChannelOp.cxx
index f1613b07a406d8bf28d35f6aac76458d200136c5..8c3e73e469f05fa438f03d039ef3e31990548a51 100644 (file)
@@ -24,6 +24,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Iterator.h>
@@ -117,6 +118,11 @@ void HYDROGUI_ChannelOp::startOperation()
   aPanel->setGuideLineName( aSelectedGuideLine );
   aPanel->setProfileName( aSelectedProfile );
 
+  if( !myEditedObject.IsNull() )
+    aPanel->setEquiDistance( myEditedObject->GetEquiDistance() );
+  else
+    aPanel->setEquiDistance( 1.0 );
+
   aPanel->blockSignals( false );
 
   onCreatePreview();
@@ -209,6 +215,7 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
 
     myEditedObject->RemoveProfile();
     myEditedObject->SetProfile( aProfile );
+    myEditedObject->SetEquiDistance( aPanel->getEquiDistance() );
   }
 
   if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) )
@@ -291,7 +298,7 @@ void HYDROGUI_ChannelOp::onCreatePreview()
     HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
 
   HYDROData_Channel::PrsDefinition aPrsDef;
-  if ( !HYDROData_Channel::CreatePresentations( aGuideLine, aProfile, aPrsDef ) )
+  if ( !HYDROData_Channel::CreatePresentations( aGuideLine, aProfile, aPrsDef, aPanel->getEquiDistance() ) )
   {
     erasePreview();
     return;