From bfcba39899dbb365eb2e7596b2d8bfc0f1f23a75 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 2 Aug 2016 18:01:49 +0300 Subject: [PATCH] 0003992: External 20741 GL view position object --- src/GLViewer/GLViewer_ViewFrame.cxx | 4 ++-- src/GLViewer/GLViewer_ViewPort2d.cxx | 22 ++++++++++++++++++++++ src/GLViewer/GLViewer_ViewPort2d.h | 7 +++++-- 3 files changed, 29 insertions(+), 4 deletions(-) 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 -- 2.39.2