Update of header of files in context of License text
[occt.git] / src / Graphic3d / Graphic3d_TextureParams.cxx
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 #include <Graphic3d_TextureParams.ixx>
15
16 // =======================================================================
17 // function : Graphic3d_TextureParams
18 // purpose  :
19 // =======================================================================
20 Graphic3d_TextureParams::Graphic3d_TextureParams()
21 : myToModulate (Standard_False),
22   myToRepeat   (Standard_False),
23   myFilter     (Graphic3d_TOTF_NEAREST),
24   myAnisoLevel (Graphic3d_LOTA_OFF),
25   myRotAngle   (0.0f),
26   myScale      (1.0f, 1.0f),
27   myTranslation(0.0f, 0.0f),
28   myGenMode    (Graphic3d_TOTM_MANUAL),
29   myGenPlaneS  (0.0f, 0.0f, 0.0f, 0.0f),
30   myGenPlaneT  (0.0f, 0.0f, 0.0f, 0.0f)
31 {
32   //
33 }
34
35 // =======================================================================
36 // function : Destroy
37 // purpose  :
38 // =======================================================================
39 void Graphic3d_TextureParams::Destroy() const
40 {
41   //
42 }
43
44 // =======================================================================
45 // function : IsModulate
46 // purpose  :
47 // =======================================================================
48 Standard_Boolean Graphic3d_TextureParams::IsModulate() const
49 {
50   return myToModulate;
51 }
52
53 // =======================================================================
54 // function : SetModulate
55 // purpose  :
56 // =======================================================================
57 void Graphic3d_TextureParams::SetModulate (const Standard_Boolean theToModulate)
58 {
59   myToModulate = theToModulate;
60 }
61
62 // =======================================================================
63 // function : IsRepeat
64 // purpose  :
65 // =======================================================================
66 Standard_Boolean Graphic3d_TextureParams::IsRepeat() const
67 {
68   return myToRepeat;
69 }
70
71 // =======================================================================
72 // function : SetRepeat
73 // purpose  :
74 // =======================================================================
75 void Graphic3d_TextureParams::SetRepeat (const Standard_Boolean theToRepeat)
76 {
77   myToRepeat = theToRepeat;
78 }
79
80 // =======================================================================
81 // function : Filter
82 // purpose  :
83 // =======================================================================
84 Graphic3d_TypeOfTextureFilter Graphic3d_TextureParams::Filter() const
85 {
86   return myFilter;
87 }
88
89 // =======================================================================
90 // function : SetFilter
91 // purpose  :
92 // =======================================================================
93 void Graphic3d_TextureParams::SetFilter (const Graphic3d_TypeOfTextureFilter theFilter)
94 {
95   myFilter = theFilter;
96 }
97
98 // =======================================================================
99 // function : AnisoFilter
100 // purpose  :
101 // =======================================================================
102 Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureParams::AnisoFilter() const
103 {
104   return myAnisoLevel;
105 }
106
107 // =======================================================================
108 // function : SetAnisoFilter
109 // purpose  :
110 // =======================================================================
111 void Graphic3d_TextureParams::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
112 {
113   myAnisoLevel = theLevel;
114 }
115
116 // =======================================================================
117 // function : Rotation
118 // purpose  :
119 // =======================================================================
120 Standard_ShortReal Graphic3d_TextureParams::Rotation() const
121 {
122   return myRotAngle;
123 }
124
125 // =======================================================================
126 // function : SetRotation
127 // purpose  :
128 // =======================================================================
129 void Graphic3d_TextureParams::SetRotation (const Standard_ShortReal theAngleDegrees)
130 {
131   myRotAngle = theAngleDegrees;
132 }
133
134 // =======================================================================
135 // function : Scale
136 // purpose  :
137 // =======================================================================
138 const Graphic3d_Vec2& Graphic3d_TextureParams::Scale() const
139 {
140   return myScale;
141 }
142
143 // =======================================================================
144 // function : SetScale
145 // purpose  :
146 // =======================================================================
147 void Graphic3d_TextureParams::SetScale (const Graphic3d_Vec2 theScale)
148 {
149   myScale = theScale;
150 }
151
152 // =======================================================================
153 // function : Translation
154 // purpose  :
155 // =======================================================================
156 const Graphic3d_Vec2& Graphic3d_TextureParams::Translation() const
157 {
158   return myTranslation;
159 }
160
161 // =======================================================================
162 // function : SetTranslation
163 // purpose  :
164 // =======================================================================
165 void Graphic3d_TextureParams::SetTranslation (const Graphic3d_Vec2 theVec)
166 {
167   myTranslation = theVec;
168 }
169
170 // =======================================================================
171 // function : GenMode
172 // purpose  :
173 // =======================================================================
174 Graphic3d_TypeOfTextureMode Graphic3d_TextureParams::GenMode() const
175 {
176   return myGenMode;
177 }
178
179 // =======================================================================
180 // function : GenPlaneS
181 // purpose  :
182 // =======================================================================
183 const Graphic3d_Vec4& Graphic3d_TextureParams::GenPlaneS() const
184 {
185   return myGenPlaneS;
186 }
187
188 // =======================================================================
189 // function : GenPlaneT
190 // purpose  :
191 // =======================================================================
192 const Graphic3d_Vec4& Graphic3d_TextureParams::GenPlaneT() const
193 {
194   return myGenPlaneT;
195 }
196
197 // =======================================================================
198 // function : SetGenMode
199 // purpose  :
200 // =======================================================================
201 void Graphic3d_TextureParams::SetGenMode (const Graphic3d_TypeOfTextureMode theMode,
202                                           const Graphic3d_Vec4              thePlaneS,
203                                           const Graphic3d_Vec4              thePlaneT)
204 {
205   myGenMode   = theMode;
206   myGenPlaneS = thePlaneS;
207   myGenPlaneT = thePlaneT;
208 }