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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <Graphic3d_TextureMap.ixx>
18 #include <Graphic3d_TextureParams.hxx>
20 // =======================================================================
21 // function : Graphic3d_TextureMap
23 // =======================================================================
24 Graphic3d_TextureMap::Graphic3d_TextureMap (const TCollection_AsciiString& theFileName,
25 const Graphic3d_TypeOfTexture theType)
26 : Graphic3d_TextureRoot (theFileName, theType)
30 // =======================================================================
31 // function : Graphic3d_TextureMap
33 // =======================================================================
34 Graphic3d_TextureMap::Graphic3d_TextureMap (const Handle(Image_PixMap)& thePixMap,
35 const Graphic3d_TypeOfTexture theType)
36 : Graphic3d_TextureRoot (thePixMap, theType)
40 // =======================================================================
41 // function : EnableSmooth
43 // =======================================================================
44 void Graphic3d_TextureMap::EnableSmooth()
46 myParams->SetFilter (Graphic3d_TOTF_TRILINEAR);
49 // =======================================================================
50 // function : DisableSmooth
52 // =======================================================================
53 void Graphic3d_TextureMap::DisableSmooth()
55 myParams->SetFilter (Graphic3d_TOTF_NEAREST);
58 // =======================================================================
59 // function : IsSmoothed
61 // =======================================================================
62 Standard_Boolean Graphic3d_TextureMap::IsSmoothed() const
64 return myParams->Filter() != Graphic3d_TOTF_NEAREST;
67 // =======================================================================
68 // function : EnableModulate
70 // =======================================================================
71 void Graphic3d_TextureMap::EnableModulate()
73 myParams->SetModulate (Standard_True);
76 // =======================================================================
77 // function : DisableModulate
79 // =======================================================================
80 void Graphic3d_TextureMap::DisableModulate()
82 myParams->SetModulate (Standard_False);
85 // =======================================================================
86 // function : IsModulate
88 // =======================================================================
89 Standard_Boolean Graphic3d_TextureMap::IsModulate() const
91 return myParams->IsModulate();
94 // =======================================================================
95 // function : EnableRepeat
97 // =======================================================================
98 void Graphic3d_TextureMap::EnableRepeat()
100 myParams->SetRepeat (Standard_True);
103 // =======================================================================
104 // function : DisableRepeat
106 // =======================================================================
107 void Graphic3d_TextureMap::DisableRepeat()
109 myParams->SetRepeat (Standard_False);
112 // =======================================================================
113 // function : IsRepeat
115 // =======================================================================
116 Standard_Boolean Graphic3d_TextureMap::IsRepeat() const
118 return myParams->IsRepeat();
121 // =======================================================================
122 // function : AnisoFilter
124 // =======================================================================
125 Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureMap::AnisoFilter() const
127 return myParams->AnisoFilter();
130 // =======================================================================
131 // function : SetAnisoFilter
133 // =======================================================================
134 void Graphic3d_TextureMap::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
136 myParams->SetAnisoFilter (theLevel);