Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2021-10-14
0002 // Created by: Artem CHESNOKOV
0003 // Copyright (c) 2021 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Aspect_SkydomeBackground_Header
0017 #define _Aspect_SkydomeBackground_Header
0018 
0019 #include <gp_Dir.hxx>
0020 #include <Graphic3d_Vec3.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024 
0025 //! This class allows the definition of a window skydome background.
0026 class Aspect_SkydomeBackground
0027 {
0028 public:
0029 
0030   DEFINE_STANDARD_ALLOC
0031 
0032   //! Creates a window skydome background.
0033   //! By default skydome is initialized with sun at its zenith (0.0, 1.0, 0.0),
0034   //! average clody (0.2), zero time parameter, zero fogginess, 512x512 texture size.
0035   Standard_EXPORT Aspect_SkydomeBackground();
0036 
0037   //! Creates a window skydome background with given parameters.
0038   //! @param[in] theSunDirection direction to the sun (moon). Sun direction with negative Y component
0039   //!                            represents moon with (-X, -Y, -Z) direction.
0040   //! @param[in] theCloudiness   cloud intensity, 0.0 means no clouds at all and 1.0 - high clody.
0041   //! @param[in] theTime         time parameter of simulation. Might be tweaked to slightly change appearance.
0042   //! @param[in] theFogginess    fog intensity, 0.0 means no fog and 1.0 - high fogginess
0043   //! @param[in] theSize         size of cubemap side in pixels.
0044   Standard_EXPORT Aspect_SkydomeBackground (const gp_Dir& theSunDirection,
0045                                             Standard_ShortReal theCloudiness,
0046                                             Standard_ShortReal theTime,
0047                                             Standard_ShortReal theFogginess,
0048                                             Standard_Integer   theSize);
0049 
0050   //! Destructor.
0051   Standard_EXPORT ~Aspect_SkydomeBackground();
0052 
0053   //! Get sun direction. By default this value is (0, 1, 0)
0054   //! Sun direction with negative Y component represents moon with (-X, -Y, -Z) direction.
0055   const gp_Dir& SunDirection() const { return mySunDirection; }
0056 
0057   //! Get cloud intensity. By default this value is 0.2
0058   //! 0.0 means no clouds at all and 1.0 - high clody.
0059   Standard_ShortReal Cloudiness()  const { return myCloudiness; }
0060 
0061   //! Get time of cloud simulation. By default this value is 0.0
0062   //! This value might be tweaked to slightly change appearance of clouds.
0063   Standard_ShortReal TimeParameter() const { return myTime; }
0064 
0065   //! Get fog intensity. By default this value is 0.0
0066   //! 0.0 means no fog and 1.0 - high fogginess
0067   Standard_ShortReal Fogginess() const { return myFogginess; }
0068 
0069   //! Get size of cubemap. By default this value is 512
0070   Standard_Integer Size() const { return mySize; }
0071 
0072   //! Set sun direction. By default this value is (0, 1, 0)
0073   //! Sun direction with negative Y component represents moon with (-X, -Y, -Z) direction.
0074   void SetSunDirection (const gp_Dir& theSunDirection) { mySunDirection = theSunDirection; }
0075 
0076   //! Set cloud intensity. By default this value is 0.2
0077   //! 0.0 means no clouds at all and 1.0 - high clody.
0078   Standard_EXPORT void SetCloudiness (Standard_ShortReal theCloudiness);
0079 
0080   //! Set time of cloud simulation. By default this value is 0.0
0081   //! This value might be tweaked to slightly change appearance of clouds.
0082   void SetTimeParameter (Standard_ShortReal theTime) { myTime = theTime; }
0083 
0084   //! Set fog intensity. By default this value is 0.0
0085   //! 0.0 means no fog and 1.0 - high fogginess
0086   Standard_EXPORT void SetFogginess (Standard_ShortReal theFogginess);
0087 
0088   //! Set size of cubemap. By default this value is 512
0089   Standard_EXPORT void SetSize (Standard_Integer theSize);
0090 
0091   //! Dumps the content of me into the stream
0092   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0093 
0094 private:
0095 
0096   gp_Dir mySunDirection;           //!< Sun (moon) light direction.
0097   Standard_ShortReal myCloudiness; //!< Cloud intensity.
0098   Standard_ShortReal myTime;       //!< Simulation time parameter.
0099   Standard_ShortReal myFogginess;  //!< Fog intensity
0100   Standard_Integer   mySize;       //!< Size of cubemap in pixels
0101 
0102 };
0103 
0104 #endif // _Aspect_SkydomeBackground_Header