From: asv Date: Fri, 24 Jun 2005 06:13:27 +0000 (+0000) Subject: new function globalParam() of Selection is used in GEOM. X-Git-Tag: T3_0_0_a4~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=14c6b1f558173860eb0d3bd0dcd2084e665988f2;p=modules%2Fgeom.git new function globalParam() of Selection is used in GEOM. --- diff --git a/src/GEOMGUI/GEOMGUI_Selection.cxx b/src/GEOMGUI/GEOMGUI_Selection.cxx index a8f1673fd..c7ff2558f 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.cxx +++ b/src/GEOMGUI/GEOMGUI_Selection.cxx @@ -37,20 +37,21 @@ GEOMGUI_Selection::~GEOMGUI_Selection() { } -QtxValue GEOMGUI_Selection::param( const int ind, const QString& p ) const +QtxValue GEOMGUI_Selection::globalParam( const QString& p ) const { - QtxValue val( SalomeApp_Selection::param( ind, p ) ); - if ( !val.isValid() ) { - if ( p == "isVisible" ) val = QtxValue( isVisible( ind ) ); - else if ( p == "isOCC" ) val = QtxValue( isOCC() ); - else if ( p == "type" ) val = QtxValue( typeName( ind ) ); - else if ( p == "displaymode" ) val = QtxValue( displayMode( ind ) ); - else if ( p == "isActiveViewer" ) val = QtxValue( isActiveViewer() ); - } + if ( p == "isOCC" ) return QtxValue( isOCC() ); + else if ( p == "isActiveViewer" ) return QtxValue( isActiveViewer() ); - //printf( "--> param() : [%s] = %s\n", p.latin1(), val.toString ().latin1() ); + return SalomeApp_Selection::globalParam( p ); +} - return val; +QtxValue GEOMGUI_Selection::param( const int ind, const QString& p ) const +{ + if ( p == "isVisible" ) return QtxValue( isVisible( ind ) ); + else if ( p == "type" ) return QtxValue( typeName( ind ) ); + else if ( p == "displaymode" ) return QtxValue( displayMode( ind ) ); + + return SalomeApp_Selection::param( ind, p ); } QString GEOMGUI_Selection::typeName( const int index ) const @@ -181,3 +182,4 @@ bool GEOMGUI_Selection::isActiveViewer() const { return ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow() != 0 ); } + diff --git a/src/GEOMGUI/GEOMGUI_Selection.h b/src/GEOMGUI/GEOMGUI_Selection.h index 88470fb67..022bf8210 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.h +++ b/src/GEOMGUI/GEOMGUI_Selection.h @@ -41,6 +41,7 @@ public: virtual ~GEOMGUI_Selection(); virtual QtxValue param( const int, const QString& ) const; + virtual QtxValue globalParam( const QString& ) const; private: bool isVisible( const int ) const; diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index b704d9c3d..0acce6db7 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -966,13 +966,13 @@ void GeometryGUI::initialize( CAM_Application* app ) mgr->setRule( action( 8034 ), "client='OCCViewer' and selcount>0", true ); mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( action( 216 ), -1, -1 ); // display - mgr->setRule( action( 216 ), "$isActiveViewer in {true} and selcount>0 and (($type in {'Shape' 'Group'} and ($isVisible in {false})) or $type in {'Component'})", true ); + mgr->setRule( action( 216 ), "isActiveViewer=true and selcount>0 and (($type in {'Shape' 'Group'} and ($isVisible in {false})) or $type in {'Component'})", true ); mgr->insert( action( 215 ), -1, -1 ); // erase - mgr->setRule( action( 215 ), "$isActiveViewer in {true} and selcount>0 and (($type in {'Shape' 'Group'} and $isVisible in {true}) or ($type in {'Component'} and selcount=1))", true ); + mgr->setRule( action( 215 ), "isActiveViewer=true and selcount>0 and (($type in {'Shape' 'Group'} and $isVisible in {true}) or ($type in {'Component'} and selcount=1))", true ); mgr->insert( action( 214 ), -1, -1 ); // erase All - mgr->setRule( action( 214 ), "$isActiveViewer in {true} and $client in {'OCCViewer' 'VTKViewer'}", true ); + mgr->setRule( action( 214 ), "isActiveViewer=true and $client in {'OCCViewer' 'VTKViewer'}", true ); mgr->insert( action( 213 ), -1, -1 ); // display only - mgr->setRule( action( 213 ), "$isActiveViewer in {true} and selcount>0 and ($type in {'Shape' 'Group'} or ($type in {'Component'} and selcount=1))", true ); + mgr->setRule( action( 213 ), "isActiveViewer=true and selcount>0 and ($type in {'Shape' 'Group'} or ($type in {'Component'} and selcount=1))", true ); mgr->insert( separator(), -1, -1 ); }