X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ShapeBathymetry.cxx;h=a6de2d915509941d23825af2618fac74c0cf06e5;hb=92c3e5ddda56d434c842e744b3db1341ad2f87f5;hp=105d13290396cecd1a89e71b9ecc5a2705915bd9;hpb=ef27ece3930dd97dacf7b3a14a0792cb6ebb1af6;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index 105d1329..a6de2d91 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,9 @@ #include #include +//#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, const Handle(HYDROData_Bathymetry)& theBathymetry, @@ -67,6 +71,7 @@ void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivate QList HYDROGUI_ShapeBathymetry::createShape() const { + DEBTRACE("createShape"); QList shapes; Handle(AIS_InteractiveObject) aPntCloud; @@ -96,6 +101,7 @@ QList HYDROGUI_ShapeBathymetry::createShape() con void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale ) { + DEBTRACE("UpdateWithColorScale"); if (!myCoords || getAISObjects().isEmpty()) return; @@ -227,22 +233,15 @@ void HYDROGUI_ShapeBathymetry::RescaleByVisible( OCCViewer_ViewWindow* theWindow QVector HYDROGUI_ShapeBathymetry::selected() const { + DEBTRACE("selected"); QVector selected; - selected.reserve( myCoords->Size() ); - Handle(AIS_InteractiveObject) obj = getAISObjects().first(); + // HYDROGUI_BathymetryPrs::ClearSelected() called before: Nothing left... - Handle(AIS_InteractiveContext) c = getContext(); - if( !c.IsNull() ) - { - for( c->InitSelected(); c->MoreSelected(); c->NextSelected() ) - { - Handle(HYDROGUI_BathymetryPointOwner) anOwner = - Handle(HYDROGUI_BathymetryPointOwner)::DownCast( c->SelectedOwner() ); - if( !anOwner.IsNull() && anOwner->Selectable()==obj ) - selected.append( anOwner->GetIndex() ); - } - } + Handle(HYDROGUI_BathymetryPrs) aPntCloud = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObjects()[0] ); + if (!aPntCloud.IsNull()) + selected = aPntCloud->getSelectedPoints(); + DEBTRACE("selected " << selected.size()); return selected; } @@ -265,8 +264,7 @@ void HYDROGUI_ShapeBathymetry::Rescale( double theMin, double theMax ) if( !getAISObjects().isEmpty() ) { getContext()->RecomputePrsOnly( getAISObjects()[0], true ); - //getAISObjects()[0]->Redisplay(); -} + } } void HYDROGUI_ShapeBathymetry::RescaleDefault() @@ -303,6 +301,7 @@ void HYDROGUI_ShapeBathymetry::Build() void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer ) { + DEBTRACE("TextLabels " << isOn << " " << isUpdateCurrentViewer); if( getAISObjects().isEmpty() ) return; @@ -315,10 +314,8 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer selection = selected(); - //getContext()->ClearSelected(true); prs->SetTextLabels( selection ); getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False ); - //prs->Redisplay(); if( isUpdateCurrentViewer ) getContext()->UpdateCurrentViewer(); }