Salome HOME
Merge branch 'BR_v14_rc' of ssh://git.salome-platform.org/modules/hydro into BR_v14_rc
authorasl <asl@opencascade.com>
Thu, 25 Jun 2015 04:24:23 +0000 (07:24 +0300)
committerasl <asl@opencascade.com>
Thu, 25 Jun 2015 04:24:23 +0000 (07:24 +0300)
33 files changed:
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_StricklerTable.cxx
src/HYDROData/HYDROData_StricklerTable.h
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_CalculationDlg.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.h
src/HYDROGUI/HYDROGUI_DataBrowser.cxx
src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx
src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_LandCoverColoringOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_LandCoverOp.cxx
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Module.h
src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx
src/HYDROGUI/HYDROGUI_OCCDisplayer.h
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_OrderedListWidget.cxx
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
src/HYDROGUI/HYDROGUI_SetColorOp.cxx
src/HYDROGUI/HYDROGUI_SetColorOp.h
src/HYDROGUI/HYDROGUI_Shape.cxx
src/HYDROGUI/HYDROGUI_ShapeLandCover.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ShapeLandCover.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ShowHideOp.cxx
src/HYDROGUI/HYDROGUI_StreamDlg.cxx
src/HYDROGUI/HYDROGUI_StreamDlg.h
src/HYDROGUI/HYDROGUI_StreamOp.cxx
src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDROPy/HYDROData_CalculationCase.sip

index 00474d50b9317d3e9bcbc7ad82a71fc0664d86aa..8027835c4d46a1834b05e44e83a6b7366a9c8c41 100644 (file)
@@ -116,10 +116,14 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre
 
   QString aCalculName = GetObjPyName();
 
-  AssignmentMode aMode = GetAssignmentMode();
+  AssignmentMode aMode = GetAssignmentMode();  
   QString aModeStr = aMode==MANUAL ? "HYDROData_CalculationCase.MANUAL" : "HYDROData_CalculationCase.AUTOMATIC";
   aResList << QString( "%0.SetAssignmentMode( %1 )" ).arg( aCalculName ).arg( aModeStr );
 
+  AssignmentMode aModeLC = GetAssignmentLandCoverMode();
+  QString aModeLCStr = aModeLC==MANUAL ? "HYDROData_CalculationCase.MANUAL" : "HYDROData_CalculationCase.AUTOMATIC";
+  aResList << QString( "%0.SetAssignmentLandCoverMode( %1 )" ).arg( aCalculName ).arg( aModeLCStr );
+
   HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
   HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
   for ( ; anIter.More(); anIter.Next() )
@@ -158,6 +162,8 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre
 
   if( aMode==AUTOMATIC )
     DumpRulesToPython( aCalculName, aResList );
+  if( aModeLC==AUTOMATIC )
+    DumpLandCoverRulesToPython( aCalculName, aResList );
 
   aResList << QString( "" );
   aResList << "# Start the algorithm of the partition and assignment";
@@ -167,7 +173,12 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre
   {
     // Now we restore the
     // - regions and zones order
-    DumpRegionsToPython( aResList, theTreatedObjects, GetRegions( false ) );
+    DumpRegionsToPython( aResList, theTreatedObjects, GetRegions( false ) );   
+  }
+
+  if( aModeLC==MANUAL )
+  {
+    // Now we restore the
     // - land cover regions and zones order
     DumpRegionsToPython( aResList, theTreatedObjects, GetRegions( true ) );
   }
@@ -308,14 +319,23 @@ void HYDROData_CalculationCase::Update()
   switch( GetAssignmentMode() )
   {
   case MANUAL:
-    CreateRegionsDef( aDocument, aZonesList, false );
+    CreateRegionsDef( aDocument, aZonesList, false );    
+    break;
+  case AUTOMATIC:
+    CreateRegionsAuto( aDocument, aZonesList, false );    
+    break;
+  }
+
+  switch( GetAssignmentLandCoverMode() )
+  {
+  case MANUAL:
     CreateRegionsDef( aDocument, aLandCoverZonesList, true );
     break;
   case AUTOMATIC:
-    CreateRegionsAuto( aDocument, aZonesList, false );
     CreateRegionsAuto( aDocument, aLandCoverZonesList, true );
     break;
   }
+
   CreateEdgeGroupsDef( aDocument, anEdgesList );
 }
 
@@ -1242,6 +1262,12 @@ QString HYDROData_CalculationCase::DumpRules() const
   return HYDROData_PriorityQueue::DumpRules( aRulesLab );
 }
 
+QString HYDROData_CalculationCase::DumpLandCoverRules() const
+{
+  TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomLandCoverRules );
+  return HYDROData_PriorityQueue::DumpRules( aRulesLab );
+}
+
 void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
 {
   TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode );
@@ -1268,6 +1294,13 @@ void HYDROData_CalculationCase::DumpRulesToPython( const QString& theCalcCaseNam
   HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
 }
 
+void HYDROData_CalculationCase::DumpLandCoverRulesToPython( const QString& theCalcCaseName,
+                                                            QStringList& theScript ) const
+{
+  TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomLandCoverRules );
+  HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
+}
+
 HYDROData_Warning HYDROData_CalculationCase::GetLastWarning() const
 {
   return myLastWarning;
index 70e925e73d4d048f9522d74fff262eb951a3cb3f..0dd025ed46cd18f2937a8c9b0ec96977a039eaff 100644 (file)
@@ -402,6 +402,7 @@ public:
   HYDRODATA_EXPORT AssignmentMode GetAssignmentLandCoverMode() const;
 
   HYDRODATA_EXPORT QString DumpRules() const;
+  HYDRODATA_EXPORT QString DumpLandCoverRules() const;
 
   HYDRODATA_EXPORT HYDROData_Warning GetLastWarning() const;
 
@@ -446,6 +447,7 @@ private:
                             const HYDROData_SplitToZonesTool::SplitDataList& theEdges );
 
   void DumpRulesToPython( const QString& theCalcCaseName, QStringList& theScript ) const;
+  void DumpLandCoverRulesToPython( const QString& theCalcCaseName, QStringList& theScript ) const;
 
   void SetWarning( HYDROData_WarningType theType = WARN_OK, const QString& theData = "" );
 
index 68995e824be7ab26e9824459bf25e8a1567d3a3c..0e68479d54660cb49495689a2cf3daf0e710de94 100644 (file)
@@ -130,6 +130,24 @@ void HYDROData_StricklerTable::Set( const TCollection_ExtendedString& theType, d
     aMap->SetReal( theType, theCoefficient );
 }
 
+void HYDROData_StricklerTable::GetCoefficientRange( double& theMin, double& theMax ) const
+{
+  theMin = 0;
+  theMax = 0;
+  
+  Handle(TDataStd_NamedData) aMap = Map();
+  Standard_Boolean isFirst = Standard_True;
+  for ( TDataStd_DataMapIteratorOfDataMapOfStringReal it( aMap->GetRealsContainer() ); it.More(); it.Next() ) {
+    Standard_Real aValue = it.Value();
+    if ( theMin == 0 || aValue < theMin ) {
+      theMin = aValue;
+    }
+    if ( theMax == 0 || aValue > theMax ) {
+      theMax = aValue;
+    }
+  }
+}
+
 TColStd_SequenceOfExtendedString HYDROData_StricklerTable::GetTypes() const
 {
     TColStd_SequenceOfExtendedString aSeq;
@@ -142,6 +160,13 @@ TColStd_SequenceOfExtendedString HYDROData_StricklerTable::GetTypes() const
     return aSeq;
 }
 
+bool HYDROData_StricklerTable::HasType( const TCollection_ExtendedString& theType ) const
+{
+  Handle(TDataStd_NamedData) aMap = Map();
+  
+  return !aMap.IsNull() && aMap->HasReal( theType );
+}
+
 void HYDROData_StricklerTable::Clear()
 {
     Handle(TDataStd_NamedData) aMap = Map();
index bbc553bec135c93187bd1ffeaf9fd418205d750a..856786c7d574a34af32be557b306b688abf39f3b 100644 (file)
@@ -51,8 +51,12 @@ public:
   HYDRODATA_EXPORT double Get( const TCollection_ExtendedString& theType, double theDefault ) const;
   HYDRODATA_EXPORT void Set( const TCollection_ExtendedString& theType, double theCoefficient );
 
+  HYDRODATA_EXPORT void GetCoefficientRange( double& theMin, double& theMax ) const;
+
   HYDRODATA_EXPORT TColStd_SequenceOfExtendedString GetTypes() const;
 
+  HYDRODATA_EXPORT bool HasType( const TCollection_ExtendedString& theType ) const;
+
   HYDRODATA_EXPORT void Clear();
 
   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
index 4be75c780915e058d19f38132062ab040ff9013c..a77eff2c0b2aa7f9ef6e4762991fc4910c3d5181 100644 (file)
@@ -130,6 +130,8 @@ set(PROJECT_HEADERS
     HYDROGUI_ObjListBox.h
     HYDROGUI_RecognizeContoursDlg.h
     HYDROGUI_RecognizeContoursOp.h
+    HYDROGUI_LandCoverColoringOp.h
+       HYDROGUI_ShapeLandCover.h
 )
 
 QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
@@ -263,6 +265,8 @@ set(PROJECT_SOURCES
     HYDROGUI_ObjListBox.cxx
     HYDROGUI_RecognizeContoursDlg.cxx
     HYDROGUI_RecognizeContoursOp.cxx
+    HYDROGUI_LandCoverColoringOp.cxx
+       HYDROGUI_ShapeLandCover.cxx
 )
 
 add_definitions(
index 889d2b611b6377d4ce093d674a36ff90989bec53..3103fe4a74b6aac72d7c76fb00ffb4f598ff1957 100644 (file)
@@ -443,7 +443,7 @@ QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPage() {
   connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addLandCovers() ) );
   connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeLandCovers() ) );
 
-  connect( myLandCovers, SIGNAL( orderLandCoverChanged() ), SLOT( onOrderLandCoverChanged() ) );
+  connect( myLandCovers, SIGNAL( orderChanged() ), SLOT( onOrderLandCoverChanged() ) );
 
   return aPage;
 }
index 93528ff5157f1f55252b815e292ed96926e7480f..6c6aa8e8afcce538cf5b01b22ff2c96810ad2530 100644 (file)
@@ -726,28 +726,52 @@ bool HYDROGUI_CalculationOp::confirmContinueWithWarning( const HYDROData_Warning
   return ( anAnswer == QMessageBox::Yes );
 }
 
+bool HYDROGUI_CalculationOp::confirmLandCoverRegionsChange() const
+{
+  // Check if the case is already modified or not
+  bool isConfirmed = myEditedObject->IsMustBeUpdated();
+  if ( !isConfirmed )
+  {
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
+    if ( aSeq.Length() > 0 )
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
+      isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
+                               tr( "REGIONS_CHANGED" ),
+                               tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
+                               QMessageBox::Yes | QMessageBox::No,
+                               QMessageBox::No ) == QMessageBox::Yes );
+    }
+    else
+    {
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
+  }
+  return isConfirmed;
+}
+
 bool HYDROGUI_CalculationOp::confirmLandCoverModeChange() const
 {
   // Check if the case is already modified or not
   bool isConfirmed = myEditedObject->IsMustBeUpdated();
   if ( !isConfirmed )
   {
-    // If not modified check if the case has already defined regions with zones
-    // TODO: adapt HYDROData_CalculationCase class to process regions constructed for land covers
-    /*HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCoverRegions();
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
     if ( aSeq.Length() > 0 )
-    {*/
-      // If there are already defined zones then ask a user to confirm zones recalculation
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
       isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
                                tr( "MODE_CHANGED" ),
                                tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_MODE" ),
                                QMessageBox::Yes | QMessageBox::No,
                                QMessageBox::No ) == QMessageBox::Yes );
-    /*}
+    }
     else
     {
-      isConfirmed = true; // No regions - no zones - nothing to recalculate
-    }*/
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
   }
   return isConfirmed;
 }
@@ -758,22 +782,21 @@ bool HYDROGUI_CalculationOp::confirmLandCoverOrderChange() const
   bool isConfirmed = myEditedObject->IsMustBeUpdated();
   if ( !isConfirmed )
   {
-    // If not modified check if the case has already defined regions with zones
-    // TODO: adapt HYDROData_CalculationCase class to process regions constructed for land covers
-    /*HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCoverRegions();
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
     if ( aSeq.Length() > 0 )
-    {*/
-      // If there are already defined zones then ask a user to confirm zones recalculation
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
       isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
                                tr( "ORDER_CHANGED" ),
                                tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
                                QMessageBox::Yes | QMessageBox::No,
                                QMessageBox::No ) == QMessageBox::Yes );
-    /*}
+    }
     else
     {
-      isConfirmed = true; // No regions - no zones - nothing to recalculate
-    }*/
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
   }
   return isConfirmed;
 }
@@ -907,8 +930,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
       }
     }
     aPanel->setStricklerTableNames( aList, anEntryList );
+    bool anUpdateState = myEditedObject->IsMustBeUpdated();
     if ( !aList.isEmpty() )
       aPanel->setStricklerTable( aList.at( 0 ), false );
+    myEditedObject->SetToUpdate( anUpdateState );
 
     // Fill in list widget with all available land covers
     aSeq = HYDROGUI_Tool::GetLandCovers( module() );
@@ -1081,7 +1106,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
     if ( anIsToUpdate )
     {
       myShowZones = true;
-      myEditedObject->Update();
+      myEditedObject->SetToUpdate( false );
       
       AssignDefaultZonesColors( true );
 
@@ -1607,7 +1632,7 @@ void HYDROGUI_CalculationOp::onAddLandCovers()
 
   // Add land covers selected in the module browser to the calculation case
   QStringList aSelectedList = aPanel->getSelectedAvailableLandCovers();
-  if ( aSelectedList.isEmpty() || !confirmRegionsChange() )
+  if ( aSelectedList.isEmpty() || !confirmLandCoverRegionsChange() )
     return;
 
   QStringList anAddedList;
@@ -1638,7 +1663,7 @@ void HYDROGUI_CalculationOp::onRemoveLandCovers()
     return;
 
   QStringList aSelectedList = aPanel->getSelectedLandCovers();
-  if ( aSelectedList.isEmpty() || !confirmRegionsChange() )
+  if ( aSelectedList.isEmpty() || !confirmLandCoverRegionsChange() )
     return;
 
   for (int i = 0; i < aSelectedList.length(); i++)
index 4aa6485b2ae6f64438538c37fb6dc8d09db79235..9d2dc0d1b5a91326b7b6d844b5a188750f30d134 100644 (file)
@@ -190,6 +190,7 @@ private:
   bool confirmOrderChange() const;
   bool confirmContinueWithWarning( const HYDROData_Warning& theWarning ) const;
 
+  bool confirmLandCoverRegionsChange() const;
   bool confirmLandCoverModeChange() const;
   bool confirmLandCoverOrderChange() const;
 
index 9092fa875276826f1224faaa45e515cdef6fce52..eb5f2539e9528b890fa1fa61dd49f6743b6bd33f 100644 (file)
@@ -342,6 +342,14 @@ void HYDROGUI_DataBrowser::createPopupMenu( QMenu* theMenu )
         isOnlyZones = aModelObj->GetKind()==KIND_ZONE;
         if( !isOnlyZones )
           break;
+
+        SUIT_DataObject* aParentObj = aHydroObj->parent();
+        if ( aParentObj )
+        {
+          isOnlyZones = aParentObj->childCount() > 1;
+          if( !isOnlyZones )
+            break;
+        }
       }
       else
       {
index 583def4b7de8537cdede5f688640555a96ae588f..621193da245d77efb6c273047237fc4364558440 100644 (file)
@@ -79,35 +79,39 @@ void HYDROGUI_ImportSinusXOp::onApply()
     return;
   }
 
-  QString aFileName = myFileDlg->selectedFile();
-  if ( aFileName.isEmpty() )
-  {
-    abort();
-    return;
-  }
-
-  QString anExt = aFileName.split('.', QString::SkipEmptyParts).back();
+  QStringList aFileNames = myFileDlg->selectedFiles();
+  bool IsImported = false;
+  
+  QApplication::setOverrideCursor( Qt::WaitCursor );  
+  startDocOperation();
 
-  if (anExt == "sx")
+  foreach (QString aFileName, aFileNames) 
   {
-    QApplication::setOverrideCursor( Qt::WaitCursor );
+    if ( aFileName.isEmpty() )
+      continue;
 
-    startDocOperation();
+    QString anExt = aFileName.split('.', QString::SkipEmptyParts).back();
 
-    HYDROData_SinusX aSinusXImporter;
-    NCollection_Sequence<Handle_HYDROData_Entity> anEntities;
-    if (aSinusXImporter.Import(aFileName, doc(), anEntities)) 
+    if (anExt == "sx")
     {
-      UpdateView(anEntities);
-      commitDocOperation();
-      commit();
-    }
-    else
-    {
-      abort();
+      HYDROData_SinusX aSinusXImporter;
+      NCollection_Sequence<Handle_HYDROData_Entity> anEntities;
+      if (aSinusXImporter.Import(aFileName, doc(), anEntities)) 
+      {
+        UpdateView(anEntities);
+        IsImported = true;
+      }
     }
   }
 
+  if (IsImported)
+  {
+    commitDocOperation();
+    commit();
+  }
+  else
+    abort();
+
   module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
   
   QApplication::restoreOverrideCursor();
diff --git a/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx
new file mode 100644 (file)
index 0000000..2edb948
--- /dev/null
@@ -0,0 +1,91 @@
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_LandCoverColoringOp.h"
+
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
+#include "HYDROGUI_Operations.h"
+#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
+
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Bathymetry.h>
+#include <HYDROData_StricklerTable.h>
+
+#include <LightApp_Application.h>
+
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewManager.h>
+
+
+HYDROGUI_LandCoverColoringOp::HYDROGUI_LandCoverColoringOp( HYDROGUI_Module* theModule, int theId )
+: HYDROGUI_Operation( theModule ),
+  myId( theId )
+{
+  QString aName;
+  switch( myId )
+  {
+    case LandCoverScalarMapModeOnId:  aName = tr( "LC_SCALARMAP_COLORING_ON" ); break;
+    case LandCoverScalarMapModeOffId: aName = tr( "LC_SCALARMAP_COLORING_OFF" ); break;
+    default: break;
+  }
+  setName( aName );
+}
+
+HYDROGUI_LandCoverColoringOp::~HYDROGUI_LandCoverColoringOp()
+{
+}
+
+void HYDROGUI_LandCoverColoringOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  HYDROGUI_Module* aModule = module();
+
+  LightApp_Application* anApp = module()->getApp();
+  OCCViewer_ViewManager* aViewManager =
+    dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), false ) );
+
+  size_t aViewId = (size_t)aViewManager->getViewModel();
+
+  Handle(HYDROData_StricklerTable) aTable;
+
+  if ( myId == LandCoverScalarMapModeOnId ) {
+    aTable = Handle(HYDROData_StricklerTable)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+    if ( !aTable.IsNull() ) {
+      aModule->setLandCoverColoringTable( aViewId, aTable );
+    }
+  } else if ( myId == LandCoverScalarMapModeOffId ) {
+    aModule->setLandCoversScalarMapModeOff( aViewId );
+  }
+    
+  // Hide bathymetries
+  HYDROData_Iterator anIterator( doc(), KIND_BATHYMETRY );
+  for( ; anIterator.More(); anIterator.Next() ) {
+    Handle(HYDROData_Bathymetry) aBath =
+      Handle(HYDROData_Bathymetry)::DownCast( anIterator.Current() );  
+    if ( !aBath.IsNull() && aModule->isObjectVisible( aViewId, aBath ) ) {
+      aModule->setObjectVisible( aViewId, aBath, false );
+    }
+  }
+
+  aModule->getOCCDisplayer()->SetToUpdateColorScale();
+  aModule->update( UF_OCCViewer );
+  commit();
+}
diff --git a/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.h b/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.h
new file mode 100644 (file)
index 0000000..c931018
--- /dev/null
@@ -0,0 +1,44 @@
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_LandCoverColoringOp_H
+#define HYDROGUI_LandCoverColoringOp_H
+
+#include "HYDROGUI_Operation.h"
+
+/** 
+ * \class HYDROGUI_LandCoverColoringOp
+ * \brief The class intended for scalar map coloring of Land Covers
+ */
+class HYDROGUI_LandCoverColoringOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+
+  HYDROGUI_LandCoverColoringOp( HYDROGUI_Module* theModule, int theId );
+  virtual ~HYDROGUI_LandCoverColoringOp();
+
+protected:
+  virtual void startOperation();
+
+private:
+  int myId;
+};
+
+#endif
index 9cf2567e4ea5aa58380c420f8a81de0adfd1106b..2d2c5705a6459435b331599cbfb85420bc72c427 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"
@@ -233,6 +234,7 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
   }
 
   module()->setIsToUpdate( aZoneObj );
+  module()->getOCCDisplayer()->SetToUpdateColorScale();
 
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
 
index 60ed49748807addbd54781018c0757ef7bb86522..77aecedec32b355f6ba39745ce9d1507bdb22943 100644 (file)
@@ -46,6 +46,7 @@
 #include <HYDROData_Profile.h>
 #include <HYDROData_Lambert93.h>
 #include <HYDROData_Polyline3D.h>
+#include <HYDROData_StricklerTable.h>
 
 #include <HYDROData_OperationsFactory.h>
 
@@ -479,7 +480,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
     }
 
     if ( !anIsObjectCanBeColored )
-      anIsObjectCanBeColored = HYDROGUI_SetColorOp::CanObjectBeColored( anObject );
+      anIsObjectCanBeColored = HYDROGUI_SetColorOp::CanObjectBeColored( anObject, this );
   }
 
   // Check if all selected objects are profiles
@@ -653,6 +654,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( ExportStricklerTableFromFileId ) );
         theMenu->addAction( action( DuplicateStricklerTableId ) );
         theMenu->addSeparator();
+
+        if ( !isLandCoversScalarMapModeOn( anActiveViewId ) && 
+             !getObjectShapes( anActiveViewId, KIND_LAND_COVER ).isEmpty() ) {
+          theMenu->addAction( action( LandCoverScalarMapModeOnId ) );
+          theMenu->addSeparator();
+        }
       }
       else if( anIsLandCover )
       {
@@ -718,6 +725,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
     theMenu->addSeparator();
     theMenu->addAction( action( SetZLevelId ) );
     theMenu->addSeparator();
+
+    if ( isLandCoversScalarMapModeOn( anActiveViewId ) ) {
+      theMenu->addAction( action( LandCoverScalarMapModeOffId ) );
+      theMenu->addSeparator();
+    }
   }
 
   if( anIsObjectBrowser || anIsGraphicsView || anIsOCCView || anIsVTKView )
@@ -1036,6 +1048,12 @@ void HYDROGUI_Module::setObjectVisible( const int theViewId,
         if ( visState != Qtx::UnpresentableState )
             treeModel->setVisibilityState( id, theState ? Qtx::ShownState : Qtx::HiddenState );
     }
+
+    if ( theObject->GetKind() == KIND_BATHYMETRY && theState ) {
+      setLandCoversScalarMapModeOff( theViewId );
+    } else if ( theObject->GetKind() == KIND_LAND_COVER && theState ) {
+      getOCCDisplayer()->SetToUpdateColorScale();
+    }
   }
 }
 
@@ -1439,8 +1457,11 @@ void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
     if ( anOCCViewManager )
     {
       OCCViewer_Viewer* anOCCViewer = anOCCViewManager->getOCCViewer();
-      if ( anOCCViewer )
-        removeViewShapes( (size_t)anOCCViewer );
+      if ( anOCCViewer ) {
+        int aViewerId = (size_t)anOCCViewer;
+        removeViewShapes( aViewerId );
+        setLandCoversScalarMapModeOff( aViewerId );
+      }
     }
 
     if ( getVTKDisplayer()->IsApplicable( theViewManager ) )
@@ -1748,3 +1769,32 @@ void HYDROGUI_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn
 
   update( UF_OCCViewer | ( visState == Qtx::ShownState ? UF_FitAll : 0 ) );
 }
+
+Handle(HYDROData_StricklerTable) HYDROGUI_Module::getLandCoverColoringTable( const int theViewId ) const
+{
+  Handle(HYDROData_StricklerTable) aTable;
+
+  if ( myLandCoverColoringMap.contains( theViewId ) ) {
+    aTable = myLandCoverColoringMap.value( theViewId );
+  }
+
+  return aTable;
+}
+
+void HYDROGUI_Module::setLandCoverColoringTable( const int theViewId,
+                                                 const Handle(HYDROData_StricklerTable)& theTable )
+{
+  if ( !theTable.IsNull() ) {
+    myLandCoverColoringMap.insert( theViewId, theTable );
+  }
+}
+
+void HYDROGUI_Module::setLandCoversScalarMapModeOff( const int theViewId )
+{
+  myLandCoverColoringMap.remove( theViewId );
+}
+
+bool HYDROGUI_Module::isLandCoversScalarMapModeOn( const int theViewId ) const
+{
+  return myLandCoverColoringMap.contains( theViewId );
+}
index a1a0bd540b92a5e0e6dfa4a5cc640d0ab14738fa..3798c08d62a01fea7729a6b25c898e1291286927 100644 (file)
@@ -35,6 +35,8 @@ class SVTK_Viewer;
 class SUIT_ViewWindow;
 class SUIT_ViewManager;
 
+class Handle(HYDROData_StricklerTable);
+
 class HYDROGUI_DataModel;
 class HYDROGUI_Displayer;
 class HYDROGUI_OCCDisplayer;
@@ -109,6 +111,8 @@ public:
   typedef QList<HYDROGUI_VTKPrs*> ListOfVTKPrs;
   typedef QMap<int,ListOfVTKPrs> ViewId2ListOfVTKPrs;
 
+  typedef QMap<int, Handle(HYDROData_StricklerTable)> ViewId2StricklerTable;
+
 public:
   HYDROGUI_Module();
   virtual ~HYDROGUI_Module();
@@ -204,6 +208,34 @@ public:
    */
   QCursor                         getPrefEditCursor() const;
 
+  /**
+   * Returns Strickler table used for Land Cover scalar map coloring in the given view.
+   * @param theViewId the view id
+   * @return the Strickler table used for scalar map coloring of Land Covers in the given view;
+             null - if scalar map coloring is off for the view  
+   */
+  Handle(HYDROData_StricklerTable) getLandCoverColoringTable( const int theViewId ) const;
+
+  /**
+   * Set Strickler table to be used for Land Cover scalar map coloring in the given view.
+   * @param theViewId the view id
+   * @param theTable the Strickler table
+   */
+  void                             setLandCoverColoringTable( const int theViewId,
+                                                              const Handle(HYDROData_StricklerTable)& theTable );
+  /**
+   * Set Land Cover scalar map coloring mode off for the given view.
+   * @param theViewId the view id
+   */
+  void                             setLandCoversScalarMapModeOff( const int theViewId );
+
+  /**
+   * Check if Land Cover scalar map coloring mode is on in the given view.
+   * @param theViewId the view id
+   * @return true if the mode is on, false if the mode is off
+   */
+  bool                             isLandCoversScalarMapModeOn( const int theViewId ) const;
+
 protected:
   CAM_DataModel*                  createDataModel();
 
@@ -279,6 +311,8 @@ private:
   bool                            myIsUpdateEnabled;
 
   QStringList                     myGeomObjectsToImport; ///< entries of GEOM objects to be imported
+
+  ViewId2StricklerTable           myLandCoverColoringMap;
 };
 
 #endif
index 40256a51b2e6b54640a4812ff8cd00e5e8df8d62..6cfbf67e20ebbfedb2ef2d6d431a2159eb88628b 100644 (file)
 #include "HYDROGUI_Tool.h"
 #include <HYDROGUI_ShapeImage.h>
 #include <HYDROGUI_ShapeBathymetry.h>
+#include <HYDROGUI_ShapeLandCover.h>
 #include "HYDROGUI_Operation.h"
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_ZLayers.h"
+
 #include <HYDROData_Bathymetry.h>
+#include <HYDROData_LandCover.h>
+#include <HYDROData_StricklerTable.h>
 
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
@@ -141,7 +145,9 @@ void HYDROGUI_OCCDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs,
     module()->removeObjectShape( (size_t)aViewer, anObj );
   }
   aViewer->update();
-  UpdateColorScale( aViewer );
+  if ( !module()->isLandCoversScalarMapModeOn( (size_t)aViewer ) ) {
+    UpdateColorScale( aViewer );
+  }
 }
 
 HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int                             theViewerId,
@@ -159,6 +165,10 @@ HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int
     aResShape = new HYDROGUI_ShapeImage( theContext, Handle_HYDROData_Image::DownCast( theObject ) );
   else if( theObject->IsKind( STANDARD_TYPE( HYDROData_Bathymetry ) ) )
     aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle_HYDROData_Bathymetry::DownCast( theObject ) );
+  else if( theObject->IsKind( STANDARD_TYPE( HYDROData_LandCover ) ) ) {
+    bool isScalarMode = module()->isLandCoversScalarMapModeOn( theViewerId );
+    aResShape = new HYDROGUI_ShapeLandCover( this, theContext, Handle_HYDROData_LandCover::DownCast( theObject ), -1, isScalarMode );
+  }
   else
     aResShape = new HYDROGUI_Shape( theContext, theObject );
 
@@ -400,16 +410,19 @@ void HYDROGUI_OCCDisplayer::SetToUpdateColorScale()
 
 void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer )
 {
-  if( !myToUpdateColorScale )
+  if( !myToUpdateColorScale || !theViewer )
     return;
-
+  
   OCCViewer_ViewWindow* aWnd = dynamic_cast<OCCViewer_ViewWindow*>( theViewer->getViewManager()->getActiveView() );
   Handle(V3d_View) aView = aWnd->getViewPort()->getView();
-
+    
   int aViewerId = (size_t)theViewer;//TODO: check if viewer id is correct
-  QList<HYDROGUI_Shape*> aShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY );
+  bool isLandCoverColoringOn = module()->isLandCoversScalarMapModeOn( aViewerId );
+    
+  QList<HYDROGUI_Shape*> aLandCoverShapes = module()->getObjectShapes( aViewerId, KIND_LAND_COVER );
+  QList<HYDROGUI_Shape*> aBathShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY );
 
-  bool isDisplayColorScale = !aShapes.empty();
+  bool isDisplayColorScale = !aBathShapes.empty() || isLandCoverColoringOn;
   Standard_Real anXPos = 0.05; //TODO
   Standard_Real anYPos = 0.1; //TODO
   Standard_Real aWidth = 0.2; //TODO
@@ -418,27 +431,42 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
   Standard_Integer aNbIntervals = 20; //TODO
   TCollection_ExtendedString aColorScaleTitle = "";//TODO
 
-  Standard_Real aColorScaleMin = 0, aColorScaleMax = 1, aMin, aMax;
-  bool isFirst = true;
-  foreach( HYDROGUI_Shape* aShape, aShapes )
-  {
-    HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
-    if( !aBathShape || !aBathShape->isVisible() )
-      continue;
+  Standard_Real aColorScaleMin = 0, aColorScaleMax = 1;
+
+  // Get range
+  Handle(HYDROData_StricklerTable) aTable;
+  TColStd_SequenceOfExtendedString aTableTypes;
+  if ( isLandCoverColoringOn ) {
+    aTable = module()->getLandCoverColoringTable( aViewerId );
+    if ( !aTable.IsNull() ) {
+      aColorScaleTitle = TCollection_ExtendedString( aTable->GetName().toLatin1().constData() );
+      aTable->GetCoefficientRange( aColorScaleMin, aColorScaleMax );
+      aTableTypes = aTable->GetTypes();
+    }
+  } else {
+    Standard_Real aMin, aMax;
+    bool isFirst = true;
+    foreach( HYDROGUI_Shape* aShape, aBathShapes )
+    {
+      HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
+      if( !aBathShape || !aBathShape->isVisible() )
+        continue;
 
-    aBathShape->GetRange( aMin, aMax );
+      aBathShape->GetRange( aMin, aMax );
 
-    if( isFirst || aMin < aColorScaleMin )
-      aColorScaleMin = aMin;
-    if( isFirst || aMax > aColorScaleMax )
-      aColorScaleMax = aMax;
+      if( isFirst || aMin < aColorScaleMin )
+        aColorScaleMin = aMin;
+      if( isFirst || aMax > aColorScaleMax )
+        aColorScaleMax = aMax;
 
-    isFirst = false;
+      isFirst = false;
+    }
   }
 
+  Handle(Aspect_ColorScale) aColorScale;
   if( isDisplayColorScale )
   {
-    Handle(Aspect_ColorScale) aColorScale = aView->ColorScale();
+    aColorScale = aView->ColorScale();
     if( !aColorScale.IsNull() )
     {
       aColorScale->SetXPosition( anXPos );
@@ -452,13 +480,14 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
       aColorScale->SetTitle( aColorScaleTitle );
       aColorScale->SetRange( aColorScaleMin, aColorScaleMax );
 
-      foreach( HYDROGUI_Shape* aShape, aShapes )
-      {
-        HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
-        if( !aBathShape || !aBathShape->isVisible() )
-          continue;
+      if ( !isLandCoverColoringOn ) {
+        foreach( HYDROGUI_Shape* aShape, aBathShapes ) {
+          HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
+          if( !aBathShape || !aBathShape->isVisible() )
+            continue;
 
-        aBathShape->UpdateWithColorScale( aColorScale );
+          aBathShape->UpdateWithColorScale( aColorScale );
+        }
       }
     }
     if( !aView->ColorScaleIsDisplayed() )
@@ -470,5 +499,46 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
       aView->ColorScaleErase();
   }
 
+  foreach( HYDROGUI_Shape* aShape, aLandCoverShapes ) {
+    HYDROGUI_ShapeLandCover* aLandCoverShape = 
+      dynamic_cast<HYDROGUI_ShapeLandCover*>( aShape );
+
+    if ( !aLandCoverShape || !aLandCoverShape->isVisible() ) {
+      continue;
+    }
+    
+    Handle(HYDROData_LandCover) aLandCover = 
+      Handle(HYDROData_LandCover)::DownCast( aLandCoverShape->getObject() );
+
+    if ( aLandCover.IsNull() ) {
+      continue;
+    }
+    
+    QColor aUndefinedColor( Qt::gray );
+    QColor aColor = isLandCoverColoringOn ? aUndefinedColor : aLandCover->GetFillingColor();
+    
+    if ( isLandCoverColoringOn && !aTable.IsNull() ) {
+      TCollection_ExtendedString aStricklerType = 
+        aLandCover->GetStricklerType().toLatin1().constData();
+     
+      if ( aTable->HasType( aStricklerType ) ) {
+        double aStricklerCoeff = aTable->Get( aStricklerType, 0 );
+        Quantity_Color aShapeColor;
+        if ( aColorScale->FindColor( aStricklerCoeff, aShapeColor ) ) {
+          aColor = QColor( aShapeColor.Red() * 255, 
+                           aShapeColor.Green() * 255,
+                           aShapeColor.Blue() * 255 );
+        }
+      }
+    }
+    
+    aLandCoverShape->setFillingColor( aColor, true, true );
+    aLandCoverShape->setScalarMapModeEnabled( isLandCoverColoringOn );
+    theViewer->getAISContext()->Redisplay( aLandCoverShape->getAISObject() );
+    //theViewer->getAISContext()->UpdateCurrentViewer(); //@MZN
+    //theViewer->getAISContext()->UpdateCurrent();
+    //theViewer->getAISContext()->UpdateSelected( true );
+  }
+
   myToUpdateColorScale = false;
 }
index bd89dfe291095c74e7b7112e713a80642ede679e..b454518df71d61c18382af2604aa433b2434ec6b 100644 (file)
@@ -109,7 +109,7 @@ protected:
   void                            purgeObjects( const int theViewerId );
 
   void UpdateColorScale( const OCCViewer_Viewer* );
-
+  
 private:
   /**
    * \brief Creates new OCC shape.
index 57d8f8185ad5e591ea4f3730ed11ae7c133a3bcc..ad34f778a3fed7121b7017a1218ef59bc1e24e0f 100644 (file)
@@ -66,6 +66,7 @@
 #include "HYDROGUI_ExportSinusXOp.h"
 #include "HYDROGUI_MergePolylinesOp.h"
 #include "HYDROGUI_SplitPolylinesOp.h"
+#include "HYDROGUI_LandCoverColoringOp.h"
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Obstacle.h>
@@ -213,6 +214,9 @@ void HYDROGUI_Module::createActions()
 
   createAction( SplitPolylinesId, "SPLIT_POLYLINES", "SPLIT_POLYLINES_ICO" );
   createAction( MergePolylinesId, "MERGE_POLYLINES", "MERGE_POLYLINES_ICO" );
+
+  createAction( LandCoverScalarMapModeOnId, "LC_SCALARMAP_COLORING_ON" );
+  createAction( LandCoverScalarMapModeOffId, "LC_SCALARMAP_COLORING_OFF" );
 }
 
 void HYDROGUI_Module::createMenus()
@@ -607,6 +611,10 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case MergePolylinesId:
     anOp = new HYDROGUI_MergePolylinesOp( aModule );
     break;
+  case LandCoverScalarMapModeOnId:
+  case LandCoverScalarMapModeOffId:
+    anOp = new HYDROGUI_LandCoverColoringOp( aModule, theId );
+    break;
   }
 
   if( !anOp )
index b03423b96c42d3aee1d74f5509a402bfe5306557..5d5c73bbf34511d4aec52dc6ee5a6d241b284d5c 100644 (file)
@@ -126,6 +126,9 @@ enum OperationId
 
   SplitPolylinesId,
   MergePolylinesId,
+
+  LandCoverScalarMapModeOnId,
+  LandCoverScalarMapModeOffId
 };
 
 #endif
index 1b551cfc17799a0f500add6305dadd8d2cd7b94e..c17903a3b67f415d202c00af34d0df081614f63a 100644 (file)
@@ -62,48 +62,53 @@ HYDROGUI_OrderedListWidget::HYDROGUI_OrderedListWidget( QWidget* theParent, int
 
   myList->setModel( aFilteredModel );
 
-  // Buttons top, up, down, bottom
-  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  myTop = new QPushButton( this );
-  myTop->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_TOP_ICO" ) ) );
-  myTop->setIconSize( QSize( theArrowIconSize, theArrowIconSize ) );
-  myTop->setToolTip( tr( "TOP_TLT" ) );
-  myUp = new QPushButton( this );
-  myUp->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_UP_ICO" ) ) );
-  myUp->setIconSize( myTop->iconSize() );
-  myUp->setToolTip( tr( "UP_TLT" ) );
-  myDown = new QPushButton( this );
-  myDown->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_DOWN_ICO" ) ) );
-  myDown->setIconSize( myTop->iconSize() );
-  myDown->setToolTip( tr( "DOWN_TLT" ) );
-  myBottom = new QPushButton( this );
-  myBottom->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_BOTTOM_ICO" ) ) );
-  myBottom->setIconSize( myTop->iconSize() );
-  myBottom->setToolTip( tr( "BOTTOM_TLT" ) );
-
-  // Layout
-  // buttons
-  QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
-  aListButtonsLayout->addWidget( myTop );
-  aListButtonsLayout->addWidget( myUp );
-  aListButtonsLayout->addWidget( myDown );
-  aListButtonsLayout->addWidget( myBottom );
-  aListButtonsLayout->addStretch();
-  // main
+  // Add list to the main layout
   aMainLayout->addWidget( myList );
-  aMainLayout->addLayout( aListButtonsLayout );
-
-  // Connections
-  QSignalMapper* aSignalMapper = new QSignalMapper( this );
-  aSignalMapper->setMapping( myTop, HYDROGUI_ListModel::Top );
-  aSignalMapper->setMapping( myUp, HYDROGUI_ListModel::Up );
-  aSignalMapper->setMapping( myDown, HYDROGUI_ListModel::Down );
-  aSignalMapper->setMapping( myBottom, HYDROGUI_ListModel::Bottom );
-  connect( myTop, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( myUp, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( myDown, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( myBottom, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( aSignalMapper, SIGNAL( mapped( int ) ), this, SLOT( onMove( int ) ) );
+
+  // Buttons top, up, down, bottom
+  if ( theArrowIconSize > 0 ) {
+    SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+    myTop = new QPushButton( this );
+    myTop->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_TOP_ICO" ) ) );
+    myTop->setIconSize( QSize( theArrowIconSize, theArrowIconSize ) );
+    myTop->setToolTip( tr( "TOP_TLT" ) );
+    myUp = new QPushButton( this );
+    myUp->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_UP_ICO" ) ) );
+    myUp->setIconSize( myTop->iconSize() );
+    myUp->setToolTip( tr( "UP_TLT" ) );
+    myDown = new QPushButton( this );
+    myDown->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_DOWN_ICO" ) ) );
+    myDown->setIconSize( myTop->iconSize() );
+    myDown->setToolTip( tr( "DOWN_TLT" ) );
+    myBottom = new QPushButton( this );
+    myBottom->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_BOTTOM_ICO" ) ) );
+    myBottom->setIconSize( myTop->iconSize() );
+    myBottom->setToolTip( tr( "BOTTOM_TLT" ) );
+
+    // Add buttons to the main layout
+    QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
+    aListButtonsLayout->addWidget( myTop );
+    aListButtonsLayout->addWidget( myUp );
+    aListButtonsLayout->addWidget( myDown );
+    aListButtonsLayout->addWidget( myBottom );
+    aListButtonsLayout->addStretch();
+    
+    aMainLayout->addLayout( aListButtonsLayout );
+
+    // Buttons connections
+    QSignalMapper* aSignalMapper = new QSignalMapper( this );
+    aSignalMapper->setMapping( myTop, HYDROGUI_ListModel::Top );
+    aSignalMapper->setMapping( myUp, HYDROGUI_ListModel::Up );
+    aSignalMapper->setMapping( myDown, HYDROGUI_ListModel::Down );
+    aSignalMapper->setMapping( myBottom, HYDROGUI_ListModel::Bottom );
+    connect( myTop, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( myUp, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( myDown, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( myBottom, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( aSignalMapper, SIGNAL( mapped( int ) ), this, SLOT( onMove( int ) ) );
+  } else {
+    myTop = myUp = myDown = myBottom = 0;
+  }
 
   connect ( myList->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), 
             this, SIGNAL( selectionChanged() ) );
@@ -352,10 +357,12 @@ HYDROGUI_ListModel* HYDROGUI_OrderedListWidget::getSourceModel() const
 void HYDROGUI_OrderedListWidget::setOrderingEnabled( const bool theIsToEnable )
 {
   // enable/disable arrow buttons
-  myTop->setEnabled( theIsToEnable );
-  myUp->setEnabled( theIsToEnable );
-  myDown->setEnabled( theIsToEnable );
-  myBottom->setEnabled( theIsToEnable );
+  if ( myTop && myUp && myDown && myBottom ) {
+    myTop->setEnabled( theIsToEnable );
+    myUp->setEnabled( theIsToEnable );
+    myDown->setEnabled( theIsToEnable );
+    myBottom->setEnabled( theIsToEnable );
+  }
 
   // enable/disable drag and drop
   myList->setDragEnabled( theIsToEnable );
index 5b948492903d2dc07586918d1808e1d4461c25db..9eb098fed541c823c562d616f07f6189ff9ddcc2 100644 (file)
@@ -53,6 +53,7 @@
 #include <gp_GTrsf.hxx>
 
 #include <QDialog>
+#include <QDir>
 #include <QTemporaryFile>
 
 /**
@@ -99,7 +100,7 @@ void HYDROGUI_RecognizeContoursOp::startOperation()
 
   // Create temporary graphics file
   QImage aQImage = myImage->Image();
-  myTmpImageFile = new QTemporaryFile( anImageName );
+  myTmpImageFile = new QTemporaryFile( QDir::tempPath() + QDir::separator() + anImageName );
   if ( !myTmpImageFile->open() || 
        !aQImage.save( myTmpImageFile->fileName(), "PNG", 100 ) ) {
     abort();
index 45b88dee547714b95df652013d88289608f6d0db..cca862a65321795e3a2e95ffa53e82f40740c2d8 100644 (file)
@@ -44,14 +44,21 @@ HYDROGUI_SetColorOp::~HYDROGUI_SetColorOp()
 {
 }
 
-bool HYDROGUI_SetColorOp::CanObjectBeColored( const Handle(HYDROData_Entity)& theObject )
+bool HYDROGUI_SetColorOp::CanObjectBeColored( const Handle(HYDROData_Entity)& theObject,
+                                              HYDROGUI_Module* theModule )
 {
   if ( theObject.IsNull() )
     return false;
 
-  return theObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) ||
-         theObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) ) ||
-         theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) );
+  bool isCanBeColored = false;
+  if ( theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) ) {
+    size_t anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( theModule );
+    isCanBeColored = !theModule->isLandCoversScalarMapModeOn( anActiveViewId );
+  }
+
+  return isCanBeColored ||
+         theObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) ||
+         theObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) );
 }
 
 void HYDROGUI_SetColorOp::startOperation()
@@ -61,7 +68,7 @@ void HYDROGUI_SetColorOp::startOperation()
   // Get the selected object
   //myEditedObject = Handle(HYDROData_Object)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
   myEditedObject = HYDROGUI_Tool::GetSelectedObject( module() );
-  if ( !CanObjectBeColored( myEditedObject ) )
+  if ( !CanObjectBeColored( myEditedObject, module() ) )
   {
     abort();
     return;
index ceb6f7ac56f7b021b6f97ecd89751ecf64f3485b..cd9affd8b01c98dfbc0b424334f75a12c222d50d 100644 (file)
@@ -34,7 +34,8 @@ public:
   virtual ~HYDROGUI_SetColorOp();
 
 
-  static bool CanObjectBeColored( const Handle(HYDROData_Entity)& theObject );
+  static bool CanObjectBeColored( const Handle(HYDROData_Entity)& theObject,
+                                  HYDROGUI_Module* theModule );
 
 protected:
   virtual void startOperation();
index 4d015a5c52035044665c62b4f321b1088ce480fe..7e7f3314dd378a8886e00c3015d736df8c996b85 100644 (file)
@@ -300,22 +300,6 @@ void HYDROGUI_Shape::update( bool isUpdateViewer,
 
       setShape( aCompound, false, false );  
     }
-    else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) )
-    {
-      Handle(HYDROData_LandCover) aLandCoverObj =
-        Handle(HYDROData_LandCover)::DownCast( myObject );
-
-      TopoDS_Shape aLandCoverShape = aLandCoverObj->GetShape();
-      if ( !aLandCoverShape.IsNull() ) {
-        setShape( aLandCoverShape, false, false );
-      }
-
-      QColor aFillingColor = aLandCoverObj->GetFillingColor();
-      QColor aBorderColor = aLandCoverObj->GetBorderColor();
-
-      setFillingColor( aFillingColor, false, false );
-      setBorderColor( aBorderColor, false, false );
-    }
   }
  
   if ( myShape.IsNull() || !isVisible() )
diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCover.cxx b/src/HYDROGUI/HYDROGUI_ShapeLandCover.cxx
new file mode 100644 (file)
index 0000000..635470a
--- /dev/null
@@ -0,0 +1,94 @@
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ShapeLandCover.h"
+#include "HYDROGUI_OCCDisplayer.h"
+
+#include <HYDROData_LandCover.h>
+
+#include <AIS_InteractiveContext.hxx>
+
+HYDROGUI_ShapeLandCover::HYDROGUI_ShapeLandCover( HYDROGUI_OCCDisplayer*                theDisplayer,
+                                                  const Handle(AIS_InteractiveContext)& theContext,
+                                                  const Handle_HYDROData_LandCover&     theLandCover,
+                                                  const int                             theZLayer,
+                                                  const bool                            theIsScalarMode )
+: HYDROGUI_Shape( theContext, theLandCover, theZLayer ),
+  myDisplayer( theDisplayer ),
+  myIsScalarMapMode( theIsScalarMode )
+{
+}
+
+HYDROGUI_ShapeLandCover::~HYDROGUI_ShapeLandCover()
+{
+}
+
+void HYDROGUI_ShapeLandCover::update( bool theIsUpdateViewer, bool isDeactivateSelection )
+{
+  setIsToUpdate( false );
+
+  Handle(HYDROData_LandCover) aLandCoverObj =
+    Handle(HYDROData_LandCover)::DownCast( getObject() );
+
+  TopoDS_Shape aLandCoverShape = aLandCoverObj->GetShape();
+  if ( !aLandCoverShape.IsNull() ) {
+    setShape( aLandCoverShape, false, false );
+  }
+
+  if ( !myIsScalarMapMode ) {
+    QColor aFillingColor = aLandCoverObj->GetFillingColor();
+    QColor aBorderColor = aLandCoverObj->GetBorderColor();
+
+    setFillingColor( aFillingColor, false, false );
+    setBorderColor( aBorderColor, false, false );
+  } else {
+    updateShape( false, false );
+  }
+
+  HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection );
+}
+
+void HYDROGUI_ShapeLandCover::setScalarMapModeEnabled( const bool theIsToEnable )
+{
+  myIsScalarMapMode = theIsToEnable;
+}
+
+void HYDROGUI_ShapeLandCover::setVisible( const bool theState,
+                                           const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeLandCover::displayShape( const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::displayShape( theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeLandCover::display( const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::display( theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeLandCover::erase( const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::erase( theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCover.h b/src/HYDROGUI/HYDROGUI_ShapeLandCover.h
new file mode 100644 (file)
index 0000000..3f89307
--- /dev/null
@@ -0,0 +1,60 @@
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_SHAPE_LANDCOVER_H
+#define HYDROGUI_SHAPE_LANDCOVER_H
+
+#include <HYDROGUI_Shape.h>
+
+class Handle_HYDROData_LandCover;
+class HYDROGUI_OCCDisplayer;
+
+class HYDROGUI_ShapeLandCover : public HYDROGUI_Shape
+{
+public:
+  HYDROGUI_ShapeLandCover( HYDROGUI_OCCDisplayer* theDisplayer,
+                            const Handle(AIS_InteractiveContext)& theContext,
+                            const Handle_HYDROData_LandCover&     theLandCover,
+                            const int                             theZLayer = -1,
+                            const bool                            theIsScalarMode = false );
+  virtual ~HYDROGUI_ShapeLandCover();
+  
+  virtual void              update( bool isUpdateViewer,
+                                    bool isDeactivateSelection );
+
+  virtual void display( const bool theIsUpdateViewer = true );
+  virtual void erase( const bool theIsUpdateViewer = true );
+
+  virtual void               setVisible( const bool theState,
+                                         const bool theIsUpdateViewer = true );
+
+  /**
+   * Enable/disable scalar map coloring mode.
+   * @param theIsToEnable if true - scalar map coloring mode willbe enbaled, if false - disabled
+   */
+  virtual void              setScalarMapModeEnabled( const bool theIsToEnable );
+
+protected:
+  virtual void displayShape( const bool theIsUpdateViewer );
+
+private:
+  HYDROGUI_OCCDisplayer* myDisplayer;
+  bool                   myIsScalarMapMode;
+};
+
+#endif
index 066d0190f2bb90ba836c3c300cc40785c31fce2f..c3185734493165204c92c26363cb8b15e007a321 100644 (file)
@@ -21,6 +21,7 @@
 #include <GraphicsView_Viewer.h>
 
 #include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
index 8b4f7050fada1831bd6eaeec0962f11f574f2cbc..95f0750bda8f08194e944d5882ba655a72347a68 100644 (file)
 
 #include "HYDROGUI_StreamDlg.h"
 
+#include "HYDROGUI_ListSelector.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OrderedListWidget.h"
 #include "HYDROGUI_Tool.h"
 
+#include <HYDROData_Profile.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
 #include <QComboBox>
 #include <QGroupBox>
 #include <QLabel>
@@ -51,12 +59,12 @@ HYDROGUI_StreamDlg::HYDROGUI_StreamDlg( HYDROGUI_Module* theModule, const QStrin
   anAxisLayout->addWidget( new QLabel( tr( "STREAM_HYDRAULIC_AXIS" ) ) );
   anAxisLayout->addWidget( myAxes );
 
-  myProfiles = new QListWidget( aParamGroup );
-  myProfiles->setSelectionMode( QListWidget::ExtendedSelection );
-  myProfiles->setEditTriggers( QListWidget::NoEditTriggers );
-  myProfiles->setViewMode( QListWidget::ListMode );
-  myProfiles->setSortingEnabled( false );
-
+  myProfiles = new HYDROGUI_OrderedListWidget( aParamGroup, 0 );
+  myProfiles->setHiddenObjectsShown(true);
+  myProfiles->setVisibilityIconShown(false);
+  myProfiles->setContentsMargins(QMargins());
+  myProfiles->setOrderingEnabled( false );
   myAddButton = new QPushButton( aParamGroup );
   myAddButton->setText( tr("ADD") );
   myRemoveButton = new QPushButton( aParamGroup );
@@ -80,6 +88,13 @@ HYDROGUI_StreamDlg::HYDROGUI_StreamDlg( HYDROGUI_Module* theModule, const QStrin
   addWidget( aParamGroup );
   addStretch();
 
+  // Create selector
+  if ( module() ) {
+    HYDROGUI_ListSelector* aListSelector = 
+      new HYDROGUI_ListSelector( myProfiles, module()->getApp()->selectionMgr() );
+    aListSelector->setAutoBlock( true );
+  }
+
   // Connect signals and slots
   connect( myAxes, SIGNAL( currentIndexChanged( const QString & ) ), 
            this, SIGNAL( AxisChanged( const QString& ) ) );
@@ -98,7 +113,7 @@ void HYDROGUI_StreamDlg::reset()
   myObjectName->clear();
 
   myAxes->clear();
-  myProfiles->clear();
+  myProfiles->setObjects( HYDROGUI_ListModel::Object2VisibleList() );
   myAddButton->setEnabled( false );
   myRemoveButton->setEnabled( false );
 
@@ -149,13 +164,18 @@ void HYDROGUI_StreamDlg::setProfiles( const QStringList& theProfiles )
 
   myProfiles->setUpdatesEnabled( false );
   
-  myProfiles->clear();
+  HYDROGUI_ListModel::Object2VisibleList aProfiles;
   foreach ( const QString& aProfileName, theProfiles ) {
-    QListWidgetItem* aListItem = new QListWidgetItem( aProfileName, myProfiles );
-    aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
+    Handle(HYDROData_Profile) anObject = Handle(HYDROData_Profile)::DownCast( 
+      HYDROGUI_Tool::FindObjectByName( module(), aProfileName ) );
+    if ( !anObject.IsNull() ) {
+      aProfiles.append( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
+    }
   }
 
-  myRemoveButton->setEnabled( myProfiles->count() > 0 );
+  myProfiles->setObjects( aProfiles );
+
+  myRemoveButton->setEnabled( myProfiles->getObjects().count() > 0 );
 
   myProfiles->setUpdatesEnabled( true );
 
@@ -164,15 +184,7 @@ void HYDROGUI_StreamDlg::setProfiles( const QStringList& theProfiles )
 
 void HYDROGUI_StreamDlg::onRemoveProfiles()
 {
-  QStringList aSelectedProfiles;
-
-  QList<QListWidgetItem*> aSelectedItems = myProfiles->selectedItems();
-  foreach( const QListWidgetItem* anItem, aSelectedItems ) {
-    QString aProfileName = anItem->text();
-    if ( !aProfileName.isEmpty() ) {
-      aSelectedProfiles << aProfileName;
-    }
-  }
+  QStringList aSelectedProfiles = myProfiles->getSelectedNames();
 
   emit RemoveProfiles( aSelectedProfiles );
 }
index 06ffcf1f008327845014cc69803b11ace03ef3d5..a9679f4e7b16160b30d07f3b0199bc662e21e8ad 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "HYDROGUI_InputPanel.h"
 
+class HYDROGUI_OrderedListWidget;
+
 class QComboBox;
 class QGroupBox;
 class QLineEdit;
@@ -59,10 +61,10 @@ private:
   QGroupBox*                 myObjectNameGroup;
   QLineEdit*                 myObjectName;
 
-  QComboBox*                 myAxes;
-  QListWidget*               myProfiles;
-  QPushButton*               myRemoveButton;
-  QPushButton*               myAddButton;
+  QComboBox*                  myAxes;
+  HYDROGUI_OrderedListWidget* myProfiles;
+  QPushButton*                myRemoveButton;
+  QPushButton*                myAddButton;
 };
 
 #endif
index d11ea2c3f3ef669b7479e5c89a86eb8c83e9ba0d..6162acb8e391d9ae2836e8f09dc9e084886dbd42 100755 (executable)
@@ -435,20 +435,7 @@ void HYDROGUI_StreamOp::onAddProfiles()
 void HYDROGUI_StreamOp::onRemoveProfiles( const QStringList& theProfilesToRemove )
 {
   QStringList aToRemove = theProfilesToRemove;
-
-  // Take the Object Browser selection into account
-  HYDROData_SequenceOfObjects aSelectedObjects = HYDROGUI_Tool::GetSelectedObjects( module() ); 
-  for( int i = 1, n = aSelectedObjects.Length(); i <= n; i++ )
-  {
-    Handle(HYDROData_Profile) aProfile = 
-      Handle(HYDROData_Profile)::DownCast( aSelectedObjects.Value( i ) );
-    if ( aProfile.IsNull() )
-      continue;
-
-    QString aProfileName = aProfile->GetName();
-    aToRemove.append( aProfileName );
-  }
-
+  
   aToRemove.removeDuplicates();
   if ( aToRemove.isEmpty() )
     return;
index 7f021249af4ac11fc8a8be0fdbb1fcebf164a77d..dc915f301f4464604900e1599bb46733598c7bf5 100644 (file)
 
 #include "HYDROGUI_StricklerTableDlg.h"
 #include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
 
@@ -181,9 +184,11 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
     {
         QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aStricklerTableObj );
         theBrowseObjectsEntries.append( anEntry );
+    } else {
+      module()->getOCCDisplayer()->SetToUpdateColorScale();
     }
 
-    theUpdateFlags |= UF_ObjBrowser;
+    theUpdateFlags |= UF_ObjBrowser | UF_OCCViewer;
 
     return true;
 }
index f8e4a527edb17b47c82e3c56b76a2a49186aa984..bfc47fc4ca322d6398543222cbcb80c68155839f 100644 (file)
@@ -1668,6 +1668,32 @@ Would you like to remove all references from the image?</translation>
       <translation>Recognize contours</translation>
     </message>
 
+    <message>
+      <source>MEN_LC_SCALARMAP_COLORING_ON</source>
+      <translation>Use as scalar scale</translation>
+    </message>
+    <message>
+      <source>DSK_LC_SCALARMAP_COLORING_ON</source>
+      <translation>Use the table as a scalar scale for Land Covers coloring</translation>
+    </message>
+    <message>
+      <source>STB_LC_SCALARMAP_COLORING_ON</source>
+      <translation>Use as scalar scale</translation>
+    </message>
+
+    <message>
+      <source>MEN_LC_SCALARMAP_COLORING_OFF</source>
+      <translation>Scalar map mode off</translation>
+    </message>
+    <message>
+      <source>DSK_LC_SCALARMAP_COLORING_OFF</source>
+      <translation>Turn off Land Covers scalar map coloring mode</translation>
+    </message>
+    <message>
+      <source>STB_LC_SCALARMAP_COLORING_OFF</source>
+      <translation>Scalar map mode off</translation>
+    </message>
+
   </context>
   
   <context>
index df0279af4021698366809d39d33d57365f2ebad2..d925944a17564b6667b7fc32c00ee4115145dd3f 100644 (file)
@@ -528,10 +528,14 @@ public:
   %End
 
   QString DumpRules();
+  QString DumpLandCoverRules();
 
   void SetAssignmentMode( AssignmentMode theMode );
   AssignmentMode GetAssignmentMode() const;
 
+  void SetAssignmentLandCoverMode( AssignmentMode theMode );
+  AssignmentMode GetAssignmentLandCoverMode() const;
+
 protected:
 
   /**