Salome HOME
refs #1327: debug of scaling operations
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ChannelOp.cxx
index 958d9b8a3b77bcc502f24fa8eb056dd82e617256..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,9 +215,10 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
 
     myEditedObject->RemoveProfile();
     myEditedObject->SetProfile( aProfile );
+    myEditedObject->SetEquiDistance( aPanel->getEquiDistance() );
   }
 
-  if ( myEditedObject->IsMustBeUpdated() )
+  if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) )
     myEditedObject->Update();
 
   erasePreview();
@@ -267,8 +274,8 @@ void HYDROGUI_ChannelOp::onCreatePreview()
       {
         myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
 
-        QColor aFillingColor = myEditedObject->DefaultFillingColor();
-        QColor aBorderColor = myEditedObject->DefaultBorderColor();
+        QColor aFillingColor = Qt::blue;
+        QColor aBorderColor = Qt::transparent;
         if ( !myEditedObject.IsNull() )
         {
           aFillingColor = myEditedObject->GetFillingColor();
@@ -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;