1 // Created on: 2013-10-02
2 // Created by: Denis BOGOLEPOV
3 // Copyright (c) 2013-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _OpenGl_MaterialState_HeaderFile
17 #define _OpenGl_MaterialState_HeaderFile
19 #include <OpenGl_ShaderStates.hxx>
20 #include <OpenGl_Material.hxx>
22 //! Defines generic state of material properties.
23 class OpenGl_MaterialState : public OpenGl_StateInterface
27 //! Creates new material state.
28 OpenGl_MaterialState() : myToDistinguish (false), myToMapTexture (false) {}
30 //! Sets new material aspect.
31 void Set (const OpenGl_Material& theFrontMat,
32 const OpenGl_Material& theBackMat,
33 const bool theToDistinguish,
34 const bool theToMapTexture)
36 myMatFront = theFrontMat;
37 myMatBack = theBackMat;
38 myToDistinguish = theToDistinguish;
39 myToMapTexture = theToMapTexture;
42 //! Return front material.
43 const OpenGl_Material& FrontMaterial() const { return myMatFront; }
45 //! Return back material.
46 const OpenGl_Material& BackMaterial() const { return myMatBack; }
48 //! Distinguish front/back flag.
49 bool ToDistinguish() const { return myToDistinguish; }
51 //! Flag for mapping a texture.
52 bool ToMapTexture() const { return myToMapTexture; }
56 OpenGl_Material myMatFront; //!< front material
57 OpenGl_Material myMatBack; //!< back material
58 bool myToDistinguish; //!< distinguish front/back flag
59 bool myToMapTexture; //!< flag for mapping a texture
63 #endif // _OpenGl_MaterialState_HeaderFile