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