Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:50

0001 // Copyright (c) 2021 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Graphic3d_TransformPersScaledAbove_HeaderFile
0015 #define _Graphic3d_TransformPersScaledAbove_HeaderFile
0016 
0017 #include <Graphic3d_TransformPers.hxx>
0018 
0019 //! Transformation Zoom persistence with the above boundary of scale.
0020 //! This persistence works only when the camera scale value is below the scale value of this
0021 //! persistence. Otherwise, no persistence is applied.
0022 class Graphic3d_TransformPersScaledAbove : public Graphic3d_TransformPers
0023 {
0024 public:
0025   //! Create a Zoom transformation persistence with an anchor 3D point and a scale value
0026   Standard_EXPORT Graphic3d_TransformPersScaledAbove(const double theScale, const gp_Pnt& thePnt);
0027 
0028   //! Destructor
0029   ~Graphic3d_TransformPersScaledAbove() override = default;
0030 
0031   //! Find scale value based on the camera position and view dimensions
0032   //! If the camera scale value less than the persistence scale, zoom persistence is not applied.
0033   //! @param[in] theCamera  camera definition
0034   //! @param[in] theViewportWidth  the width of viewport.
0035   //! @param[in] theViewportHeight  the height of viewport.
0036   Standard_EXPORT double persistentScale(const occ::handle<Graphic3d_Camera>& theCamera,
0037                                          const int                            theViewportWidth,
0038                                          const int theViewportHeight) const override;
0039 
0040 public:
0041   DEFINE_STANDARD_RTTIEXT(Graphic3d_TransformPersScaledAbove, Graphic3d_TransformPers)
0042 
0043 private:
0044   double myScale; //!< scale bound value
0045 };
0046 
0047 #endif