Salome HOME
new function globalParam() of Selection is used in GEOM.
authorasv <asv@opencascade.com>
Fri, 24 Jun 2005 06:13:27 +0000 (06:13 +0000)
committerasv <asv@opencascade.com>
Fri, 24 Jun 2005 06:13:27 +0000 (06:13 +0000)
src/GEOMGUI/GEOMGUI_Selection.cxx
src/GEOMGUI/GEOMGUI_Selection.h
src/GEOMGUI/GeometryGUI.cxx

index a8f1673fd259ef9ebfa7fad30a891cf5d49d9f2a..c7ff2558fe8a53152c9533e9f510e0c769edb9b9 100644 (file)
@@ -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 );
 }
+
index 88470fb67e36f308d8e40229ca26b38a1b211b0e..022bf82104b081d8eece5b752e35401ba2b16a2e 100644 (file)
@@ -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;
index b704d9c3d1128b96b600c4340cfd7a7e9400d07e..0acce6db79608dbcb95cfc853e28e88ca6a5fa7b 100644 (file)
@@ -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 );
 }