From 738a832666070cb74d6264c52e01b8552f306e8f Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 2 Apr 2014 09:51:44 +0400 Subject: [PATCH] Proper conditional compilation: a way OCCT dev version is detected has been modified according to the changed OCCT versioning policy --- src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx | 2 +- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 12 ++++++------ src/OCCViewer/OCCViewer_ViewPort3d.h | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 14 +++++++------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx index 36b7615b1..195d81485 100755 --- a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx +++ b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx @@ -157,7 +157,7 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem ) Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False ); aView3d->SetScale( myCurrentItem.scale ); -#if OCC_VERSION_LARGE <= 0x06070000 +#if OCC_VERSION_LARGE <= 0x06070100 aView3d->SetCenter( myCurrentItem.centerX, myCurrentItem.centerY ); #endif aView3d->SetProj( myCurrentItem.projX, myCurrentItem.projY, myCurrentItem.projZ ); diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 6a0e713c4..3f546a855 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -40,7 +40,7 @@ #include #include -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 #include #else #include @@ -75,7 +75,7 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit //selectVisualId(); -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 myActiveView = new V3d_View( viewer, type ); #else if ( type == V3d_ORTHOGRAPHIC ) { @@ -234,7 +234,7 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref ) refView->Up( x, y, z ); tgtView->SetUp( x, y, z ); refView->Eye( x, y, z ); tgtView->SetEye( x, y, z ); refView->Proj( x, y, z ); tgtView->SetProj( x, y, z ); -#if OCC_VERSION_LARGE <= 0x06070000 +#if OCC_VERSION_LARGE <= 0x06070100 refView->Center( x, y ); tgtView->SetCenter( x, y ); #endif tgtView->SetScale( refView->Scale() ); @@ -623,7 +623,7 @@ void OCCViewer_ViewPort3d::endRotation() { if ( !activeView().IsNull() ) { activeView()->ZFitAll( 1.0 ); -#if OCC_VERSION_LARGE <= 0x06070000 +#if OCC_VERSION_LARGE <= 0x06070100 activeView()->SetZSize( 0.0 ); #endif activeView()->Update(); @@ -679,7 +679,7 @@ void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd ) Standard_Real margin = 0.01; -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 activeView()->FitAll( margin, upd ); if(withZ) activeView()->ZFitAll(); @@ -794,7 +794,7 @@ bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view ) Handle(V3d_View) aView3d = getView(); Handle(V3d_View) aRefView3d = vp3d->getView(); aView3d->SetImmediateUpdate( Standard_False ); -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 aView3d->Camera()->Copy( aRefView3d->Camera() ); #else aView3d->SetViewMapping( aRefView3d->ViewMapping() ); diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.h b/src/OCCViewer/OCCViewer_ViewPort3d.h index f50a7bfc2..cd8b1c9e1 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.h +++ b/src/OCCViewer/OCCViewer_ViewPort3d.h @@ -120,7 +120,7 @@ private: private: Handle(V3d_View) myActiveView; -#if OCC_VERSION_LARGE <= 0x06070000 +#if OCC_VERSION_LARGE <= 0x06070100 Handle(V3d_View) myOrthoView; Handle(V3d_View) myPerspView; #endif diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 0e2505507..8b965a462 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -619,7 +619,7 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou // the ones which lie within the screen limits Standard_Real aScreenLimits[4] = { 0.0, 0.0, 0.0, 0.0 }; -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 // NDC space screen limits aScreenLimits[0] = -1.0; aScreenLimits[1] = 1.0; @@ -670,7 +670,7 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou for ( Standard_Integer aPointIt = 0; aPointIt < 8; ++aPointIt ) { const gp_Pnt& aBBPoint = aPoints[aPointIt]; -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 gp_Pnt aProjected = aView3d->Camera()->Project( aBBPoint ); const Standard_Real& U = aProjected.X(); const Standard_Real& V = aProjected.Y(); @@ -1693,7 +1693,7 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool base aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ ); aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ ); -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 if ( anItem.centerX != 0.0 || anItem.centerY != 0.0 ) { double anUpX = 0.0, anUpY = 0.0, anUpZ = 0.0; @@ -2102,7 +2102,7 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const params.isVisible= isShown; params.size = size; -#if OCC_VERSION_LARGE <= 0x06070000 // the property is deprecated in OCCT 6.7.1 +#if OCC_VERSION_LARGE <= 0x06070100 // the property is deprecated after OCCT 6.7.1 aView3d->Center( params.centerX, params.centerY ); #endif @@ -2168,7 +2168,7 @@ QString OCCViewer_ViewWindow::getVisualParameters() QStringList data; data << QString( "scale=%1" ) .arg( params.scale, 0, 'e', 12 ); -#if OCC_VERSION_LARGE <= 0x06070000 // the property is deprecated in OCCT 6.7.1 +#if OCC_VERSION_LARGE <= 0x06070100 // the property is deprecated after OCCT 6.7.1 data << QString( "centerX=%1" ) .arg( params.centerX, 0, 'e', 12 ); data << QString( "centerY=%1" ) .arg( params.centerY, 0, 'e', 12 ); #endif @@ -2784,7 +2784,7 @@ SUIT_CameraProperties OCCViewer_ViewWindow::cameraProperties() aProps.setAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] ); aProps.setViewUp( anUp[0], anUp[1], anUp[2] ); -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 aSourceView->Eye( anEye[0], anEye[1], anEye[2] ); // store camera properties "as is": it is up to synchronized @@ -2882,7 +2882,7 @@ void OCCViewer_ViewWindow::synchronize( SUIT_ViewWindow* theView ) aProps.getViewUp( anUpDir[0], anUpDir[1], anUpDir[2] ); aProps.getAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] ); -#if OCC_VERSION_LARGE > 0x06070000 +#if OCC_VERSION_LARGE > 0x06070100 aDestView->SetAt( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] ); aDestView->SetEye( aPosition[0], aPosition[1], aPosition[2] ); aDestView->SetUp( anUpDir[0], anUpDir[1], anUpDir[2] ); -- 2.39.2