X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ViewPort3d.cxx;h=73f89e2137839f024228ee8851d135612ebcb3ff;hb=331294345d3e1716fbf79ae25a2851011729be79;hp=784d86c0d1109440f3deeac9841221ed45a5dace;hpb=00be77fd72d1e9378e32b88a468ec16bebb9b806;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 784d86c0d..73f89e213 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -40,20 +40,8 @@ #include #include -#if OCC_VERSION_MAJOR < 7 - #include -#endif - -#if OCC_VERSION_LARGE > 0x06070100 #include -#else -#include -#include -#endif - -#if OCC_VERSION_LARGE > 0x07010000 #include -#endif #include "utilities.h" @@ -83,18 +71,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 > 0x06070100 myActiveView = new V3d_View( viewer, type ); -#else - if ( type == V3d_ORTHOGRAPHIC ) { - myOrthoView = new V3d_OrthographicView( viewer ); - myActiveView = myOrthoView; - myPerspView = 0; - } else { - myPerspView = new V3d_PerspectiveView( viewer ); - myActiveView = myPerspView; - } -#endif setDefaultParams(); @@ -240,44 +217,16 @@ 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 <= 0x06070100 - refView->Center( x, y ); tgtView->SetCenter( x, y ); -#endif tgtView->SetScale( refView->Scale() ); tgtView->SetTwist( refView->Twist() ); /* update */ tgtView->Update(); tgtView->SetImmediateUpdate( Standard_True ); -#if OCC_VERSION_LARGE <= 0x07000000 - tgtView->ZFitAll(); -#endif - return true; -} -#if OCC_VERSION_LARGE <= 0x07000000 -/*! - Returns Z-size of this view. [ public ] -*/ -double OCCViewer_ViewPort3d::getZSize() const -{ - if ( !activeView().IsNull() ) - return activeView()->ZSize(); - return 0; + return true; } -/*! - Sets Z-size of this view ( for both orthographic and perspective ). [ public ] -*/ -void OCCViewer_ViewPort3d::setZSize( double zsize ) -{ - myActiveView->SetZSize( zsize ); - /* if ( !myOrthoView.IsNull() ) - myOrthoView->SetZSize( zsize ); - if ( !myPerspView.IsNull() ) - myPerspView->SetZSize( zsize );*/ -} -#endif /*! Get axial scale to the view @@ -409,13 +358,13 @@ void OCCViewer_ViewPort3d::updateBackground() // set texture image: file name and fill mode switch ( textureMode ) { case Qtx::CenterTexture: - activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED ); + activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_CENTERED ); break; case Qtx::TileTexture: - activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED ); + activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_TILED ); break; case Qtx::StretchTexture: - activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH ); + activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_STRETCH ); break; default: break; @@ -582,10 +531,6 @@ void OCCViewer_ViewPort3d::rotate( int x, int y, void OCCViewer_ViewPort3d::endRotation() { if ( !activeView().IsNull() ) { -#if OCC_VERSION_LARGE <= 0x07000000 - activeView()->ZFitAll( 1.0 ); - activeView()->SetZSize( 0.0 ); -#endif activeView()->Update(); emit vpTransformed( this ); } @@ -606,12 +551,7 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e ) QApplication::syncX(); #endif if ( !myPaintersRedrawing ) { -#if OCC_VERSION_MAJOR < 7 - QRect rc = e->rect(); - activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() ); -#else activeView()->Redraw(); -#endif } } OCCViewer_ViewPort::paintEvent( e ); @@ -657,16 +597,8 @@ void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd ) Standard_Real margin = 0.01; -#if OCC_VERSION_LARGE > 0x06070100 activeView()->FitAll( margin, upd ); -#if OCC_VERSION_LARGE <= 0x07000000 - if(withZ) - activeView()->ZFitAll(); -#endif -#else - activeView()->FitAll( margin, withZ, upd ); - activeView()->SetZSize(0.); -#endif + emit vpTransformed( this ); } @@ -774,15 +706,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 > 0x06070100 aView3d->Camera()->Copy( aRefView3d->Camera() ); -#else - aView3d->SetViewMapping( aRefView3d->ViewMapping() ); - aView3d->SetViewOrientation( aRefView3d->ViewOrientation() ); -#endif -#if OCC_VERSION_LARGE <= 0x07000000 - aView3d->ZFitAll(); -#endif aView3d->SetImmediateUpdate( Standard_True ); aView3d->Update(); blockSignals( blocked );