Salome HOME
Update from V7_dev
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_SalomeTools.cxx
index e28580f3d31a73e2a560c3b4d5c1226b164fde31..a05e5dab184e1b1eaf833c1b0a0b6f6beeb32562 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2015  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
@@ -28,7 +28,7 @@
 #include <vtkActorCollection.h>
 #include <vtkUnstructuredGrid.h>
 
-
+#include <Basics_OCCTVersion.hxx>
 
 #include <SUIT_Session.h>
 
@@ -99,35 +99,6 @@ namespace GUI
        }
 
 
-       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();
-       }
-
-
-       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;
@@ -204,7 +175,14 @@ namespace GUI
                        Handle(SelectMgr_Selection) sel = theObj->Selection( m );
 
                        for ( sel->Init(); sel->More(); sel->Next() ) {
+#if OCC_VERSION_LARGE > 0x06080100
+                                const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
+                                if ( aHSenEntity.IsNull() )
+                                        continue;
+                                Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
+#else
                                Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
+#endif
                                if ( entity.IsNull() )
                                        continue;