X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARDGUI%2FHOMARDGUI_Utils.cxx;h=ec600c8ffe451de8985a8ed21e2b9d4c450630b1;hb=refs%2Ftags%2FV9_13_0b1;hp=3b8b4ac03a1bbd0f6cd9dd2cfec07a67294d8c0a;hpb=2c82da385bf3d7b6a045dfe7620d4b9bdc154fe6;p=modules%2Fhomard.git diff --git a/src/HOMARDGUI/HOMARDGUI_Utils.cxx b/src/HOMARDGUI/HOMARDGUI_Utils.cxx index 3b8b4ac0..ec600c8f 100644 --- a/src/HOMARDGUI/HOMARDGUI_Utils.cxx +++ b/src/HOMARDGUI/HOMARDGUI_Utils.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// Copyright (C) 2011-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -48,15 +48,6 @@ SALOME_ListIO HOMARD_UTILS::mySelected; -//================================================================ -// Function : GetCStudy -// Returne un pointeur sur l'etude courante -//================================================================ - _PTR(Study) HOMARD_UTILS::GetCStudy(const SalomeApp_Study* theStudy) -{ - return theStudy->studyDS(); -} - //================================================================ // Function : GetActiveStudy // Returne un pointeur sur l'etude active @@ -71,17 +62,15 @@ SUIT_Study* HOMARD_UTILS::GetActiveStudy() } //================================================================ -// Function : GetActiveStudyDocument +// Function : getStudy // Returne un pointeur sur l'etude active //================================================================ -_PTR(Study) HOMARD_UTILS::GetActiveStudyDocument() +_PTR(Study) HOMARD_UTILS::getStudy() { - SalomeApp_Study* aStudy = dynamic_cast(GetActiveStudy()); - if (aStudy){ - return aStudy->studyDS(); - } - else - return _PTR(Study)(); + static _PTR(Study) _study; + if(!_study) + _study = SalomeApp_Application::getStudy(); + return _study; } //================================================================ @@ -197,6 +186,13 @@ bool HOMARD_UTILS::isObject(_PTR(SObject) MonObj, QString TypeObject, int option return bOK ; } //================================================================ +// Retourne vrai si l'objet est une frontiere CAO +//================================================================ +bool HOMARD_UTILS::isBoundaryCAO(_PTR(SObject) MonObj) +{ + return isObject( MonObj, QString("BoundaryCAOHomard"), -1 ) ; +} +//================================================================ // Retourne vrai si l'objet est une frontiere analytique //================================================================ bool HOMARD_UTILS::isBoundaryAn(_PTR(SObject) MonObj)