0029516: Visualization - eliminate redundant property Graphic3d_MaterialAspect::Refle...
[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
18 #include <Graphic3d_TextureMap.hxx>
19 #include <Graphic3d_TextureParams.hxx>
20 #include <Standard_Type.hxx>
21 #include <TCollection_AsciiString.hxx>
22
23 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TextureMap,Graphic3d_TextureRoot)
24
25 // =======================================================================
26 // function : Graphic3d_TextureMap
27 // purpose  :
28 // =======================================================================
29 Graphic3d_TextureMap::Graphic3d_TextureMap (const TCollection_AsciiString& theFileName,
30                                             const Graphic3d_TypeOfTexture  theType)
31 : Graphic3d_TextureRoot (theFileName, theType)
32 {
33 }
34
35 // =======================================================================
36 // function : Graphic3d_TextureMap
37 // purpose  :
38 // =======================================================================
39 Graphic3d_TextureMap::Graphic3d_TextureMap (const Handle(Image_PixMap)&   thePixMap,
40                                             const Graphic3d_TypeOfTexture theType)
41 : Graphic3d_TextureRoot (thePixMap, theType)
42 {
43 }
44
45 // =======================================================================
46 // function : EnableSmooth
47 // purpose  :
48 // =======================================================================
49 void Graphic3d_TextureMap::EnableSmooth()
50 {
51   myParams->SetFilter (Graphic3d_TOTF_TRILINEAR);
52 }
53
54 // =======================================================================
55 // function : DisableSmooth
56 // purpose  :
57 // =======================================================================
58 void Graphic3d_TextureMap::DisableSmooth()
59 {
60   myParams->SetFilter (Graphic3d_TOTF_NEAREST);
61 }
62
63 // =======================================================================
64 // function : IsSmoothed
65 // purpose  :
66 // =======================================================================
67 Standard_Boolean Graphic3d_TextureMap::IsSmoothed() const
68 {
69   return myParams->Filter() != Graphic3d_TOTF_NEAREST;
70 }
71
72 // =======================================================================
73 // function : EnableModulate
74 // purpose  :
75 // =======================================================================
76 void Graphic3d_TextureMap::EnableModulate()
77 {
78   myParams->SetModulate (Standard_True);
79 }
80
81 // =======================================================================
82 // function : DisableModulate
83 // purpose  :
84 // =======================================================================
85 void Graphic3d_TextureMap::DisableModulate()
86 {
87   myParams->SetModulate (Standard_False);
88 }
89
90 // =======================================================================
91 // function : IsModulate
92 // purpose  :
93 // =======================================================================
94 Standard_Boolean Graphic3d_TextureMap::IsModulate() const
95 {
96   return myParams->IsModulate();
97 }
98
99 // =======================================================================
100 // function : EnableRepeat
101 // purpose  :
102 // =======================================================================
103 void Graphic3d_TextureMap::EnableRepeat()
104 {
105   myParams->SetRepeat (Standard_True);
106 }
107
108 // =======================================================================
109 // function : DisableRepeat
110 // purpose  :
111 // =======================================================================
112 void Graphic3d_TextureMap::DisableRepeat()
113 {
114   myParams->SetRepeat (Standard_False);
115 }
116
117 // =======================================================================
118 // function : IsRepeat
119 // purpose  :
120 // =======================================================================
121 Standard_Boolean Graphic3d_TextureMap::IsRepeat() const
122 {
123   return myParams->IsRepeat();
124 }
125
126 // =======================================================================
127 // function : AnisoFilter
128 // purpose  :
129 // =======================================================================
130 Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureMap::AnisoFilter() const
131 {
132   return myParams->AnisoFilter();
133 }
134
135 // =======================================================================
136 // function : SetAnisoFilter
137 // purpose  :
138 // =======================================================================
139 void Graphic3d_TextureMap::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
140 {
141   myParams->SetAnisoFilter (theLevel);
142 }