From d482e70778936d57da42621abf6abbe43e052b21 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 9 Feb 2017 17:02:09 +0300 Subject: [PATCH] Porting to DEV version of OpenCASCADE: AIS_InteractiveContext : default value for Update Viewer parameter was dropped. --- src/OCCViewer/OCCViewer_AISSelector.cxx | 15 +++++++-------- .../OCCViewer_ClipPlaneInteractor.cxx | 8 ++++---- src/OCCViewer/OCCViewer_VService.cxx | 9 +++++++-- src/OCCViewer/OCCViewer_ViewModel.cxx | 18 +++++++++--------- src/OCCViewer/OCCViewer_ViewModel.h | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 8 ++++---- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/OCCViewer/OCCViewer_AISSelector.cxx b/src/OCCViewer/OCCViewer_AISSelector.cxx index c15c45e4e..03b001be7 100755 --- a/src/OCCViewer/OCCViewer_AISSelector.cxx +++ b/src/OCCViewer/OCCViewer_AISSelector.cxx @@ -157,8 +157,7 @@ bool OCCViewer_AISSelector::moveTo ( int x, int y, const Handle (V3d_View)& view return false; AIS_StatusOfDetection status = AIS_SOD_Error; - status = myAISContext->MoveTo (x, y, view); - + status = myAISContext->MoveTo ( x, y, view, Standard_True ); return ( status != AIS_SOD_Error && status != AIS_SOD_AllBad ); } @@ -177,7 +176,7 @@ bool OCCViewer_AISSelector::select () bool hadSelection = ( myNumSelected > 0 ); /* select and send notifications */ - return checkSelection ( myAISContext->Select(), hadSelection, false ); + return checkSelection ( myAISContext->Select( Standard_True ), hadSelection, false ); } /*! @@ -197,8 +196,8 @@ bool OCCViewer_AISSelector::select ( int left, int top, int right, int bottom, bool hadSelection = ( myNumSelected > 0 ); /* select and send notifications */ - return checkSelection ( myAISContext->Select(left, top, right, bottom, view), - hadSelection, false ); + return checkSelection ( myAISContext->Select( left, top, right, bottom, view, Standard_True ), + hadSelection, false ); } /*! @@ -219,7 +218,7 @@ bool OCCViewer_AISSelector::shiftSelect () return false; /* select and send notifications */ - return checkSelection ( myAISContext->ShiftSelect(), hadSelection, true ); + return checkSelection ( myAISContext->ShiftSelect( Standard_True ), hadSelection, true ); } /*! @@ -243,6 +242,6 @@ bool OCCViewer_AISSelector::shiftSelect ( int left, int top, int right, int bott return false; /* select and send notifications */ - return checkSelection ( myAISContext->ShiftSelect(left,top,right,bottom, view), - hadSelection, true ); + return checkSelection ( myAISContext->ShiftSelect( left, top, right, bottom, view, Standard_True ), + hadSelection, true ); } diff --git a/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx b/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx index 45e669396..a187df537 100644 --- a/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx +++ b/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx @@ -406,7 +406,7 @@ void OCCViewer_ClipPlaneInteractor::performDragging( const QPoint& theDragPos, thePlane->SetToUpdate(); thePlane->UpdateSelection(); - myViewer->getAISContext()->Update( thePlane ); + myViewer->getAISContext()->Update( thePlane , Standard_True ); } break; @@ -447,7 +447,7 @@ void OCCViewer_ClipPlaneInteractor::performDragging( const QPoint& theDragPos, thePlane->SetToUpdate(); thePlane->UpdateSelection(); - myViewer->getAISContext()->Update( thePlane ); + myViewer->getAISContext()->Update( thePlane , Standard_True ); } break; } @@ -495,7 +495,7 @@ bool OCCViewer_ClipPlaneInteractor::mousePress( QMouseEvent* theEvent, Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext(); // check detection of plane - anAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3D ); + anAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3D , Standard_True ); if ( !anAISContext->HasDetected() ) { @@ -522,7 +522,7 @@ bool OCCViewer_ClipPlaneInteractor::mousePress( QMouseEvent* theEvent, // process mouse click on the object if ( myIsClickable ) { - myViewer->getAISContext()->SetSelected( Handle(AIS_InteractiveObject)::DownCast(aPlane) ); + myViewer->getAISContext()->SetSelected( Handle(AIS_InteractiveObject)::DownCast(aPlane) , Standard_True ); emit planeClicked( aPlane ); } diff --git a/src/OCCViewer/OCCViewer_VService.cxx b/src/OCCViewer/OCCViewer_VService.cxx index e5fce614a..1102899a5 100644 --- a/src/OCCViewer/OCCViewer_VService.cxx +++ b/src/OCCViewer/OCCViewer_VService.cxx @@ -91,10 +91,15 @@ Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString na #endif } -#if OCC_VERSION_LARGE > 0x07000000 +#if OCC_VERSION_LARGE > 0x07010000 return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection, - Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT, + Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, computedMode, defaultComputedMode ); + +#elif OCC_VERSION_LARGE > 0x07000000 + return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection, + Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT, + computedMode, defaultComputedMode ); #else return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection, Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT, diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index a8e64751d..1318d5fe6 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -347,7 +347,7 @@ void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theE } Handle(V3d_View) aView3d = aView->getViewPort()->getView(); if ( !aView3d.IsNull() ) { - myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d); + myAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3d, Standard_True ); } } } @@ -379,14 +379,14 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t if ( !isPreselectionEnabled() ) { Handle(V3d_View) aView3d = aView->getViewPort()->getView(); if ( !aView3d.IsNull() ) { - myAISContext->MoveTo(myEndPnt.x(), myEndPnt.y(), aView3d); + myAISContext->MoveTo( myEndPnt.x(), myEndPnt.y(), aView3d, Standard_True ); } } if (aHasShift && myMultiSelectionEnabled) - myAISContext->ShiftSelect(); - else - myAISContext->Select(); + myAISContext->ShiftSelect( Standard_True ); + else + myAISContext->Select( Standard_True ); } else { @@ -438,14 +438,14 @@ void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEven if ( !isPreselectionEnabled() ) { Handle(V3d_View) aView3d = aView->getViewPort()->getView(); if ( !aView3d.IsNull() ) { - myAISContext->MoveTo(myCurPnt.x(), myCurPnt.y(), aView3d); + myAISContext->MoveTo(myCurPnt.x(), myCurPnt.y(), aView3d, Standard_True ); } } if (aHasShift && myMultiSelectionEnabled) - myAISContext->ShiftSelect(); + myAISContext->ShiftSelect( Standard_True ); else - myAISContext->Select(); + myAISContext->Select( Standard_True ); emit selectionChanged(); @@ -1287,7 +1287,7 @@ void OCCViewer_Viewer::setTrihedronShown( const bool on ) myAISContext->Deactivate( myTrihedron ); } else { - myAISContext->Erase( myTrihedron ); + myAISContext->Erase( myTrihedron , Standard_True ); } } diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index 41079ea3c..63db7700b 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -94,7 +94,7 @@ public: void getSelectedObjects(AIS_ListOfInteractive& theList); void setObjectsSelected(const AIS_ListOfInteractive& theList); - void setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO);} + void setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO,Standard_True);} void performSelectionChanged(); // emit signal selectionChanged diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 678a6de3c..a4bce4220 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -542,7 +542,7 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) if ( theEvent->button() == Qt::LeftButton ) { Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); - ic->Select(); + ic->Select( Standard_True ); for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() ) { TopoDS_Shape aShape = ic->SelectedShape(); @@ -581,7 +581,7 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) } if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType; if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange(); - ic->CloseAllContexts(); + ic->CloseAllContexts( Standard_True ); myOperation = NOTHING; myViewPort->setCursor( myCursor ); myCursorIsHand = false; @@ -776,7 +776,7 @@ void OCCViewer_ViewWindow::activateSetRotationGravity() if ( myRotationPointSelection ) { Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); - ic->CloseAllContexts(); + ic->CloseAllContexts( Standard_True ); myOperation = NOTHING; myViewPort->setCursor( myCursor ); myCursorIsHand = false; @@ -816,7 +816,7 @@ void OCCViewer_ViewWindow::activateSetRotationSelected( double theX, double theY if ( myRotationPointSelection ) { Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); - ic->CloseAllContexts(); + ic->CloseAllContexts( Standard_True ); myOperation = NOTHING; myViewPort->setCursor( myCursor ); myCursorIsHand = false; -- 2.39.2