X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHEXABLOCKGUI%2FHEXABLOCKGUI_SalomeTools.cxx;h=081312634119fb69e8a84f1d78fd7d7fd98f03cf;hb=b807e66955ae476b30f59bc29f1fe6c813837063;hp=5dedbd805a86b7eceaaa088c5b96e9dd76c19602;hpb=511a69cc24f76442075d46b0e2e464e043b8a5c9;p=modules%2Fhexablock.git diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx index 5dedbd8..0813126 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2015 CEA/DEN, EDF R&D +// Copyright (C) 2009-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -28,11 +28,8 @@ #include #include -#include - #include -#include #include #include @@ -89,13 +86,12 @@ namespace GUI } - _PTR(Study) GetActiveStudyDocument() + _PTR(Study) 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; } @@ -130,17 +126,17 @@ namespace GUI theName = ""; - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; theSelector->GetIndex(theIO,aMapIndex); typedef std::set TIdContainer; - std::set anIdContainer; + std::set anIdContainer; - for( int i = 1; i <= aMapIndex.Extent(); i++) + for( vtkIdType i = 1; i <= aMapIndex.Extent(); i++) anIdContainer.insert(aMapIndex(i)); - std::set::const_iterator anIter = anIdContainer.begin(); + std::set::const_iterator anIter = anIdContainer.begin(); for( ; anIter != anIdContainer.end(); anIter++) theName += QString(" %1").arg(*anIter); @@ -173,16 +169,13 @@ namespace GUI continue; Handle(SelectMgr_Selection) sel = theObj->Selection( m ); - - for ( sel->Init(); sel->More(); sel->Next() ) { -#if OCC_VERSION_LARGE > 0x06080100 - const SelectMgr_HSensitiveEntity aHSenEntity = sel->Sensitive(); + const NCollection_Vector& selected = sel->Entities(); + for ( NCollection_Vector::Iterator selIter( selected ); + selIter.More(); selIter.Next() ) { + const Handle(SelectMgr_SensitiveEntity) aHSenEntity = selIter.Value(); if ( aHSenEntity.IsNull() ) continue; Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive(); -#else - Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive(); -#endif if ( entity.IsNull() ) continue;