Salome HOME
There were added new version of method type returning type by string entry
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Selection.cxx
index eb48d8144df29a323679f849edac57a7a6633341..912d1a0d44426be93faacf7693cc7aa6b6c4ff2c 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;
 }
 
@@ -102,7 +102,7 @@ SMESH_Actor* SMESHGUI_Selection::getActor( int ind ) const
   if ( ind >= 0 && ind < myDataOwners.count() ) {
     const SalomeApp_SVTKDataOwner* owner = 
       dynamic_cast<const SalomeApp_SVTKDataOwner*> ( myDataOwners[ ind ].get() );
-    if ( owner )
+    if ( owner )    
       return dynamic_cast<SMESH_Actor*>( owner->GetActor() );
   }
   return 0;
@@ -313,17 +313,21 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const
   return QVariant( false, 0 );
 }
 
+//=======================================================================
+//function : type
+//purpose  :
+//=======================================================================
+int SMESHGUI_Selection::type( SalomeApp_DataOwner* owner, _PTR(Study) study )
+{
+  return type( owner->entry(), study );
+}
 
 //=======================================================================
 //function : type
 //purpose  : 
 //=======================================================================
-
-int SMESHGUI_Selection::type( SalomeApp_DataOwner* owner,
-                              _PTR(Study) study )
+int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
 {
-  QString entry = owner->entry();
-
   _PTR(SObject) obj (study->FindObjectID(entry.latin1()));
   if( !obj )
     return -1;