Salome HOME
cleaning some comments
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_BathymetrySelectionOp.cxx
index 3f550f1989878f5c45c2b4bb5c48bcff3a7060d3..8f723525b11fc5676efb61d15b84b8d3d5597266 100644 (file)
 #include <HYDROGUI_Operations.h>
 #include <OCCViewer_ViewManager.h>
 #include <LightApp_Application.h>
+#include <SUIT_Selector.h>
 #include <QAction>
 #include <QApplication>
+#include <QString>
+#include <QList>
+#include <LightApp_SelectionMgr.h>
 
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
 #include "HYDRO_trace.hxx"
 
 HYDROGUI_BathymetrySelectionOp::HYDROGUI_BathymetrySelectionOp( HYDROGUI_Module* theModule )
@@ -106,15 +110,14 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive )
   QList<Handle(HYDROGUI_BathymetryPrs)> baths = getShownBathymetries( module() );
   if( isActive )
   {
-    const int aSelectionMode = 1;  // 2 AIS_PointCloud selection bounding box
-    //ctx->Deactivate( Standard_True );
-    //ctx->OpenLocalContext( Standard_True );
+    const int aSelectionMode = 1;  // Cf. AIS_PointCloud 0=selection by points ?
     foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths )
     {
       DEBTRACE("bathy name: " << bath->GetShape()->getObject()->GetName().toStdString());
       ctx->Deactivate(bath);
-      ctx->Activate( bath, aSelectionMode, Standard_True );
-      bath->SetAutoHilight( Standard_False );
+      ctx->RemoveFilters();
+      ctx->SetSelectionModeActive (bath, aSelectionMode, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
+      bath->SetAutoHilight( Standard_False ); // True bloque le passage dans hilightSelected...
     }
     ctx->UpdateCurrentViewer();
   }
@@ -123,11 +126,12 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive )
     foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths )
     {
       bath->ClearSelected();
+      bath->ClearSelectedPoints();
       bath->SetAutoHilight( Standard_True );
       bath->GetShape()->TextLabels( false );
       ctx->Deactivate( bath );
+      ctx->SetSelectionModeActive (bath, 2, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
     }
-    //ctx->CloseLocalContext( -1, Standard_True );
   }
 
   myIsActive = isActive;