]> SALOME platform Git repositories - modules/hexablock.git/commitdiff
Salome HOME
Porting to OCCT 7.4 dev V9_3_0a1
authormnt <mnt@opencascade.com>
Tue, 19 Feb 2019 11:52:55 +0000 (14:52 +0300)
committervsr <vsr@opencascade.com>
Fri, 22 Feb 2019 13:13:46 +0000 (16:13 +0300)
src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx

index eba7e92b0835bc6b610b3f91bee514d24aa2732a..420ed6c228af0f3685f55950b4779e91ce924f21 100644 (file)
@@ -46,6 +46,7 @@
 #include <TColStd_IndexedMapOfInteger.hxx>
 #include <NCollection_DataMap.hxx>
 
+#include <Basics_OCCTVersion.hxx>
 
 using namespace HEXABLOCK::GUI;
 
@@ -77,24 +78,23 @@ void HEXABLOCKGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) cons
     return;
 
   Handle(AIS_InteractiveContext) ic = vw->getAISContext();
-
+#if OCC_VERSION_LARGE <= 0x07030000
   if (ic->HasOpenedContext())
   {
+#endif
     TopoDS_Shape curBigShape;
     TopTools_IndexedMapOfShape subShapes;
 
     for (ic->InitSelected(); ic->MoreSelected(); ic->NextSelected())
     {
-      Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(ic->SelectedOwner());
-      if (anOwner.IsNull())
-        continue;
-
-      Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable());
+      Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast(ic->SelectedInteractive());
 
       QString entryStr = entry(io);
       int index = -1;
 
-      if (anOwner->ComesFromDecomposition()) // == Local Selection
+      Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(ic->SelectedOwner());
+
+      if (!anOwner.IsNull() && anOwner->ComesFromDecomposition()) // == Local Selection
       {
         TopoDS_Shape subShape = anOwner->Shape();
         Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(io);
@@ -124,6 +124,7 @@ void HEXABLOCKGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) cons
         aList.append(SUIT_DataOwnerPtr(owner));
       }
     }
+#if OCC_VERSION_LARGE <= 0x07030000
   }
   else
   {
@@ -143,6 +144,7 @@ void HEXABLOCKGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) cons
       }
     }
   }
+#endif
 
   // add externally selected objects
   SUIT_DataOwnerPtrList::const_iterator anExtIter, itEnd;
@@ -295,7 +297,7 @@ void HEXABLOCKGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList
     if ( owner->State() )
       continue;
 
-    if ( ic->HasOpenedContext() )
+    if ( owner->ComesFromDecomposition() )
       ic->AddOrRemoveSelected( owner, false );
     else
       ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
index 32668d564b694138ccdd75eaaecb694b28561e92..bfe3b1d006f686dcde6064c25faa5e7699c3e8d2 100644 (file)
@@ -22,6 +22,8 @@
 #include "HEXABLOCKGUI.hxx"
 #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <SOCC_ViewModel.h>
 #include <SUIT_ViewManager.h>
 
@@ -202,7 +204,11 @@ void OccGraphicView::highlightSubShapes(const Handle(AIS_Shape)& anObj,
 
     //get the context
     Handle (AIS_InteractiveContext) anIC = getContext();
-    if ( anIC.IsNull() || !anIC->HasOpenedContext() )
+    if ( anIC.IsNull() 
+#if OCC_VERSION_LARGE <= 0x07030000
+        || !anIC->HasOpenedContext() 
+#endif
+        )
         return;
 
     // ** highlight