0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / Graphic3d / Graphic3d_TextureParams.hxx
1 // Copyright (c) 2013-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Graphic3d_TextureParams_HeaderFile
15 #define _Graphic3d_TextureParams_HeaderFile
16
17 #include <Standard.hxx>
18 #include <Standard_Type.hxx>
19
20 #include <Standard_Boolean.hxx>
21 #include <Graphic3d_TypeOfTextureFilter.hxx>
22 #include <Graphic3d_LevelOfTextureAnisotropy.hxx>
23 #include <Standard_ShortReal.hxx>
24 #include <Graphic3d_Vec2.hxx>
25 #include <Graphic3d_TypeOfTextureMode.hxx>
26 #include <Graphic3d_Vec4.hxx>
27 #include <Standard_Transient.hxx>
28
29
30 class Graphic3d_TextureParams;
31 DEFINE_STANDARD_HANDLE(Graphic3d_TextureParams, Standard_Transient)
32
33 //! This class describes texture parameters.
34 class Graphic3d_TextureParams : public Standard_Transient
35 {
36
37 public:
38
39   
40   //! Default constructor.
41   Standard_EXPORT Graphic3d_TextureParams();
42   
43   Standard_EXPORT void Destroy() const;
44 ~Graphic3d_TextureParams()
45 {
46   Destroy();
47 }
48   
49   //! @return TRUE if the texture is modulate.
50   //! Default value is FALSE.
51   Standard_EXPORT Standard_Boolean IsModulate() const;
52   
53   //! @param theToModulate turn modulation on/off.
54   Standard_EXPORT void SetModulate (const Standard_Boolean theToModulate);
55   
56   //! @return TRUE if the texture repeat is enabled.
57   //! Default value is FALSE.
58   Standard_EXPORT Standard_Boolean IsRepeat() const;
59   
60   //! @param theToRepeat turn texture repeat mode ON or OFF (clamping).
61   Standard_EXPORT void SetRepeat (const Standard_Boolean theToRepeat);
62   
63   //! @return texture interpolation filter.
64   //! Default value is Graphic3d_TOTF_NEAREST.
65   Standard_EXPORT Graphic3d_TypeOfTextureFilter Filter() const;
66   
67   //! @param theFilter texture interpolation filter.
68   Standard_EXPORT void SetFilter (const Graphic3d_TypeOfTextureFilter theFilter);
69   
70   //! @return level of anisontropy texture filter.
71   //! Default value is Graphic3d_LOTA_OFF.
72   Standard_EXPORT Graphic3d_LevelOfTextureAnisotropy AnisoFilter() const;
73   
74   //! @param theLevel level of anisontropy texture filter.
75   Standard_EXPORT void SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel);
76   
77   //! @return rotation angle in degrees
78   //! Default value is 0.
79   Standard_EXPORT Standard_ShortReal Rotation() const;
80   
81   //! @param theAngleDegrees rotation angle.
82   Standard_EXPORT void SetRotation (const Standard_ShortReal theAngleDegrees);
83   
84   //! @return scale factor
85   //! Default value is no scaling (1.0; 1.0).
86   Standard_EXPORT const Graphic3d_Vec2& Scale() const;
87   
88   //! @param theScale scale factor.
89   Standard_EXPORT void SetScale (const Graphic3d_Vec2 theScale);
90   
91   //! @return translation vector
92   //! Default value is no translation (0.0; 0.0).
93   Standard_EXPORT const Graphic3d_Vec2& Translation() const;
94   
95   //! @param theVec translation vector.
96   Standard_EXPORT void SetTranslation (const Graphic3d_Vec2 theVec);
97   
98   //! @return texture coordinates generation mode.
99   //! Default value is Graphic3d_TOTM_MANUAL.
100   Standard_EXPORT Graphic3d_TypeOfTextureMode GenMode() const;
101   
102   //! @return texture coordinates generation plane S.
103   Standard_EXPORT const Graphic3d_Vec4& GenPlaneS() const;
104   
105   //! @return texture coordinates generation plane T.
106   Standard_EXPORT const Graphic3d_Vec4& GenPlaneT() const;
107   
108   //! Setup texture coordinates generation mode.
109   Standard_EXPORT void SetGenMode (const Graphic3d_TypeOfTextureMode theMode, const Graphic3d_Vec4 thePlaneS, const Graphic3d_Vec4 thePlaneT);
110
111
112
113   DEFINE_STANDARD_RTTIEXT(Graphic3d_TextureParams,Standard_Transient)
114
115 protected:
116
117
118
119
120 private:
121
122
123   Standard_Boolean myToModulate;
124   Standard_Boolean myToRepeat;
125   Graphic3d_TypeOfTextureFilter myFilter;
126   Graphic3d_LevelOfTextureAnisotropy myAnisoLevel;
127   Standard_ShortReal myRotAngle;
128   Graphic3d_Vec2 myScale;
129   Graphic3d_Vec2 myTranslation;
130   Graphic3d_TypeOfTextureMode myGenMode;
131   Graphic3d_Vec4 myGenPlaneS;
132   Graphic3d_Vec4 myGenPlaneT;
133
134
135 };
136
137
138
139
140
141
142
143 #endif // _Graphic3d_TextureParams_HeaderFile