Salome HOME
Update Help for VISU module.
[modules/visu.git] / src / VISUGUI / VisuGUI_PopupTools.cxx
index 73826c9682b25aa172326d9f8add8c8d906190b9..39f904b0ee0038628ff637af89b78db8fd157100 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "VisuGUI_PopupTools.h"
 #include "VisuGUI_Tools.h"
+#include "SalomeApp_Study.h"
+#include "LightApp_Study.h"
 
 #include "VISU_Actor.h"
 #include "VISU_ScalarMapAct.h"
@@ -39,7 +41,7 @@ using namespace VISU;
 
 QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const
 {
-  QtxValue val( SalomeApp_Selection::param( ind, p ) );
+  QtxValue val( LightApp_Selection::param( ind, p ) );
   if ( !val.isValid() ) {
     if      ( p == "type"           ) val = QtxValue( type( ind ) );
     else if ( p == "nbComponents"   ) val = QtxValue( nbComponents( ind ) );
@@ -47,7 +49,7 @@ QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const
     else if ( p == "nbTimeStamps"   ) val = QtxValue( nbTimeStamps( ind ) );
     else if ( p == "nbChildren"     ) val = QtxValue( nbChildren( ind ) );
     else if ( p == "nbNamedChildren") val = QtxValue( nbNamedChildren( ind ) );
-//    else if ( p == "isVisible"      ) val = QtxValue( isVisible( ind ) );
+    else if ( p == "isVisible"      ) val = QtxValue( isVisible( ind ) );
     else if ( p == "isShrunk"       ) val = QtxValue( isShrunk( ind ) );
     else if ( p == "hasActor"       ) val = QtxValue( hasActor( ind ) );
     else if ( p == "isShading"      ) val = QtxValue( isShading( ind ) );
@@ -67,7 +69,10 @@ QString VisuGUI_Selection::type( const int ind ) const
 {
   QString aResStr;
   VISU::Storable::TRestoringMap aMap;
-  CORBA::Object_var anObject = GetSelectedObj( study(), entry( ind ), &aMap );  
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( ( LightApp_Study* )study() );
+  if ( !aStudy )
+    return aResStr;
+  CORBA::Object_var anObject = GetSelectedObj( aStudy, entry( ind ), &aMap );  
 
   VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject );
   if ( !CORBA::is_nil( aVisuObj ) ){
@@ -120,7 +125,10 @@ QString VisuGUI_Selection::nbComponents( const int ind ) const
 {
   QString aResStr;
   VISU::Storable::TRestoringMap aMap;
-  GetSelectedObj( study(), entry( ind ), &aMap );  
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( ( LightApp_Study* )study() );
+  if ( !aStudy )
+    return aResStr;
+  GetSelectedObj( aStudy, entry( ind ), &aMap );  
   bool isExist;
   const QString& aVal = VISU::Storable::FindValue(aMap,"myNumComponent",&isExist);
   if ( isExist )
@@ -132,7 +140,10 @@ QString VisuGUI_Selection::nbTimeStamps( const int ind ) const
 {
   QString aResStr;
   VISU::Storable::TRestoringMap aMap;
-  GetSelectedObj( study(), entry( ind ), &aMap );  
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( ( LightApp_Study* )study() );
+  if ( !aStudy )
+    return aResStr;
+  GetSelectedObj( aStudy, entry( ind ), &aMap );  
   bool isExist;
   const QString& aVal = VISU::Storable::FindValue(aMap,"myNbTimeStamps",&isExist);
   if ( isExist )
@@ -163,7 +174,10 @@ QString VisuGUI_Selection::representation( const int ind ) const
 int VisuGUI_Selection::nbChild( const int ind, const bool named ) const
 {
   int cnt = 0;
-  _PTR(Study) aStudy =  GetCStudy( study() );
+  SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>( ( LightApp_Study* )study() );
+  if ( !aSStudy )
+    return cnt;
+  _PTR(Study) aStudy =  GetCStudy( aSStudy );
   if ( aStudy ){
     _PTR(SObject) SO = aStudy->FindObjectID( entry( ind ).latin1() );
     if ( SO ){