File indexing completed on 2026-09-23 09:17:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _Graphic3d_CubeMap_HeaderFile
0016 #define _Graphic3d_CubeMap_HeaderFile
0017
0018 #include <Graphic3d_CubeMapOrder.hxx>
0019 #include <Graphic3d_TextureMap.hxx>
0020
0021
0022
0023 class Graphic3d_CubeMap : public Graphic3d_TextureMap
0024 {
0025 DEFINE_STANDARD_RTTIEXT(Graphic3d_CubeMap, Graphic3d_TextureMap)
0026 public:
0027
0028 Standard_EXPORT Graphic3d_CubeMap(const TCollection_AsciiString& theFileName,
0029 bool theToGenerateMipmaps = false);
0030
0031
0032 Standard_EXPORT Graphic3d_CubeMap(
0033 const occ::handle<Image_PixMap>& thePixmap = occ::handle<Image_PixMap>(),
0034 bool theToGenerateMipmaps = false);
0035
0036
0037 bool More() const { return !myEndIsReached; }
0038
0039
0040 Graphic3d_CubeMapSide CurrentSide() const { return myCurrentSide; }
0041
0042
0043
0044 void Next()
0045 {
0046 if (!myEndIsReached && myCurrentSide == Graphic3d_CMS_NEG_Z)
0047 {
0048 myEndIsReached = true;
0049 }
0050 else
0051 {
0052 myCurrentSide = Graphic3d_CubeMapSide(myCurrentSide + 1);
0053 }
0054 }
0055
0056
0057 void SetZInversion(bool theZIsInverted) { myZIsInverted = theZIsInverted; }
0058
0059
0060 bool ZIsInverted() const { return myZIsInverted; }
0061
0062
0063 bool HasMipmaps() const { return myHasMipmaps; }
0064
0065
0066 void SetMipmapsGeneration(bool theToGenerateMipmaps) { myHasMipmaps = theToGenerateMipmaps; }
0067
0068
0069
0070
0071 virtual occ::handle<Image_CompressedPixMap> CompressedValue(
0072 const occ::handle<Image_SupportedFormats>& theSupported) = 0;
0073
0074
0075
0076 virtual occ::handle<Image_PixMap> Value(
0077 const occ::handle<Image_SupportedFormats>& theSupported) = 0;
0078
0079
0080 Graphic3d_CubeMap& Reset()
0081 {
0082 myCurrentSide = Graphic3d_CMS_POS_X;
0083 myEndIsReached = false;
0084 return *this;
0085 }
0086
0087
0088 Standard_EXPORT ~Graphic3d_CubeMap() override;
0089
0090 protected:
0091 Graphic3d_CubeMapSide myCurrentSide;
0092
0093 bool myEndIsReached;
0094 bool myZIsInverted;
0095
0096 };
0097
0098 #endif