1 // Copyright (c) 2013-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <Graphic3d_TextureParams.ixx>
16 // =======================================================================
17 // function : Graphic3d_TextureParams
19 // =======================================================================
20 Graphic3d_TextureParams::Graphic3d_TextureParams()
21 : myToModulate (Standard_False),
22 myToRepeat (Standard_False),
23 myFilter (Graphic3d_TOTF_NEAREST),
24 myAnisoLevel (Graphic3d_LOTA_OFF),
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)
35 // =======================================================================
38 // =======================================================================
39 void Graphic3d_TextureParams::Destroy() const
44 // =======================================================================
45 // function : IsModulate
47 // =======================================================================
48 Standard_Boolean Graphic3d_TextureParams::IsModulate() const
53 // =======================================================================
54 // function : SetModulate
56 // =======================================================================
57 void Graphic3d_TextureParams::SetModulate (const Standard_Boolean theToModulate)
59 myToModulate = theToModulate;
62 // =======================================================================
63 // function : IsRepeat
65 // =======================================================================
66 Standard_Boolean Graphic3d_TextureParams::IsRepeat() const
71 // =======================================================================
72 // function : SetRepeat
74 // =======================================================================
75 void Graphic3d_TextureParams::SetRepeat (const Standard_Boolean theToRepeat)
77 myToRepeat = theToRepeat;
80 // =======================================================================
83 // =======================================================================
84 Graphic3d_TypeOfTextureFilter Graphic3d_TextureParams::Filter() const
89 // =======================================================================
90 // function : SetFilter
92 // =======================================================================
93 void Graphic3d_TextureParams::SetFilter (const Graphic3d_TypeOfTextureFilter theFilter)
98 // =======================================================================
99 // function : AnisoFilter
101 // =======================================================================
102 Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureParams::AnisoFilter() const
107 // =======================================================================
108 // function : SetAnisoFilter
110 // =======================================================================
111 void Graphic3d_TextureParams::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
113 myAnisoLevel = theLevel;
116 // =======================================================================
117 // function : Rotation
119 // =======================================================================
120 Standard_ShortReal Graphic3d_TextureParams::Rotation() const
125 // =======================================================================
126 // function : SetRotation
128 // =======================================================================
129 void Graphic3d_TextureParams::SetRotation (const Standard_ShortReal theAngleDegrees)
131 myRotAngle = theAngleDegrees;
134 // =======================================================================
137 // =======================================================================
138 const Graphic3d_Vec2& Graphic3d_TextureParams::Scale() const
143 // =======================================================================
144 // function : SetScale
146 // =======================================================================
147 void Graphic3d_TextureParams::SetScale (const Graphic3d_Vec2 theScale)
152 // =======================================================================
153 // function : Translation
155 // =======================================================================
156 const Graphic3d_Vec2& Graphic3d_TextureParams::Translation() const
158 return myTranslation;
161 // =======================================================================
162 // function : SetTranslation
164 // =======================================================================
165 void Graphic3d_TextureParams::SetTranslation (const Graphic3d_Vec2 theVec)
167 myTranslation = theVec;
170 // =======================================================================
171 // function : GenMode
173 // =======================================================================
174 Graphic3d_TypeOfTextureMode Graphic3d_TextureParams::GenMode() const
179 // =======================================================================
180 // function : GenPlaneS
182 // =======================================================================
183 const Graphic3d_Vec4& Graphic3d_TextureParams::GenPlaneS() const
188 // =======================================================================
189 // function : GenPlaneT
191 // =======================================================================
192 const Graphic3d_Vec4& Graphic3d_TextureParams::GenPlaneT() const
197 // =======================================================================
198 // function : SetGenMode
200 // =======================================================================
201 void Graphic3d_TextureParams::SetGenMode (const Graphic3d_TypeOfTextureMode theMode,
202 const Graphic3d_Vec4 thePlaneS,
203 const Graphic3d_Vec4 thePlaneT)
206 myGenPlaneS = thePlaneS;
207 myGenPlaneT = thePlaneT;