Salome HOME
IsDimSupported method added
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Selection.cxx
index b52edf3fb679ec29bc528b954f893d29d342f3f5..fe962f55ed740ede345e7889e46c77f0706dcb21 100644 (file)
@@ -86,9 +86,9 @@ QtxValue SMESHGUI_Selection::param( const int ind, const QString& p ) const
   else if ( p=="hasReference" )  val = QtxValue( hasReference( ind ) );
   else if ( p=="isVisible" )     val = QtxValue( isVisible( ind ) );
 
-   printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() );
-   if ( val.type() == QVariant::List )
-     cout << "size: " << val.toList().count() << endl;
+  // printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() );
+  //if ( val.type() == QVariant::List )
+  //cout << "size: " << val.toList().count() << endl;
   return val;
 }
 
@@ -286,10 +286,12 @@ QVariant SMESHGUI_Selection::hasReference( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
   {
-    Handle(SALOME_InteractiveObject) io =
-      static_cast<SalomeApp_DataOwner*>( myDataOwners[ ind ].get() )->IO();
-    if ( !io.IsNull() )
-      return QVariant( io->hasReference(), 0 );
+    SalomeApp_DataOwner* owner = dynamic_cast<SalomeApp_DataOwner*>( myDataOwners[ ind ].operator->() );
+    if( owner )
+    {
+      _PTR(SObject) obj ( study()->studyDS()->FindObjectID( owner->entry().latin1() ) ), ref;
+      return QVariant( obj->ReferencedObject( ref ), 0 );
+    }
   }
   return QVariant( false, 0 );
 }
@@ -328,9 +330,16 @@ int SMESHGUI_Selection::type( SalomeApp_DataOwner* owner,
   if( !obj )
     return -1;
 
+  _PTR(SObject) ref;
+  if( obj->ReferencedObject( ref ) )
+    obj = ref;
+
   _PTR(SObject) objFather = obj->GetFather();
   _PTR(SComponent) objComponent = obj->GetFatherComponent();
 
+  if( objComponent->ComponentDataType()!="SMESH" )
+    return -1;
+
   int aLevel = obj->Depth() - objComponent->Depth(),
       aFTag = objFather->Tag(),
       anOTag = obj->Tag(),