From: asl Date: Mon, 4 Dec 2017 13:12:35 +0000 (+0300) Subject: refs #1463: errors in text labels on 2 bathymetries X-Git-Tag: v2.1.1__salome84~7^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b35ee3b9879a726fe9462de880a86a7f1be16c63;p=modules%2Fhydro.git refs #1463: errors in text labels on 2 bathymetries --- diff --git a/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx index 2ea78966..b0d6eff7 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx @@ -141,7 +141,7 @@ void HYDROGUI_BathymetryOp::activate( bool isActivate ) case BathymetryTextId: { foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths ) - bath->GetShape()->TextLabels( isActivate ); + bath->GetShape()->TextLabels( isActivate, bath==baths.last() ); //commit(); if( isActivate ) connect( selectionMgr(), SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) ); @@ -238,7 +238,7 @@ void HYDROGUI_BathymetryOp::onSelectionChanged() if( myMode==BathymetryTextId ) { foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths ) - bath->GetShape()->TextLabels( true ); + bath->GetShape()->TextLabels( true, bath==baths.last() ); } qApp->restoreOverrideCursor(); diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index b7ce5594..7f8c604f 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -265,6 +265,8 @@ QVector HYDROGUI_ShapeBathymetry::selected() const QVector selected; selected.reserve( myCoords->Size() ); + Handle(AIS_InteractiveObject) obj = getAISObjects().first(); + Handle(AIS_InteractiveContext) c = getContext(); if( !c.IsNull() ) { @@ -275,7 +277,7 @@ QVector HYDROGUI_ShapeBathymetry::selected() const { Handle(HYDROGUI_BathymetryPointOwner) anOwner = Handle(HYDROGUI_BathymetryPointOwner)::DownCast( lc->SelectedOwner() ); - if( anOwner ) + if( !anOwner.IsNull() && anOwner->Selectable()==obj ) selected.append( anOwner->GetIndex() ); } } @@ -338,7 +340,7 @@ void HYDROGUI_ShapeBathymetry::Build() buildShape(); } -void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn ) +void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer ) { if( getAISObjects().isEmpty() ) return; @@ -353,7 +355,8 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn ) //getContext()->ClearSelected(); prs->SetTextLabels( selection ); - getContext()->RecomputePrsOnly( prs ); + getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False ); //prs->Redisplay(); - getContext()->UpdateCurrentViewer(); + if( isUpdateCurrentViewer ) + getContext()->UpdateCurrentViewer(); } diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h index e6ee5130..e88d0911 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h @@ -49,7 +49,7 @@ public: // Default re-scale (by all points) void RescaleDefault(); - void TextLabels( bool isOn ); + void TextLabels( bool isOn, bool isUpdateCurrentViewer=true ); virtual void display( const bool theIsUpdateViewer = true ); virtual void erase( const bool theIsUpdateViewer = true );