From 08f4a1d3d5415c58e5d66d9d20ba66bd04849724 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 31 Jul 2020 18:36:42 +0300 Subject: [PATCH] Porting to OCCT 7.4.1dev --- src/CurveCreator/CurveCreator_Utils.cxx | 22 +----- src/CurveCreator/CurveCreator_Widget.cxx | 6 +- src/GEOMAlgo/GEOMAlgo_Gluer.cxx | 4 - src/GEOMGUI/GEOMGUI_DimensionProperty.cxx | 10 +-- src/GEOMGUI/GEOMGUI_DimensionProperty.h | 6 +- src/GEOMGUI/GEOMGUI_OCCSelector.cxx | 29 +------ src/GEOMGUI/GEOM_Displayer.cxx | 13 +-- src/GEOMGUI/GeometryGUI.cxx | 7 -- src/GEOMImpl/GEOMImpl_ChamferDriver.cxx | 4 - src/MeasureGUI/MeasureGUI_AngleDlg.cxx | 6 +- src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx | 7 +- .../MeasureGUI_CreateDimensionDlg.cxx | 13 +-- .../MeasureGUI_DimensionInteractor.cxx | 6 +- .../MeasureGUI_ManageDimensionsDlg.cxx | 79 ++++--------------- src/OBJECT/GEOM_AISShape.cxx | 12 +-- src/OBJECT/GEOM_Annotation.cxx | 10 +-- src/OBJECT/GEOM_Annotation.hxx | 6 +- 17 files changed, 46 insertions(+), 194 deletions(-) diff --git a/src/CurveCreator/CurveCreator_Utils.cxx b/src/CurveCreator/CurveCreator_Utils.cxx index 433f02ee5..f115904b3 100644 --- a/src/CurveCreator/CurveCreator_Utils.cxx +++ b/src/CurveCreator/CurveCreator_Utils.cxx @@ -41,10 +41,6 @@ #include #include -#if OCC_VERSION_LARGE <= 0x07030000 -#include -#endif - #include #include #include @@ -653,9 +649,6 @@ void CurveCreator_Utils::setSelectedPoints( Handle(AIS_InteractiveContext) theCo //ASL: we switch on again automatic highlight (otherwise selection will not be shown) // and call HilightPicked to draw selected owners theContext->SetAutomaticHilight( Standard_True ); -#if OCC_VERSION_LARGE <= 0x07030000 - theContext->LocalContext()->HilightPicked( Standard_True ); -#endif } //======================================================================= @@ -670,15 +663,7 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur return; if ( theOpen ) { -#if OCC_VERSION_LARGE <= 0x07030000 - // Open local context if there is no one - if ( !theContext->HasOpenedContext() ) { -#endif - theContext->ClearCurrents( false ); -#if OCC_VERSION_LARGE <= 0x07030000 - theContext->OpenLocalContext( false/*use displayed objects*/, true/*allow shape decomposition*/ ); - } -#endif + theContext->ClearCurrents( false ); // load the curve AIS object to the local context with the point selection Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject(); if ( !anAIS.IsNull() ) @@ -691,13 +676,8 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur } } else { -#if OCC_VERSION_LARGE <= 0x07030000 - if ( theContext->HasOpenedContext() ) - theContext->CloseAllContexts( Standard_True ); -#else theContext->Deactivate(); theContext->Activate(0); -#endif } } diff --git a/src/CurveCreator/CurveCreator_Widget.cxx b/src/CurveCreator/CurveCreator_Widget.cxx index 0415f860f..e5af5cdbe 100644 --- a/src/CurveCreator/CurveCreator_Widget.cxx +++ b/src/CurveCreator/CurveCreator_Widget.cxx @@ -1522,11 +1522,7 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT if ( myDragStarted ) return; Handle(AIS_InteractiveContext) aContext = getAISContext(); - if ( aContext.IsNull() -#if OCC_VERSION_LARGE <= 0x07030000 - || !aContext->HasOpenedContext() -#endif - ) + if ( aContext.IsNull() ) return; CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints ); diff --git a/src/GEOMAlgo/GEOMAlgo_Gluer.cxx b/src/GEOMAlgo/GEOMAlgo_Gluer.cxx index b14578597..38ec977f2 100644 --- a/src/GEOMAlgo/GEOMAlgo_Gluer.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Gluer.cxx @@ -510,12 +510,8 @@ void GEOMAlgo_Gluer::MakeSolids() myResult=aCmp; // if (aMS.Extent()) { -#if OCC_VERSION_LARGE > 0x07020001 TopTools_IndexedMapOfShape aMapToAvoid; BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, aMapToAvoid, 0.0001); -#else - BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, 0.0001); -#endif } } //======================================================================= diff --git a/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx b/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx index 25249f185..c57d1335c 100644 --- a/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx +++ b/src/GEOMGUI/GEOMGUI_DimensionProperty.cxx @@ -74,7 +74,7 @@ namespace // function : Length::Init // purpose : //================================================================================= -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff void GEOMGUI_DimensionProperty::Length::Init( const Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ) #else void GEOMGUI_DimensionProperty::Length::Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ) @@ -96,7 +96,7 @@ void GEOMGUI_DimensionProperty::Length::Init( const Handle(AIS_LengthDimension)& // function : Length::Update // purpose : //================================================================================= -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff void GEOMGUI_DimensionProperty::Length::Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ) #else void GEOMGUI_DimensionProperty::Length::Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ) @@ -850,7 +850,7 @@ void GEOMGUI_DimensionProperty::AddRecord( const Handle(AIS_Dimension)& theIO, c { case DimensionType_Length : { -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff Handle(PrsDim_LengthDimension) aLength = Handle(PrsDim_LengthDimension)::DownCast( theIO ); #else @@ -937,7 +937,7 @@ void GEOMGUI_DimensionProperty::SetRecord( const int theIndex, { case DimensionType_Length : { -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff Handle(PrsDim_LengthDimension) aLength = Handle(PrsDim_LengthDimension)::DownCast( theIO ); #else @@ -1138,7 +1138,7 @@ void GEOMGUI_DimensionProperty::SaveToAttribute( const std::string &theEntry ) //================================================================================= int GEOMGUI_DimensionProperty::TypeFromIO( const Handle(AIS_Dimension)& theIO ) const { -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff if ( theIO->IsKind( STANDARD_TYPE( PrsDim_LengthDimension ) ) ) #else if ( theIO->IsKind( STANDARD_TYPE( AIS_LengthDimension ) ) ) diff --git a/src/GEOMGUI/GEOMGUI_DimensionProperty.h b/src/GEOMGUI/GEOMGUI_DimensionProperty.h index 9ae98ce48..c57d988a4 100644 --- a/src/GEOMGUI/GEOMGUI_DimensionProperty.h +++ b/src/GEOMGUI/GEOMGUI_DimensionProperty.h @@ -32,7 +32,7 @@ // OCCT includes #include #include -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff #include #else #include @@ -144,7 +144,7 @@ public: * \param theIO [in] the interactive presentation. * \param theLCS [in] the local coordinate system of parent object. */ -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff void Init( const Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ); #else void Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ); @@ -155,7 +155,7 @@ public: * \param theIO [in/out] the interactive presentation. * \param theLCS [in] the local coordinate system of parent object. */ -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff void Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ); #else void Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ); diff --git a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx index e650a7b16..eea733efa 100644 --- a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx +++ b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx @@ -80,12 +80,8 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const return; Handle(AIS_InteractiveContext) ic = vw->getAISContext(); -#if OCC_VERSION_LARGE <= 0x07030000 - if (ic->HasOpenedContext()) - { -#endif - TopoDS_Shape curBigShape; - TopTools_IndexedMapOfShape subShapes; + TopoDS_Shape curBigShape; + TopTools_IndexedMapOfShape subShapes; for (ic->InitSelected(); ic->MoreSelected(); ic->NextSelected()) { @@ -127,27 +123,6 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const aList.append(SUIT_DataOwnerPtr(owner)); } } -#if OCC_VERSION_LARGE <= 0x07030000 - } - else - { - for (ic->InitCurrent(); ic->MoreCurrent(); ic->NextCurrent()) - { - Handle(AIS_InteractiveObject) io = ic->Current(); - - QString entryStr = entry( io ); - - if ( !entryStr.isEmpty() ) - { - Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(io->GetOwner()); - if ( !anIO.IsNull() ) { - LightApp_DataOwner* owner = new LightApp_DataOwner( anIO ); - aList.append( SUIT_DataOwnerPtr( owner ) ); - } - } - } - } -#endif // add externally selected objects SUIT_DataOwnerPtrList::const_iterator anExtIter; diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 21f759188..abd978501 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -126,7 +126,7 @@ #include -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff #include #endif @@ -246,7 +246,7 @@ namespace const Handle(Graphic3d_TextureMap)& aTexture = aAISShape->Attributes()->ShadingAspect()->Aspect()->TextureMap(); if ( aTexture.IsNull() ) continue; -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff Handle(Image_SupportedFormats) aFormats = new Image_SupportedFormats(); const Handle(Image_PixMap)& aPixmap = aTexture->GetImage(aFormats); #else @@ -1356,7 +1356,7 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t if ( aUnitsAngle == "deg" ) { aPrs->SetSpecialSymbol(0xB0); -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff aPrs->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After : PrsDim_DisplaySpecialSymbol_No ); #else @@ -1366,7 +1366,7 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t } else { -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff aPrs->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); #else aPrs->SetDisplaySpecialSymbol(AIS_DSS_No); @@ -2070,13 +2070,8 @@ void GEOM_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* ) Handle(AIS_InteractiveContext) ic = vf->getAISContext(); if ( !ic.IsNull() ) { -#if OCC_VERSION_LARGE <= 0x07030000 - if ( ic->HasOpenedContext() ) - ic->CloseAllContexts(Standard_True); -#else ic->Deactivate(); ic->Activate( 0 ); -#endif } } } diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index c92b77b6d..e10dae3f8 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -2441,16 +2441,9 @@ void GeometryGUI::createPreferences() aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf"; // add enginier font into combobox /*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile ); -#if OCC_VERSION_LARGE <= 0x07030000 - Handle(Font_SystemFont) sf = new Font_SystemFont( - new TCollection_HAsciiString("Y14.5M-2009"), - Font_FA_Regular, - new TCollection_HAsciiString(aFontFile.toLatin1().data()) ); -# else Handle(Font_SystemFont) sf = new Font_SystemFont( TCollection_AsciiString("Y14.5M-2009") ); sf->SetFontPath( Font_FA_Regular, TCollection_AsciiString( aFontFile.toLatin1().data() ) ); -#endif // register font in OCC font manager fmgr->RegisterFont( sf, Standard_False ); diff --git a/src/GEOMImpl/GEOMImpl_ChamferDriver.cxx b/src/GEOMImpl/GEOMImpl_ChamferDriver.cxx index fc6aa3494..dff71bfbd 100644 --- a/src/GEOMImpl/GEOMImpl_ChamferDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ChamferDriver.cxx @@ -130,11 +130,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(Handle(TFunction_Logbook)& log) if (!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E) && M.FindFromIndex(i).Extent() == 2) -#if OCC_VERSION_LARGE <= 0x07030000 - fill.Add(aD, E, F); -#else fill.Add(aD, aD, E, F); -#endif } } else if (aType == CHAMFER_SHAPE_EDGE || aType == CHAMFER_SHAPE_EDGE_AD) { diff --git a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx index c893d0182..81b851e90 100644 --- a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx @@ -55,7 +55,7 @@ #include #include -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff #include #else #include @@ -331,7 +331,7 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs() Handle(Geom_Curve) extCurv; Standard_Integer extShape; Handle(Geom_Plane) aPlane; -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff if (PrsDim::ComputeGeometry (anEdge1, anEdge2, #else if (AIS::ComputeGeometry (anEdge1, anEdge2, @@ -362,7 +362,7 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs() anIO->SetDimensionAspect( aDimensionStyle ); anIO->SetDisplayUnits( aUnitsAngle.toUtf8().data() ); if (aUnitsAngle == "rad") -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff anIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); #else anIO->SetDisplaySpecialSymbol(AIS_DSS_No); diff --git a/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx b/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx index 950ea16ad..ea3b68fe3 100644 --- a/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx @@ -907,12 +907,7 @@ bool MeasureGUI_AnnotationDlg::getPickedPoint( gp_Pnt& thePnt, const TopoDS_Shap Handle(AIS_InteractiveContext) anAISContext = aViewer->getAISContext(); Handle(SelectMgr_ViewerSelector) aSelector; -#if OCC_VERSION_LARGE <= 0x07030000 - if ( anAISContext->HasOpenedContext() ) - aSelector = anAISContext->LocalSelector(); - else -#endif - aSelector = anAISContext->MainSelector(); + aSelector = anAISContext->MainSelector(); if ( aSelector->NbPicked() < 1 ) return false; diff --git a/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx b/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx index 6779e5a41..39fefbdc0 100644 --- a/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx @@ -438,11 +438,8 @@ void MeasureGUI_CreateDimensionDlg::StartLocalEditing() Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d(); aViewer3d->AddZLayer( myEditingLayer ); -#if OCC_VERSION_LARGE <= 0x07030000 - anAISContext->OpenLocalContext( Standard_False, Standard_False ); -#endif -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff anAISContext->Load( myDimension, PrsDim_DimensionSelectionMode_All ); anAISContext->SetZLayer( myDimension, myEditingLayer ); anAISContext->Activate( myDimension, PrsDim_DimensionSelectionMode_Line ); @@ -473,12 +470,8 @@ void MeasureGUI_CreateDimensionDlg::StopLocalEditing() Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d(); aViewer3d->RemoveZLayer( myEditingLayer ); -#if OCC_VERSION_LARGE <= 0x07030000 - anAISContext->CloseLocalContext( Standard_True ); -#else anAISContext->Deactivate(); anAISContext->Activate(0); -#endif myEditingViewer = NULL; } @@ -644,7 +637,7 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension() if ( aUnitsAngle == "deg" ) { aDimensionIO->SetSpecialSymbol(0xB0); -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff aDimensionIO->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After : PrsDim_DisplaySpecialSymbol_No ); #else @@ -654,7 +647,7 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension() } else { -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff aDimensionIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); #else aDimensionIO->SetDisplaySpecialSymbol(AIS_DSS_No); diff --git a/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx b/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx index bb5fecac5..1f197d5a3 100644 --- a/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx +++ b/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx @@ -159,7 +159,7 @@ MeasureGUI_DimensionInteractor::Operation return Operation_None; } -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff Handle(PrsDim_DimensionOwner) anOwner = Handle(PrsDim_DimensionOwner)::DownCast( theEntity ); #else Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast( theEntity ); @@ -173,7 +173,7 @@ MeasureGUI_DimensionInteractor::Operation switch ( anOwner->SelectionMode() ) { -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff case PrsDim_DimensionSelectionMode_Line : #else case AIS_DSM_Line : @@ -194,7 +194,7 @@ MeasureGUI_DimensionInteractor::Operation return Operation_MoveFlyoutFree; } -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff case PrsDim_DimensionSelectionMode_Text : return Operation_MoveText; #else case AIS_DSM_Text : return Operation_MoveText; diff --git a/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx b/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx index d4624cb93..21b05da59 100644 --- a/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx @@ -198,9 +198,6 @@ void MeasureGUI_ManageDimensionsDlg::StartSelection( const Selection theSelectio anAISContext->ClearCurrents( Standard_False ); anAISContext->ClearSelected( Standard_False ); -#if OCC_VERSION_LARGE <= 0x07030000 - anAISContext->OpenLocalContext( Standard_True, Standard_False ); -#endif Handle(MeasureGUI_DimensionFilter) aFilter = new MeasureGUI_DimensionFilter( myEditObject->GetStudyEntry() ); anAISContext->AddFilter( aFilter ); @@ -267,12 +264,8 @@ void MeasureGUI_ManageDimensionsDlg::StopSelection() * ------------------------------------------------ */ Handle(AIS_InteractiveContext) anAISContext = myOperatedViewer->getAISContext(); -#if OCC_VERSION_LARGE <= 0x07030000 - anAISContext->CloseLocalContext(); -#else anAISContext->Deactivate(); anAISContext->Activate(0); -#endif LightApp_SelectionMgr* aSelectionMgr = myGeomGUI->getApp()->selectionMgr(); @@ -365,19 +358,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectionIntoArgument( const Selection theS anAISContext->InitSelected(); Handle(AIS_InteractiveObject) anAIS; -#if OCC_VERSION_LARGE <= 0x07030000 - if ( anAISContext->HasOpenedContext() ) - { - Handle(SelectMgr_EntityOwner) anAISOwner = anAISContext->SelectedOwner(); - anAIS = Handle(AIS_InteractiveObject)::DownCast( anAISOwner->Selectable() ); - } - else - { -#endif - anAIS = anAISContext->Current(); -#if OCC_VERSION_LARGE <= 0x07030000 - } -#endif + anAIS = anAISContext->Current(); int aDimensionId = IdFromPrs( anAIS ); @@ -1252,19 +1233,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con { return; } -#if OCC_VERSION_LARGE <= 0x07030000 - Standard_Boolean isLocal = anAISContext->HasOpenedContext(); - if ( isLocal ) - { - anAISContext->ClearSelected( Standard_False ); - } - else - { -#endif - anAISContext->ClearCurrents( Standard_False ); -#if OCC_VERSION_LARGE <= 0x07030000 - } -#endif + anAISContext->ClearCurrents( Standard_False ); SOCC_Prs* aPrs = dynamic_cast( theViewer->CreatePrs( myEditObject->GetStudyEntry() ) ); AIS_ListOfInteractive aListOfIO; @@ -1276,46 +1245,26 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con const Handle(AIS_InteractiveObject)& anIO = anIt.Value(); if ( IdFromPrs( anIO ) != theId ) { -#if OCC_VERSION_LARGE <= 0x07030000 - if ( isLocal ) - { -#endif - -#if OCC_VERSION_LARGE > 0x07040000 - anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Line ); - anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Text ); +#if OCC_VERSION_LARGE >= 0x070400ff + anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Line ); + anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Text ); #else - anAISContext->Deactivate( anIO, AIS_DSM_Line ); - anAISContext->Deactivate( anIO, AIS_DSM_Text ); + anAISContext->Deactivate( anIO, AIS_DSM_Line ); + anAISContext->Deactivate( anIO, AIS_DSM_Text ); #endif - } continue; -#if OCC_VERSION_LARGE <= 0x07030000 } + anAISContext->AddOrRemoveSelected( anIO, Standard_False ); - if ( isLocal ) - { -#endif - anAISContext->AddOrRemoveSelected( anIO, Standard_False ); - -#if OCC_VERSION_LARGE > 0x07040000 - anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Line ); - anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Text ); +#if OCC_VERSION_LARGE >= 0x070400ff + anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Line ); + anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Text ); #else - anAISContext->Activate( anIO, AIS_DSM_Line ); - anAISContext->Activate( anIO, AIS_DSM_Text ); -#endif - -#if OCC_VERSION_LARGE <= 0x07030000 - } - else - { -#endif - anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False ); -#if OCC_VERSION_LARGE <= 0x07030000 - } + anAISContext->Activate( anIO, AIS_DSM_Line ); + anAISContext->Activate( anIO, AIS_DSM_Text ); #endif + anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False ); anAISContext->UpdateCurrentViewer(); } } diff --git a/src/OBJECT/GEOM_AISShape.cxx b/src/OBJECT/GEOM_AISShape.cxx index 88aa3ecf1..491e4825e 100644 --- a/src/OBJECT/GEOM_AISShape.cxx +++ b/src/OBJECT/GEOM_AISShape.cxx @@ -70,7 +70,7 @@ #include #include -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff #include #else #include @@ -372,11 +372,7 @@ void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndex { Handle(AIS_InteractiveObject) anObj = this; Handle(AIS_InteractiveContext) anIC = GetContext(); - if ( anIC.IsNull() -#if OCC_VERSION_LARGE <= 0x07030000 - || !anIC->HasOpenedContext() -#endif - ) + if ( anIC.IsNull() ) return; Standard_Boolean isAutoHilight = anIC->AutomaticHilight(); @@ -603,7 +599,7 @@ void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs, anAspectText3d->SetColor( myLabelColor ); aGroup->SetPrimitivesAspect( anAspectText3d ); -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff Handle(Graphic3d_Text) aText = new Graphic3d_Text (14.); aText->SetText (aString.toUtf8().constData()); aText->SetPosition (aCenter); @@ -678,7 +674,7 @@ void GEOM_AISShape::drawName( const Handle(Prs3d_Presentation)& thePrs ) aGroup->SetPrimitivesAspect( anAspectText3d ); const char* aName = getIO()->getName(); -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff Handle(Graphic3d_Text) aText = new Graphic3d_Text (16.); aText->SetText (aName); aText->SetPosition (aCenter); diff --git a/src/OBJECT/GEOM_Annotation.cxx b/src/OBJECT/GEOM_Annotation.cxx index 53db84454..368e7e8d1 100644 --- a/src/OBJECT/GEOM_Annotation.cxx +++ b/src/OBJECT/GEOM_Annotation.cxx @@ -538,7 +538,7 @@ Bnd_Box GEOM_Annotation::TextBoundingBox() const { Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect(); Font_FTFont aFont; -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400FF Font_FTFontParams aFontParams; aFontParams.PointSize = (unsigned int)anAsp->Height(); aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution; @@ -708,11 +708,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)& const unsigned int aDPI = theWorkspace->View()->RenderingParams().Resolution; if (myTextDPI != aDPI) { -#if OCC_VERSION_LARGE <= 0x07030000 - const OpenGl_AspectText* anAspect = theWorkspace->AspectText(); -#else const OpenGl_Aspects* anAspect = theWorkspace->Aspects(); -#endif // getting string size will also initialize font library #if OCC_VERSION_LARGE >= 0x07040000 @@ -790,11 +786,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)& { Handle(Graphic3d_PresentationAttributes) empty; theWorkspace->SetHighlightStyle(empty); -#if OCC_VERSION_LARGE <= 0x07030000 - theWorkspace->ApplyAspectLine(); -#else theWorkspace->ApplyAspects(); -#endif } GLint myOldDepthMode = 0; diff --git a/src/OBJECT/GEOM_Annotation.hxx b/src/OBJECT/GEOM_Annotation.hxx index 902fca98f..36c1d7e6b 100644 --- a/src/OBJECT/GEOM_Annotation.hxx +++ b/src/OBJECT/GEOM_Annotation.hxx @@ -274,7 +274,7 @@ private: virtual void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode ) Standard_OVERRIDE; -#if OCC_VERSION_LARGE > 0x07040000 +#if OCC_VERSION_LARGE >= 0x070400ff virtual void setLocalTransformation( const Handle(TopLoc_Datum3D)& /*theTransformation*/ ) Standard_OVERRIDE {} #else virtual void setLocalTransformation( const Handle(Geom_Transformation)& /*theTransformation*/ ) Standard_OVERRIDE {} @@ -415,11 +415,7 @@ public: const Standard_Boolean isMatches = Select3D_SensitiveBox::Matches( theMgr, thePickResult ); if ( !myIsDepthCulling ) { -#if OCC_VERSION_LARGE <= 0x07030000 - thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter() ); -#else thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter(), thePickResult.PickedPoint() ); -#endif } return isMatches; } -- 2.39.2