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