4c44e37e5527755ff11e4f881aeaf84c2f8d064a
[occt.git] / src / Graphic3d / Graphic3d_TextureMap.cxx
1 // Created on: 1997-07-28
2 // Created by: Pierre CHALAMET
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <Graphic3d_TextureMap.ixx>
18 #include <Graphic3d_TextureParams.hxx>
19
20 // =======================================================================
21 // function : Graphic3d_TextureMap
22 // purpose  :
23 // =======================================================================
24 Graphic3d_TextureMap::Graphic3d_TextureMap (const TCollection_AsciiString& theFileName,
25                                             const Graphic3d_TypeOfTexture  theType)
26 : Graphic3d_TextureRoot (theFileName, theType)
27 {
28 }
29
30 // =======================================================================
31 // function : EnableSmooth
32 // purpose  :
33 // =======================================================================
34 void Graphic3d_TextureMap::EnableSmooth()
35 {
36   myParams->SetFilter (Graphic3d_TOTF_TRILINEAR);
37 }
38
39 // =======================================================================
40 // function : DisableSmooth
41 // purpose  :
42 // =======================================================================
43 void Graphic3d_TextureMap::DisableSmooth()
44 {
45   myParams->SetFilter (Graphic3d_TOTF_NEAREST);
46 }
47
48 // =======================================================================
49 // function : IsSmoothed
50 // purpose  :
51 // =======================================================================
52 Standard_Boolean Graphic3d_TextureMap::IsSmoothed() const
53 {
54   return myParams->Filter() != Graphic3d_TOTF_NEAREST;
55 }
56
57 // =======================================================================
58 // function : EnableModulate
59 // purpose  :
60 // =======================================================================
61 void Graphic3d_TextureMap::EnableModulate()
62 {
63   myParams->SetModulate (Standard_True);
64 }
65
66 // =======================================================================
67 // function : DisableModulate
68 // purpose  :
69 // =======================================================================
70 void Graphic3d_TextureMap::DisableModulate()
71 {
72   myParams->SetModulate (Standard_False);
73 }
74
75 // =======================================================================
76 // function : IsModulate
77 // purpose  :
78 // =======================================================================
79 Standard_Boolean Graphic3d_TextureMap::IsModulate() const
80 {
81   return myParams->IsModulate();
82 }
83
84 // =======================================================================
85 // function : EnableRepeat
86 // purpose  :
87 // =======================================================================
88 void Graphic3d_TextureMap::EnableRepeat()
89 {
90   myParams->SetRepeat (Standard_True);
91 }
92
93 // =======================================================================
94 // function : DisableRepeat
95 // purpose  :
96 // =======================================================================
97 void Graphic3d_TextureMap::DisableRepeat()
98 {
99   myParams->SetRepeat (Standard_False);
100 }
101
102 // =======================================================================
103 // function : IsRepeat
104 // purpose  :
105 // =======================================================================
106 Standard_Boolean Graphic3d_TextureMap::IsRepeat() const
107 {
108   return myParams->IsRepeat();
109 }
110
111 // =======================================================================
112 // function : AnisoFilter
113 // purpose  :
114 // =======================================================================
115 Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureMap::AnisoFilter() const
116 {
117   return myParams->AnisoFilter();
118 }
119
120 // =======================================================================
121 // function : SetAnisoFilter
122 // purpose  :
123 // =======================================================================
124 void Graphic3d_TextureMap::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
125 {
126   myParams->SetAnisoFilter (theLevel);
127 }