From 1906d2c2b477fabcc1a78510fada590e2b158f68 Mon Sep 17 00:00:00 2001 From: "Maintenance team (INV)" Date: Wed, 2 Nov 2016 11:46:24 +0300 Subject: [PATCH] RNV: fix compilation with the dev version of OCCT. --- src/OCCViewer/OCCViewer_AISSelector.cxx | 20 +++++++++++++------- src/OCCViewer/OCCViewer_ViewModel.cxx | 4 +++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/OCCViewer/OCCViewer_AISSelector.cxx b/src/OCCViewer/OCCViewer_AISSelector.cxx index 25a354fc3..c15c45e4e 100755 --- a/src/OCCViewer/OCCViewer_AISSelector.cxx +++ b/src/OCCViewer/OCCViewer_AISSelector.cxx @@ -71,12 +71,14 @@ void OCCViewer_AISSelector::enableMultipleSelection( bool bEnable ) void OCCViewer_AISSelector::setHilightColor ( Quantity_NameOfColor color ) { myHilightColor = color; - if ( !myAISContext.IsNull() ) + if ( !myAISContext.IsNull() ) { #if OCC_VERSION_LARGE > 0x07000000 - myAISContext->ChangeHighlightStyle()->SetColor( myHilightColor ); + const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle(); + hStyle->SetColor( myHilightColor ); #else myAISContext->SetHilightColor( myHilightColor ); #endif + } } /*! @@ -85,12 +87,14 @@ void OCCViewer_AISSelector::setHilightColor ( Quantity_NameOfColor color ) void OCCViewer_AISSelector::setSelectColor ( Quantity_NameOfColor color ) { mySelectColor = color; - if ( !myAISContext.IsNull() ) + if ( !myAISContext.IsNull() ) { #if OCC_VERSION_LARGE > 0x07000000 - myAISContext->ChangeSelectionStyle()->SetColor( mySelectColor ); + const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle(); + sStyle->SetColor( mySelectColor ); #else myAISContext->SelectionColor( mySelectColor ); -#endif +#endif + } } /*! @@ -101,8 +105,10 @@ void OCCViewer_AISSelector::setAISContext ( const Handle (AIS_InteractiveContext myAISContext = aisContext; if ( ! myAISContext.IsNull() ) { #if OCC_VERSION_LARGE > 0x07000000 - myAISContext->ChangeHighlightStyle()->SetColor( myHilightColor ); - myAISContext->ChangeSelectionStyle()->SetColor( mySelectColor ); + const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle(); + const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle(); + hStyle->SetColor( myHilightColor ); + sStyle->SetColor( mySelectColor ); #else myAISContext->SetHilightColor( myHilightColor ); myAISContext->SelectionColor( mySelectColor ); diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 53f62f987..a8e64751d 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -130,7 +130,9 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron) // init selector myAISContext = new AIS_InteractiveContext( myV3dViewer ); #if OCC_VERSION_LARGE > 0x07000000 - myAISContext->ChangeSelectionStyle()->SetColor( Quantity_NOC_WHITE ); + + const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle(); + sStyle->SetColor( Quantity_NOC_WHITE ); #else myAISContext->SelectionColor( Quantity_NOC_WHITE ); #endif -- 2.39.2