From: kgv Date: Tue, 31 May 2016 10:24:49 +0000 (+0300) Subject: 0027549: Visualization, OpenGl_View - drop confusing misnamed methods Width() and... X-Git-Tag: V7_0_winwerth~27 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c574faecb9a7a6063f1b5c16e55ab2ead988e240;p=occt.git 0027549: Visualization, OpenGl_View - drop confusing misnamed methods Width() and Height() --- diff --git a/src/OpenGl/OpenGl_Trihedron.cxx b/src/OpenGl/OpenGl_Trihedron.cxx index 11c0178adb..e3016d484b 100644 --- a/src/OpenGl/OpenGl_Trihedron.cxx +++ b/src/OpenGl/OpenGl_Trihedron.cxx @@ -39,17 +39,17 @@ namespace // ======================================================================= void OpenGl_Trihedron::resetTransformations (const Handle(OpenGl_Workspace)& theWorkspace) const { - const Handle(OpenGl_Context)& aContext = theWorkspace->GetGlContext(); - const OpenGl_View* aView = theWorkspace->View(); - GLdouble anU = 1.0; - GLdouble aV = 1.0; - if (aView->Height() < aView->Width()) + const Handle(OpenGl_Context)& aContext = theWorkspace->GetGlContext(); + const Handle(Graphic3d_Camera)& aCamera = theWorkspace->View()->Camera(); + double anU = 1.0; + double aV = 1.0; + if (aCamera->ViewDimensions().X() < aCamera->ViewDimensions().Y()) { - aV = aView->Width() / aView->Height(); + aV = aCamera->ViewDimensions().Y() / aCamera->ViewDimensions().X(); } else { - anU = aView->Height() / aView->Width(); + anU = aCamera->ViewDimensions().X() / aCamera->ViewDimensions().Y(); } // Reading the transformation matrices and projection of sight diff --git a/src/OpenGl/OpenGl_View.hxx b/src/OpenGl/OpenGl_View.hxx index efa355add3..97484a46fe 100644 --- a/src/OpenGl/OpenGl_View.hxx +++ b/src/OpenGl/OpenGl_View.hxx @@ -425,12 +425,6 @@ public: void SetTextureEnv (const Handle(OpenGl_Context)& theCtx, const Handle(Graphic3d_TextureEnv)& theTexture); - //! Returns height of view volume. - Standard_Real Height () const { return myCamera->ViewDimensions().X(); } - - //! Returns width of view volume. - Standard_Real Width () const { return myCamera->ViewDimensions().Y(); } - void SetBackgroundTextureStyle (const Aspect_FillMethod FillStyle); void SetBackgroundGradient (const Quantity_Color& AColor1, const Quantity_Color& AColor2, const Aspect_GradientFillMethod AType);