//function : SMESHGUI_Selection
//purpose :
//=======================================================================
-SMESHGUI_Selection::SMESHGUI_Selection( const QString& client, LightApp_SelectionMgr* mgr )
-: LightApp_Selection( client, mgr )
+SMESHGUI_Selection::SMESHGUI_Selection()
+: LightApp_Selection()
{
+}
+
+//=======================================================================
+//function : ~SMESHGUI_Selection
+//purpose :
+//=======================================================================
+SMESHGUI_Selection::~SMESHGUI_Selection()
+{
+}
+
+//=======================================================================
+//function : init
+//purpose :
+//=======================================================================
+void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr )
+{
+ LightApp_Selection::init( client, mgr );
+
if( mgr && study() )
{
SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
}
}
-//=======================================================================
-//function : ~SMESHGUI_Selection
-//purpose :
-//=======================================================================
-SMESHGUI_Selection::~SMESHGUI_Selection()
-{
-}
-
//=======================================================================
//function : processOwner
//purpose :
else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
+ else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
+ else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) );
if( val.isValid() )
return val;
SMESH_Actor* SMESHGUI_Selection::getActor( int ind ) const
{
if( ind >= 0 && ind < count() )
- return myActors.at( ind );
+ return myActors.isEmpty() ? 0 : myActors.at( ind );
else
return 0;
}
return "eNone";
}
+//=======================================================================
+//function : facesOrientationMode
+//purpose :
+//=======================================================================
+
+QString SMESHGUI_Selection::facesOrientationMode( int ind ) const
+{
+ SMESH_Actor* actor = getActor( ind );
+ if ( actor ) {
+ if ( actor->GetFacesOriented() )
+ return "IsOriented";
+ return "IsNotOriented";
+ }
+ return "Unknown";
+}
+
//=======================================================================
//function : isAutoColor
//purpose :
return "Unknown";
}
}
+
+bool SMESHGUI_Selection::isImported( const int ind ) const
+{
+ QString e = entry( ind );
+ _PTR(SObject) SO = SMESH::GetActiveStudyDocument()->FindObjectID( e.toLatin1().constData() );
+ 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;
+}