Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03: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 DEFINE_STANDARD_HANDLE(Graphic3d_TransformPersScaledAbove, Graphic3d_TransformPers)
0020 
0021 //! Transformation Zoom persistence with the above boundary of scale.
0022 //! This persistence works only when the camera scale value is below the scale value of this persistence.
0023 //! Otherwise, no persistence is applied.
0024 class Graphic3d_TransformPersScaledAbove : public Graphic3d_TransformPers
0025 {
0026 public:
0027   //! Create a Zoom transformation persistence with an anchor 3D point and a scale value
0028   Standard_EXPORT Graphic3d_TransformPersScaledAbove (const Standard_Real theScale,
0029                                                       const gp_Pnt& thePnt);
0030   //! Destructor
0031   virtual ~Graphic3d_TransformPersScaledAbove() {}
0032 
0033   //! Find scale value based on the camera position and view dimensions
0034   //! If the camera scale value less than the persistence scale, zoom persistence is not applied.
0035   //! @param theCamera [in] camera definition
0036   //! @param theViewportWidth [in] the width of viewport.
0037   //! @param theViewportHeight [in] the height of viewport.
0038   Standard_EXPORT virtual Standard_Real persistentScale (const Handle(Graphic3d_Camera)& theCamera,
0039                                                          const Standard_Integer theViewportWidth,
0040                                                          const Standard_Integer theViewportHeight) const Standard_OVERRIDE;
0041 
0042 public:
0043 
0044   DEFINE_STANDARD_RTTIEXT(Graphic3d_TransformPersScaledAbove, Graphic3d_TransformPers)
0045 
0046 private:
0047   Standard_Real myScale; //!< scale bound value
0048 };
0049 
0050 #endif