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.
18 #include <Graphic3d_TextureMap.hxx>
19 #include <Graphic3d_TextureParams.hxx>
20 #include <Standard_Type.hxx>
21 #include <TCollection_AsciiString.hxx>
23 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TextureMap,Graphic3d_TextureRoot)
25 // =======================================================================
26 // function : Graphic3d_TextureMap
28 // =======================================================================
29 Graphic3d_TextureMap::Graphic3d_TextureMap (const TCollection_AsciiString& theFileName,
30 const Graphic3d_TypeOfTexture theType)
31 : Graphic3d_TextureRoot (theFileName, theType)
35 // =======================================================================
36 // function : Graphic3d_TextureMap
38 // =======================================================================
39 Graphic3d_TextureMap::Graphic3d_TextureMap (const Handle(Image_PixMap)& thePixMap,
40 const Graphic3d_TypeOfTexture theType)
41 : Graphic3d_TextureRoot (thePixMap, theType)
45 // =======================================================================
46 // function : EnableSmooth
48 // =======================================================================
49 void Graphic3d_TextureMap::EnableSmooth()
51 myParams->SetFilter (Graphic3d_TOTF_TRILINEAR);
54 // =======================================================================
55 // function : DisableSmooth
57 // =======================================================================
58 void Graphic3d_TextureMap::DisableSmooth()
60 myParams->SetFilter (Graphic3d_TOTF_NEAREST);
63 // =======================================================================
64 // function : IsSmoothed
66 // =======================================================================
67 Standard_Boolean Graphic3d_TextureMap::IsSmoothed() const
69 return myParams->Filter() != Graphic3d_TOTF_NEAREST;
72 // =======================================================================
73 // function : EnableModulate
75 // =======================================================================
76 void Graphic3d_TextureMap::EnableModulate()
78 myParams->SetModulate (Standard_True);
81 // =======================================================================
82 // function : DisableModulate
84 // =======================================================================
85 void Graphic3d_TextureMap::DisableModulate()
87 myParams->SetModulate (Standard_False);
90 // =======================================================================
91 // function : IsModulate
93 // =======================================================================
94 Standard_Boolean Graphic3d_TextureMap::IsModulate() const
96 return myParams->IsModulate();
99 // =======================================================================
100 // function : EnableRepeat
102 // =======================================================================
103 void Graphic3d_TextureMap::EnableRepeat()
105 myParams->SetRepeat (Standard_True);
108 // =======================================================================
109 // function : DisableRepeat
111 // =======================================================================
112 void Graphic3d_TextureMap::DisableRepeat()
114 myParams->SetRepeat (Standard_False);
117 // =======================================================================
118 // function : IsRepeat
120 // =======================================================================
121 Standard_Boolean Graphic3d_TextureMap::IsRepeat() const
123 return myParams->IsRepeat();
126 // =======================================================================
127 // function : AnisoFilter
129 // =======================================================================
130 Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureMap::AnisoFilter() const
132 return myParams->AnisoFilter();
135 // =======================================================================
136 // function : SetAnisoFilter
138 // =======================================================================
139 void Graphic3d_TextureMap::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
141 myParams->SetAnisoFilter (theLevel);