X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Selection.cxx;h=b6a899e342cb19693267f51ecdbda88bbae2fb1f;hp=fe962f55ed740ede345e7889e46c77f0706dcb21;hb=94bdfc735c8615ab24bb304128c1b3c49bc597f4;hpb=e84f6641987cde6a8123af734a1fb44bbda37879 diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index fe962f55e..b6a899e34 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -84,12 +84,16 @@ QtxValue SMESHGUI_Selection::param( const int ind, const QString& p ) const else if ( p=="displayMode" ) val = QtxValue( displayMode( ind ) ); else if ( p=="isComputable" ) val = QtxValue( isComputable( ind ) ); else if ( p=="hasReference" ) val = QtxValue( hasReference( ind ) ); - else if ( p=="isVisible" ) val = QtxValue( isVisible( 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; - return val; + + if( val.isValid() ) + return val; + else + return SalomeApp_Selection::param( ind, p ); } //======================================================================= @@ -316,16 +320,22 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const } +//======================================================================= +//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; @@ -340,6 +350,9 @@ int SMESHGUI_Selection::type( SalomeApp_DataOwner* owner, if( objComponent->ComponentDataType()!="SMESH" ) return -1; + if( objComponent->GetIOR()==obj->GetIOR() ) + return COMPONENT; + int aLevel = obj->Depth() - objComponent->Depth(), aFTag = objFather->Tag(), anOTag = obj->Tag(), @@ -421,6 +434,8 @@ QString SMESHGUI_Selection::typeName( const int t ) return "Mesh compound"; case GROUP: return "Group"; + case COMPONENT: + return "Component"; default: return "Unknown"; }