X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Selection.cxx;fp=src%2FSMESHGUI%2FSMESHGUI_Selection.cxx;h=7cbde8fb1d4c8ea1f9023d7b9cab727495fc7b02;hp=9791ebebd05431113d4a2061abd0dfc15390613c;hb=6ed10b325cd7d8ceb9dc868e0cd2bf999300abf1;hpb=a8d87f2c1bf1823ed2db28972109396e595bbfaa diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 9791ebebd..7cbde8fb1 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -110,6 +110,8 @@ 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=="isImported" ) val = QtxValue( isImported( ind ) ); + // else if ( p=="isVisible" ) val = QtxValue( isVisible( ind ) ); // printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() ); @@ -487,3 +489,20 @@ QString SMESHGUI_Selection::typeName( const int t ) return "Unknown"; } } + +bool SMESHGUI_Selection::isImported( const int ind ) const +{ + QString e = entry( ind ); + _PTR(SObject) SO = SMESH::GetActiveStudyDocument()->FindObjectID( e ); + bool res = false; + if( SO ) + { + SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( SO ) ); + if( !aMesh->_is_nil() ) + { + SALOME_MED::MedFileInfo* inf = aMesh->GetMEDFileInfo(); + res = strlen( (char*)inf->fileName ) > 0; + } + } + return res; +}