0024023: Revamp the OCCT Handle -- general
[occt.git] / src / Graphic3d / Graphic3d_TextureMap.cxx
CommitLineData
b311480e 1// Created on: 1997-07-28
2// Created by: Pierre CHALAMET
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
b311480e 16
7fd59977 17#include <Graphic3d_TextureMap.ixx>
bf75be98 18#include <Graphic3d_TextureParams.hxx>
19
20// =======================================================================
21// function : Graphic3d_TextureMap
22// purpose :
23// =======================================================================
24Graphic3d_TextureMap::Graphic3d_TextureMap (const TCollection_AsciiString& theFileName,
25 const Graphic3d_TypeOfTexture theType)
26: Graphic3d_TextureRoot (theFileName, theType)
27{
28}
7fd59977 29
f376ac72 30// =======================================================================
31// function : Graphic3d_TextureMap
32// purpose :
33// =======================================================================
34Graphic3d_TextureMap::Graphic3d_TextureMap (const Handle(Image_PixMap)& thePixMap,
35 const Graphic3d_TypeOfTexture theType)
36: Graphic3d_TextureRoot (thePixMap, theType)
37{
38}
39
bf75be98 40// =======================================================================
41// function : EnableSmooth
42// purpose :
43// =======================================================================
44void Graphic3d_TextureMap::EnableSmooth()
7fd59977 45{
bf75be98 46 myParams->SetFilter (Graphic3d_TOTF_TRILINEAR);
7fd59977 47}
48
bf75be98 49// =======================================================================
50// function : DisableSmooth
51// purpose :
52// =======================================================================
53void Graphic3d_TextureMap::DisableSmooth()
54{
55 myParams->SetFilter (Graphic3d_TOTF_NEAREST);
7fd59977 56}
57
bf75be98 58// =======================================================================
59// function : IsSmoothed
60// purpose :
61// =======================================================================
62Standard_Boolean Graphic3d_TextureMap::IsSmoothed() const
63{
64 return myParams->Filter() != Graphic3d_TOTF_NEAREST;
7fd59977 65}
66
bf75be98 67// =======================================================================
68// function : EnableModulate
69// purpose :
70// =======================================================================
71void Graphic3d_TextureMap::EnableModulate()
72{
73 myParams->SetModulate (Standard_True);
7fd59977 74}
75
bf75be98 76// =======================================================================
77// function : DisableModulate
78// purpose :
79// =======================================================================
80void Graphic3d_TextureMap::DisableModulate()
81{
82 myParams->SetModulate (Standard_False);
7fd59977 83}
84
bf75be98 85// =======================================================================
86// function : IsModulate
87// purpose :
88// =======================================================================
89Standard_Boolean Graphic3d_TextureMap::IsModulate() const
90{
91 return myParams->IsModulate();
7fd59977 92}
93
bf75be98 94// =======================================================================
95// function : EnableRepeat
96// purpose :
97// =======================================================================
98void Graphic3d_TextureMap::EnableRepeat()
99{
100 myParams->SetRepeat (Standard_True);
7fd59977 101}
102
bf75be98 103// =======================================================================
104// function : DisableRepeat
105// purpose :
106// =======================================================================
107void Graphic3d_TextureMap::DisableRepeat()
108{
109 myParams->SetRepeat (Standard_False);
7fd59977 110}
111
bf75be98 112// =======================================================================
113// function : IsRepeat
114// purpose :
115// =======================================================================
116Standard_Boolean Graphic3d_TextureMap::IsRepeat() const
117{
118 return myParams->IsRepeat();
7fd59977 119}
120
bf75be98 121// =======================================================================
122// function : AnisoFilter
123// purpose :
124// =======================================================================
125Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureMap::AnisoFilter() const
126{
127 return myParams->AnisoFilter();
7fd59977 128}
129
bf75be98 130// =======================================================================
131// function : SetAnisoFilter
132// purpose :
133// =======================================================================
134void Graphic3d_TextureMap::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
135{
136 myParams->SetAnisoFilter (theLevel);
137}