Salome HOME
Merge branch 'BR_H2018_2' of https://codev-tuleap.cea.fr/plugins/git/salome/hydro...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImmersibleZoneOp.cxx
index b75b8ca3ff359d1cf54bee379e3002168d8e63b8..bf8ff273f62b8e797c373185f0a46397c01ffb8e 100644 (file)
@@ -1,8 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
@@ -27,6 +23,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_DataObject.h"
 
@@ -100,12 +97,12 @@ void HYDROGUI_ImmersibleZoneOp::startOperation()
 
   aPanel->setObjectName( anObjectName );
   aPanel->setPolylineNames( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_POLYLINEXY ) );
-  aPanel->setBathymetryNames( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_BATHYMETRY ) );
+  aPanel->setAdditionalParams( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_BATHYMETRY ) );
 
   aPanel->blockSignals( false );
 
   aPanel->setPolylineName( aSelectedPolyline );
-  aPanel->setBathymetryName( aSelectedBathymetry );
+  aPanel->setSelectedAdditionalParamName( aSelectedBathymetry );
 }
 
 void HYDROGUI_ImmersibleZoneOp::abortOperation()
@@ -166,7 +163,7 @@ bool HYDROGUI_ImmersibleZoneOp::processApply( int& theUpdateFlags,
       HYDROGUI_Tool::FindObjectByName( module(), aPolylineName, KIND_POLYLINEXY ) );
   }
 
-  QString aBathymetryName = aPanel->getBathymetryName();
+  QString aBathymetryName = aPanel->getSelectedAdditionalParamName();
   if ( !aBathymetryName.isEmpty() )
   {
     aZoneBathymetry = Handle(HYDROData_Bathymetry)::DownCast(
@@ -187,8 +184,8 @@ bool HYDROGUI_ImmersibleZoneOp::processApply( int& theUpdateFlags,
 
   if ( !myIsEdit )
   {
-    aZoneObj->SetFillingColor( HYDROData_ImmersibleZone::DefaultFillingColor() );
-    aZoneObj->SetBorderColor( HYDROData_ImmersibleZone::DefaultBorderColor() );
+    aZoneObj->SetFillingColor( aZoneObj->DefaultFillingColor() );
+    aZoneObj->SetBorderColor( aZoneObj->DefaultBorderColor() );
   }
 
   aZoneObj->SetPolyline( aZonePolyline );
@@ -246,19 +243,19 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName
 
   if ( aViewManager && myPreviewPrs )
   {
-    QColor aFillingColor = HYDROData_ImmersibleZone::DefaultFillingColor();
-    QColor aBorderColor = HYDROData_ImmersibleZone::DefaultBorderColor();
+    QColor aFillingColor = Qt::darkBlue;
+    QColor aBorderColor = Qt::transparent;
     if ( !myEditedObject.IsNull() ) {
       aFillingColor = myEditedObject->GetFillingColor();
       aBorderColor = myEditedObject->GetBorderColor();
     }
 
-    myPreviewPrs->setFillingColor( aFillingColor, false, false );
-    myPreviewPrs->setBorderColor( aBorderColor, false, false );
     TopoDS_Face aFace;
     if( !aZoneShape.IsNull() )
       aFace = TopoDS::Face( aZoneShape );
     myPreviewPrs->setFace( aFace, true, true, "" );
+    myPreviewPrs->setFillingColor( aFillingColor, false, false );
+    myPreviewPrs->setBorderColor( aBorderColor, false, false );
   }
 
   QApplication::restoreOverrideCursor();