File indexing completed on 2026-07-03 08:33:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Graphic3d_TextureParams_HeaderFile
0015 #define _Graphic3d_TextureParams_HeaderFile
0016
0017 #include <Graphic3d_LevelOfTextureAnisotropy.hxx>
0018 #include <Graphic3d_Vec2.hxx>
0019 #include <Graphic3d_Vec4.hxx>
0020 #include <Graphic3d_TextureUnit.hxx>
0021 #include <Graphic3d_TypeOfTextureFilter.hxx>
0022 #include <Graphic3d_TypeOfTextureMode.hxx>
0023 #include <Standard.hxx>
0024 #include <Standard_ShortReal.hxx>
0025 #include <Standard_Type.hxx>
0026 #include <Standard_Transient.hxx>
0027
0028
0029 class Graphic3d_TextureParams : public Standard_Transient
0030 {
0031 DEFINE_STANDARD_RTTIEXT(Graphic3d_TextureParams, Standard_Transient)
0032 public:
0033
0034 Standard_EXPORT Graphic3d_TextureParams();
0035
0036
0037 Standard_EXPORT virtual ~Graphic3d_TextureParams();
0038
0039
0040 Graphic3d_TextureUnit TextureUnit() const { return myTextureUnit; }
0041
0042
0043 void SetTextureUnit(Graphic3d_TextureUnit theUnit) { myTextureUnit = theUnit; }
0044
0045
0046
0047 Standard_Boolean IsModulate() const { return myToModulate; }
0048
0049
0050 Standard_EXPORT void SetModulate(const Standard_Boolean theToModulate);
0051
0052
0053
0054 Standard_Boolean IsRepeat() const { return myToRepeat; }
0055
0056
0057 Standard_EXPORT void SetRepeat(const Standard_Boolean theToRepeat);
0058
0059
0060
0061 Graphic3d_TypeOfTextureFilter Filter() const { return myFilter; }
0062
0063
0064 Standard_EXPORT void SetFilter(const Graphic3d_TypeOfTextureFilter theFilter);
0065
0066
0067
0068 Graphic3d_LevelOfTextureAnisotropy AnisoFilter() const { return myAnisoLevel; }
0069
0070
0071 Standard_EXPORT void SetAnisoFilter(const Graphic3d_LevelOfTextureAnisotropy theLevel);
0072
0073
0074
0075 Standard_ShortReal Rotation() const { return myRotAngle; }
0076
0077
0078 Standard_EXPORT void SetRotation(const Standard_ShortReal theAngleDegrees);
0079
0080
0081
0082 const Graphic3d_Vec2& Scale() const { return myScale; }
0083
0084
0085 Standard_EXPORT void SetScale(const Graphic3d_Vec2 theScale);
0086
0087
0088
0089 const Graphic3d_Vec2& Translation() const { return myTranslation; }
0090
0091
0092 Standard_EXPORT void SetTranslation(const Graphic3d_Vec2 theVec);
0093
0094
0095
0096 Graphic3d_TypeOfTextureMode GenMode() const { return myGenMode; }
0097
0098
0099 const Graphic3d_Vec4& GenPlaneS() const { return myGenPlaneS; }
0100
0101
0102 const Graphic3d_Vec4& GenPlaneT() const { return myGenPlaneT; }
0103
0104
0105 Standard_EXPORT void SetGenMode(const Graphic3d_TypeOfTextureMode theMode,
0106 const Graphic3d_Vec4 thePlaneS,
0107 const Graphic3d_Vec4 thePlaneT);
0108
0109
0110 Standard_Integer BaseLevel() const { return myBaseLevel; }
0111
0112
0113
0114
0115 Standard_Integer MaxLevel() const { return myMaxLevel; }
0116
0117
0118
0119
0120 void SetLevelsRange(Standard_Integer theFirstLevel, Standard_Integer theSecondLevel = 0)
0121 {
0122 myMaxLevel = theFirstLevel > theSecondLevel ? theFirstLevel : theSecondLevel;
0123 myBaseLevel = theFirstLevel > theSecondLevel ? theSecondLevel : theFirstLevel;
0124 }
0125
0126
0127 unsigned int SamplerRevision() const { return mySamplerRevision; }
0128
0129 private:
0130
0131 void updateSamplerRevision() { ++mySamplerRevision; }
0132
0133 private:
0134
0135 Graphic3d_Vec4 myGenPlaneS;
0136 Graphic3d_Vec4 myGenPlaneT;
0137 Graphic3d_Vec2 myScale;
0138 Graphic3d_Vec2 myTranslation;
0139 unsigned int mySamplerRevision;
0140 Graphic3d_TextureUnit myTextureUnit;
0141 Graphic3d_TypeOfTextureFilter myFilter;
0142 Graphic3d_LevelOfTextureAnisotropy myAnisoLevel;
0143 Graphic3d_TypeOfTextureMode myGenMode;
0144 Standard_Integer myBaseLevel;
0145 Standard_Integer myMaxLevel;
0146 Standard_ShortReal myRotAngle;
0147 Standard_Boolean myToModulate;
0148 Standard_Boolean myToRepeat;
0149
0150 };
0151
0152 DEFINE_STANDARD_HANDLE(Graphic3d_TextureParams, Standard_Transient)
0153
0154 #endif