1 // Author: Ilya Khramov
2 // Copyright (c) 2019 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _Graphic3d_CubeMapSeparate_HeaderFile
16 #define _Graphic3d_CubeMapSeparate_HeaderFile
18 #include <Graphic3d_CubeMap.hxx>
19 #include <NCollection_Array1.hxx>
20 #include <OSD_Path.hxx>
22 //! Class to manage cubemap located in six different images.
23 class Graphic3d_CubeMapSeparate : public Graphic3d_CubeMap
25 DEFINE_STANDARD_RTTIEXT(Graphic3d_CubeMapSeparate, Graphic3d_CubeMap)
28 //! Initializes cubemap to be loaded from file.
29 //! @thePaths - array of paths to separate image files (has to have size equal 6).
30 Standard_EXPORT Graphic3d_CubeMapSeparate (const NCollection_Array1<TCollection_AsciiString>& thePaths);
32 //! Initializes cubemap to be setted directly from PixMaps.
33 //! @theImages - array if PixMaps (has to have size equal 6).
34 Standard_EXPORT Graphic3d_CubeMapSeparate(const NCollection_Array1<Handle(Image_PixMap)>& theImages);
36 //! Returns current side of cubemap as PixMap.
37 //! Returns null handle if current side or whole cubemap is invalid.
38 //! All origin images have to have the same sizes, format and quad shapes to form valid cubemap.
39 Standard_EXPORT Handle(Image_PixMap) Value() Standard_OVERRIDE;
42 virtual Handle(Image_PixMap) GetImage() const Standard_OVERRIDE
44 return Handle(Image_PixMap)();
47 //! Checks if a texture class is valid or not.
48 //! Returns true if the construction of the class is correct.
49 Standard_EXPORT Standard_Boolean IsDone() const Standard_OVERRIDE;
52 ~Graphic3d_CubeMapSeparate() {}
56 OSD_Path myPaths[6]; //!< array of paths to cubemap images
57 Handle(Image_PixMap) myImages[6]; //!< array of cubemap images
59 Standard_Size mySize; //!< size of each side of cubemap
60 Image_Format myFormat; //!< format each side of cubemap
64 //! Nulifies whole images array.
69 DEFINE_STANDARD_HANDLE(Graphic3d_CubeMapSeparate, Graphic3d_CubeMap)
71 #endif // _Graphic3d_CubeMapSeparate_HeaderFile