Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:58

0001 // Copyright (c) 2020 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 _Aspect_FrustumLRBT_HeaderFile
0015 #define _Aspect_FrustumLRBT_HeaderFile
0016 
0017 //! Structure defining frustum boundaries.
0018 template<typename Elem_t>
0019 struct Aspect_FrustumLRBT
0020 {
0021   Elem_t Left;
0022   Elem_t Right;
0023   Elem_t Bottom;
0024   Elem_t Top;
0025 
0026   //! Empty constructor.
0027   Aspect_FrustumLRBT() : Left (0), Right (0), Bottom (0), Top (0) {}
0028 
0029   //! Copy/cast constructor.
0030   template<typename Other_t>
0031   explicit Aspect_FrustumLRBT (const Aspect_FrustumLRBT<Other_t>& theOther)
0032   : Left  (static_cast<Elem_t> (theOther.Left)),
0033     Right (static_cast<Elem_t> (theOther.Right)),
0034     Bottom(static_cast<Elem_t> (theOther.Bottom)),
0035     Top   (static_cast<Elem_t> (theOther.Top)) {}
0036 
0037   //! Apply multiply factor.
0038   void Multiply (Elem_t theScale)
0039   {
0040     Left   *= theScale;
0041     Right  *= theScale;
0042     Bottom *= theScale;
0043     Top    *= theScale;
0044   }
0045 
0046   //! Return multiplied frustum.
0047   Aspect_FrustumLRBT<Elem_t> Multiplied (Elem_t theScale)
0048   {
0049     Aspect_FrustumLRBT<Elem_t> aCopy (*this);
0050     aCopy.Multiply (theScale);
0051     return aCopy;
0052   }
0053 };
0054 
0055 #endif // _Aspect_FrustumLRBT_HeaderFile