From: apo Date: Mon, 23 Jun 2008 15:44:15 +0000 (+0000) Subject: Fix for Bug VISU200819961 X-Git-Tag: TG_VISU_2008_2008-06-26~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b47abfb87f87f625f1d478a737c667d2a57fcac;p=modules%2Fvisu.git Fix for Bug VISU200819961 - Sweep functionality doesn?t operate with Gauss Points presentation. --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index dc89ef24..bbe027eb 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2582,9 +2582,10 @@ VisuGUI // Rules - QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' " - "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' " - "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TCOLOREDPRS3DHOLDER'"); + QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' " + "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' " + "'VISU::TSCALARMAPONDEFORMEDSHAPE'"); + QString aPrsAll = aSimplePrsAll + " 'VISU::TCOLOREDPRS3DHOLDER'"; // VISU root commands QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'"; @@ -2728,7 +2729,7 @@ VisuGUI aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0"; mgr->setRule( action( VISU_CREATE_TABLE ), aRule ); - aRule = "selcount=1 and ($type in {" + aPrsAll + "})"; + aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "})"; mgr->setRule( action( VISU_SWEEP ), aRule ); // "Selection info" popup item diff --git a/src/VISUGUI/VisuGUI_Sweep.cxx b/src/VISUGUI/VisuGUI_Sweep.cxx index addd3889..73b5fe65 100644 --- a/src/VISUGUI/VisuGUI_Sweep.cxx +++ b/src/VISUGUI/VisuGUI_Sweep.cxx @@ -296,17 +296,17 @@ namespace struct TEnabler { VisuGUI_Sweep* myWidget; - VISU_Actor*& myActor; + bool& myIsValidSelection; - TEnabler( VisuGUI_Sweep* theWidget, VISU_Actor*& theActor ) + TEnabler( VisuGUI_Sweep* theWidget, bool& theIsValidSelection ) : myWidget( theWidget ) - , myActor( theActor ) + , myIsValidSelection( theIsValidSelection ) {} ~TEnabler() { - myWidget->setEnabled( myActor ); - myWidget->onStop( !myActor ); + myWidget->setEnabled( myIsValidSelection ); + myWidget->onStop( !myIsValidSelection ); } }; } @@ -319,19 +319,22 @@ void VisuGUI_Sweep::onSelectionChanged() VISU::Prs3d_i* aPrs3d = NULL; SVTK_ViewWindow* aViewWindow = NULL; - TEnabler anEnabler( this, anActor ); + bool anIsValidSelection = VISU::GetPrs3dSelectionInfo( myModule, aPrs3d, aViewWindow, anActor ); - if( !VISU::GetPrs3dSelectionInfo( myModule, aPrs3d, aViewWindow, anActor ) ) + TEnabler anEnabler( this, anIsValidSelection ); + + if ( !anIsValidSelection ) return; - if ( anActor == myActor ) + if ( myActor.GetPointer() == anActor ) return; VISU::ScalarMap_i* aScalarMap = dynamic_cast< VISU::ScalarMap_i* >( aPrs3d ); - if ( !aScalarMap ) + anIsValidSelection &= ( aScalarMap && aScalarMap->IsTimeStampFixed() ); + if ( !anIsValidSelection ) return; - if ( myActor ) { + if ( myActor.GetPointer() ) { myScalarMap->SetMapScale( 1.0 ); myScalarMap->UpdateActor( myActor ); myViewWindow->Repaint();