-// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2016 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
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <vtkActorCollection.h>
#include <vtkUnstructuredGrid.h>
-
-
#include <SUIT_Session.h>
-#include <SalomeApp_Study.h>
#include <SalomeApp_Application.h>
#include <OCCViewer_ViewWindow.h>
}
- _PTR(Study) GetActiveStudyDocument()
+ _PTR(Study) getStudy()
{
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(GetActiveStudy());
- if (aStudy)
- return aStudy->studyDS();
- else
- return _PTR(Study)();
- }
-
-
- CORBA::Object_var corbaObj( _PTR(SObject) theSO )
- {
- CORBA::Object_var aCorbaObj = CORBA::Object::_nil();
- if ( theSO ) {
- std::string aValue = theSO->GetIOR();
- if (strcmp(aValue.c_str(), "") != 0) {
- CORBA::ORB_ptr anORB = SalomeApp_Application::orb();
- aCorbaObj = anORB->string_to_object(aValue.c_str());
- }
- }
- return aCorbaObj._retn();
+ static _PTR(Study) _study;
+ if(!_study)
+ _study = SalomeApp_Application::getStudy();
+ return _study;
}
- CORBA::Object_var corbaObj( const Handle(SALOME_InteractiveObject)& theIO )
- {
- CORBA::Object_var aCorbaObj = CORBA::Object::_nil();
-
- if ( !theIO.IsNull() && theIO->hasEntry() ){
- _PTR(Study) aStudy = GetActiveStudyDocument();
- _PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry());
- aCorbaObj = corbaObj(aSObj);
- }
- return aCorbaObj._retn();
- }
-
-
-
-
SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry)
{
SALOME_Actor *foundActor = NULL;
Handle(SelectMgr_Selection) sel = theObj->Selection( m );
for ( sel->Init(); sel->More(); sel->Next() ) {
- Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
+ const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
+ if ( aHSenEntity.IsNull() )
+ continue;
+ Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
if ( entity.IsNull() )
continue;