Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:48

0001 // Author: Ilya Khramov
0002 // Copyright (c) 2019 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _Graphic3d_CubeMapSeparate_HeaderFile
0016 #define _Graphic3d_CubeMapSeparate_HeaderFile
0017 
0018 #include <Graphic3d_CubeMap.hxx>
0019 #include <NCollection_Array1.hxx>
0020 #include <OSD_Path.hxx>
0021 
0022 //! Class to manage cubemap located in six different images.
0023 class Graphic3d_CubeMapSeparate : public Graphic3d_CubeMap
0024 {
0025   DEFINE_STANDARD_RTTIEXT(Graphic3d_CubeMapSeparate, Graphic3d_CubeMap)
0026 public:
0027 
0028   //! Initializes cubemap to be loaded from file.
0029   //! @thePaths - array of paths to separate image files (has to have size equal 6).
0030   Standard_EXPORT Graphic3d_CubeMapSeparate (const NCollection_Array1<TCollection_AsciiString>& thePaths);
0031 
0032   //! Initializes cubemap to be set directly from PixMaps.
0033   //! @theImages - array if PixMaps (has to have size equal 6).
0034   Standard_EXPORT Graphic3d_CubeMapSeparate(const NCollection_Array1<Handle(Image_PixMap)>& theImages);
0035 
0036   //! Returns current cubemap side as compressed PixMap.
0037   Standard_EXPORT virtual Handle(Image_CompressedPixMap) CompressedValue (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE;
0038 
0039   //! Returns current side of cubemap as PixMap.
0040   //! Returns null handle if current side or whole cubemap is invalid.
0041   //! All origin images have to have the same sizes, format and quad shapes to form valid cubemap.
0042   Standard_EXPORT virtual Handle(Image_PixMap) Value (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE;
0043 
0044   //! Returns NULL.
0045   virtual Handle(Image_PixMap) GetImage (const Handle(Image_SupportedFormats)& ) Standard_OVERRIDE
0046   {
0047     return Handle(Image_PixMap)();
0048   }
0049 
0050   //! Checks if a texture class is valid or not.
0051   //! Returns true if the construction of the class is correct.
0052   Standard_EXPORT Standard_Boolean IsDone() const Standard_OVERRIDE;
0053 
0054   //! Empty destructor.
0055   ~Graphic3d_CubeMapSeparate() {}
0056 
0057 protected:
0058 
0059   OSD_Path             myPaths[6];  //!< array of paths to cubemap images
0060   Handle(Image_PixMap) myImages[6]; //!< array of cubemap images
0061 
0062   Standard_Size        mySize;      //!< size of each side of cubemap
0063   Image_Format         myFormat;    //!< format each side of cubemap
0064 
0065 private:
0066 
0067   //! Nulifies whole images array.
0068   void resetImages();
0069 
0070 };
0071 
0072 DEFINE_STANDARD_HANDLE(Graphic3d_CubeMapSeparate, Graphic3d_CubeMap)
0073 
0074 #endif // _Graphic3d_CubeMapSeparate_HeaderFile