// 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'";
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
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 );
}
};
}
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();