0031004: Coding - eliminate warnings issued by gcc 9.1.0
[occt.git] / src / Graphic3d / Graphic3d_TextureParams.cxx
CommitLineData
d5f74e42 1// Copyright (c) 2013-2014 OPEN CASCADE SAS
bf75be98 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
bf75be98 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
bf75be98 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
bf75be98 13
42cf5bc1 14#include <Graphic3d_TextureParams.hxx>
bf75be98 15
92efcf78 16IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TextureParams,Standard_Transient)
17
bf75be98 18// =======================================================================
19// function : Graphic3d_TextureParams
20// purpose :
21// =======================================================================
22Graphic3d_TextureParams::Graphic3d_TextureParams()
cc8cbabe 23: myGenPlaneS (0.0f, 0.0f, 0.0f, 0.0f),
24 myGenPlaneT (0.0f, 0.0f, 0.0f, 0.0f),
bf75be98 25 myScale (1.0f, 1.0f),
26 myTranslation(0.0f, 0.0f),
cc8cbabe 27 mySamplerRevision (0),
28 myTextureUnit(Graphic3d_TextureUnit_BaseColor),
29 myFilter (Graphic3d_TOTF_NEAREST),
30 myAnisoLevel (Graphic3d_LOTA_OFF),
bf75be98 31 myGenMode (Graphic3d_TOTM_MANUAL),
67312b79 32 myBaseLevel (0),
33 myMaxLevel (1000),
cc8cbabe 34 myRotAngle (0.0f),
35 myToModulate (Standard_False),
36 myToRepeat (Standard_False)
bf75be98 37{
38 //
39}
40
41// =======================================================================
cc8cbabe 42// function : ~Graphic3d_TextureParams
bf75be98 43// purpose :
44// =======================================================================
cc8cbabe 45Graphic3d_TextureParams::~Graphic3d_TextureParams()
bf75be98 46{
47 //
48}
49
bf75be98 50// =======================================================================
51// function : SetModulate
52// purpose :
53// =======================================================================
54void Graphic3d_TextureParams::SetModulate (const Standard_Boolean theToModulate)
55{
56 myToModulate = theToModulate;
57}
58
bf75be98 59// =======================================================================
60// function : SetRepeat
61// purpose :
62// =======================================================================
63void Graphic3d_TextureParams::SetRepeat (const Standard_Boolean theToRepeat)
64{
cc8cbabe 65 if (myToRepeat != theToRepeat)
66 {
67 myToRepeat = theToRepeat;
68 updateSamplerRevision();
69 }
bf75be98 70}
71
72// =======================================================================
73// function : SetFilter
74// purpose :
75// =======================================================================
76void Graphic3d_TextureParams::SetFilter (const Graphic3d_TypeOfTextureFilter theFilter)
77{
cc8cbabe 78 if (myFilter != theFilter)
79 {
80 myFilter = theFilter;
81 updateSamplerRevision();
82 }
bf75be98 83}
84
85// =======================================================================
86// function : SetAnisoFilter
87// purpose :
88// =======================================================================
89void Graphic3d_TextureParams::SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
90{
cc8cbabe 91 if (myAnisoLevel != theLevel)
92 {
93 myAnisoLevel = theLevel;
94 updateSamplerRevision();
95 }
bf75be98 96}
97
98// =======================================================================
99// function : SetRotation
100// purpose :
101// =======================================================================
102void Graphic3d_TextureParams::SetRotation (const Standard_ShortReal theAngleDegrees)
103{
104 myRotAngle = theAngleDegrees;
105}
106
bf75be98 107// =======================================================================
108// function : SetScale
109// purpose :
110// =======================================================================
111void Graphic3d_TextureParams::SetScale (const Graphic3d_Vec2 theScale)
112{
113 myScale = theScale;
114}
115
bf75be98 116// =======================================================================
117// function : SetTranslation
118// purpose :
119// =======================================================================
120void Graphic3d_TextureParams::SetTranslation (const Graphic3d_Vec2 theVec)
121{
122 myTranslation = theVec;
123}
124
bf75be98 125// =======================================================================
126// function : SetGenMode
127// purpose :
128// =======================================================================
129void Graphic3d_TextureParams::SetGenMode (const Graphic3d_TypeOfTextureMode theMode,
130 const Graphic3d_Vec4 thePlaneS,
131 const Graphic3d_Vec4 thePlaneT)
132{
133 myGenMode = theMode;
134 myGenPlaneS = thePlaneS;
135 myGenPlaneT = thePlaneT;
136}