From: mnt Date: Tue, 19 Feb 2019 11:52:55 +0000 (+0300) Subject: Porting to OCCT 7.4 dev X-Git-Tag: V9_3_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2701a4af10655ec68615ae4926d3432d908aa2ca;p=modules%2Fhexablock.git Porting to OCCT 7.4 dev --- diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx index eba7e92..420ed6c 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx @@ -46,6 +46,7 @@ #include #include +#include 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 ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx index 32668d5..bfe3b1d 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx @@ -22,6 +22,8 @@ #include "HEXABLOCKGUI.hxx" #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" +#include + #include #include @@ -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