X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_BathymetrySelectionOp.cxx;h=8f723525b11fc5676efb61d15b84b8d3d5597266;hb=92c3e5ddda56d434c842e744b3db1341ad2f87f5;hp=dd5fb3cf0faeec51bdbb8ffbc704afde292179a3;hpb=6b75d9e23d4f01953f8993bc924c45f54809d66b;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx index dd5fb3cf..8f723525 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx @@ -25,12 +25,20 @@ #include #include #include +#include #include #include +#include +#include +#include + +//#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" HYDROGUI_BathymetrySelectionOp::HYDROGUI_BathymetrySelectionOp( HYDROGUI_Module* theModule ) : HYDROGUI_Operation( theModule ), myIsActive( false ) { + DEBTRACE("HYDROGUI_BathymetrySelectionOp"); } HYDROGUI_BathymetrySelectionOp::~HYDROGUI_BathymetrySelectionOp() @@ -39,11 +47,13 @@ HYDROGUI_BathymetrySelectionOp::~HYDROGUI_BathymetrySelectionOp() void HYDROGUI_BathymetrySelectionOp::startOperation() { + DEBTRACE("startOperation"); activateSelection( true ); } void HYDROGUI_BathymetrySelectionOp::abortOperation() { + DEBTRACE("abortOperation"); activateSelection( false ); module()->action( BathymetrySelectionId )->setChecked( false ); @@ -52,6 +62,7 @@ void HYDROGUI_BathymetrySelectionOp::abortOperation() bool HYDROGUI_BathymetrySelectionOp::isValid( SUIT_Operation* theOtherOp ) const { + DEBTRACE("isValid"); HYDROGUI_BathymetryOp* aBathOp = dynamic_cast( theOtherOp ); return ( aBathOp != 0 ); } @@ -88,6 +99,7 @@ QList getShownBathymetries( HYDROGUI_Module* the void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) { + DEBTRACE("activateSelection " << isActive); if( myIsActive==isActive ) return; @@ -98,12 +110,14 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) QList baths = getShownBathymetries( module() ); if( isActive ) { - const int aSelectionMode = 1; - ctx->OpenLocalContext( Standard_True ); + const int aSelectionMode = 1; // Cf. AIS_PointCloud 0=selection by points ? foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths ) { - ctx->Activate( bath, aSelectionMode, Standard_True ); - bath->SetAutoHilight( Standard_False ); + DEBTRACE("bathy name: " << bath->GetShape()->getObject()->GetName().toStdString()); + ctx->Deactivate(bath); + 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(); } @@ -112,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;