From: ouv Date: Tue, 2 Aug 2016 15:01:49 +0000 (+0300) Subject: 0003992: External 20741 GL view position object X-Git-Tag: CTH_2_2_b~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bfcba39899dbb365eb2e7596b2d8bfc0f1f23a75;p=modules%2Fgui.git 0003992: External 20741 GL view position object --- diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 0a5961795..2876221c0 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -452,8 +452,8 @@ void GLViewer_ViewFrame::setVisualParameters( const QString& parameters ) xPan = paramsLst[2].toDouble(); yPan = paramsLst[3].toDouble(); - vp2d->getGLWidget()->setScale( xSc, ySc, 1. ); - vp2d->getGLWidget()->setPan( xPan, yPan, 0. ); + vp2d->setScale( xSc, ySc ); + vp2d->setPan( xPan, yPan ); int r = paramsLst[4].toInt(); int g = paramsLst[5].toInt(); diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index 5ba76282d..05df5a9dc 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -659,6 +659,28 @@ QColor GLViewer_ViewPort2d::backgroundColor() const return GLViewer_ViewPort::backgroundColor(); } +/*! + Sets foreground frame line width + \theLineWidth theColor - foreground frame line width +*/ +void GLViewer_ViewPort2d::setScale( GLfloat xSc, GLfloat ySc ) +{ + myXScale = xSc; + myYScale = ySc; + myGLWidget->setScale( xSc, ySc, 1.0 ); +} + +/*! + Sets foreground frame line width + \theLineWidth theColor - foreground frame line width +*/ +void GLViewer_ViewPort2d::setPan( GLfloat xPan, GLfloat yPan ) +{ + myXPan = xPan; + myYPan = yPan; + myGLWidget->setPan( xPan, yPan, 0.0 ); +} + /*! Resize view */ diff --git a/src/GLViewer/GLViewer_ViewPort2d.h b/src/GLViewer/GLViewer_ViewPort2d.h index ded12b05b..a8134c3eb 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.h +++ b/src/GLViewer/GLViewer_ViewPort2d.h @@ -134,10 +134,13 @@ public: //! Returns height of view int getHeight() const { return myHeight; } - + //! Sets scale factors + void setScale( GLfloat xSc, GLfloat ySc ); //! Returns scale factors void getScale( GLfloat& xSc, GLfloat& ySc ) const { xSc = myXScale; ySc = myYScale; } - //! returns offsets + //! Sets offsets + void setPan( GLfloat xPan, GLfloat yPan ); + //! Returns offsets void getPan( GLfloat& xPan, GLfloat& yPan ) const { xPan = myXPan; yPan = myYPan; } //! Resize view