Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_LandCoverOp.cxx
index 9cf2567e4ea5aa58380c420f8a81de0adfd1106b..d81f0d07217ccd53cce135b66bc246dced711de4 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "HYDROGUI_LandCoverDlg.h"
 #include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
@@ -106,15 +107,16 @@ void HYDROGUI_LandCoverOp::startOperation()
     if ( !aStricklerTableObj.IsNull() )
     {
       // Get Strickler table data from the data model
-      TColStd_SequenceOfExtendedString aTypes = aStricklerTableObj->GetTypes();
-      for ( int i = 1; i <= aTypes.Length(); i++ )
+      QStringList aTypes = aStricklerTableObj->GetTypes();
+      for ( QStringList::iterator it = aTypes.begin(); it != aTypes.end(); ++it )
       {
-        QString aType = HYDROGUI_Tool::ToQString( aTypes.Value( i ) );
-        if ( !aType.isEmpty() && !aStricklerTypes.contains( aType ))
+        QString aType = *it;
+        if ( !aType.isEmpty() && !aStricklerTypes.contains( aType ) )
           aStricklerTypes.append( aType );
       }
     }
   }
+
   aStricklerTypes.sort();
   aPanel->setAdditionalParams( aStricklerTypes );
 
@@ -215,8 +217,8 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
 
   if ( !myIsEdit )
   {    
-    aZoneObj->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() );
-    aZoneObj->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() );
+    aZoneObj->SetFillingColor( aZoneObj->DefaultFillingColor() );
+    aZoneObj->SetBorderColor( aZoneObj->DefaultBorderColor() );
   }
 
   aZoneObj->SetPolylines( aZonePolylines );
@@ -233,6 +235,7 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
   }
 
   module()->setIsToUpdate( aZoneObj );
+  module()->getOCCDisplayer()->SetToUpdateColorScale();
 
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
 
@@ -278,8 +281,8 @@ void HYDROGUI_LandCoverOp::onCreatePreview( const QStringList& thePolylineNames
 
   if ( aViewManager && myPreviewPrs )
   {
-    QColor aFillingColor = HYDROData_LandCover::DefaultFillingColor();
-    QColor aBorderColor = HYDROData_LandCover::DefaultBorderColor();
+    QColor aFillingColor = Qt::magenta;
+    QColor aBorderColor = Qt::transparent;
     if ( !myEditedObject.IsNull() ) {
       aFillingColor = myEditedObject->GetFillingColor();
       aBorderColor = myEditedObject->GetBorderColor();
@@ -369,7 +372,7 @@ bool HYDROGUI_LandCoverOp::confirmPolylinesChange() const
     return true;
 
   // Check if the land cover object is already modified or not
-  bool isConfirmed = myEditedObject->IsMustBeUpdated();
+  bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d );
   if ( !isConfirmed )
   {
     // If not modified check if the land cover has already defined polylines