c5751993 |
1 | // Created on: 2014-03-31 |
2 | // Created by: Danila ULYANOV |
3 | // Copyright (c) 2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
0a36ca0a |
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 |
c5751993 |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _OpenGl_Layer_Header |
17 | #define _OpenGl_Layer_Header |
18 | |
19 | #include <OpenGl_PriorityList.hxx> |
20 | #include <Graphic3d_ZLayerSettings.hxx> |
550f3b8b |
21 | #include <OpenGl_GlCore11.hxx> |
c5751993 |
22 | |
23 | class Handle(OpenGl_Workspace); |
24 | |
550f3b8b |
25 | struct OpenGl_GlobalLayerSettings |
26 | { |
27 | GLint DepthFunc; |
28 | GLboolean DepthMask; |
29 | }; |
30 | |
c5751993 |
31 | class OpenGl_Layer |
32 | { |
33 | public: |
34 | |
35 | //! Initializes associated priority list and layer properties |
36 | OpenGl_Layer (const Standard_Integer theNbPriorities = 11); |
37 | |
38 | //! Returns settings of the layer object. |
39 | const Graphic3d_ZLayerSettings LayerSettings() const { return myLayerSettings; }; |
40 | |
41 | //! Sets settings of the layer object. |
42 | void SetLayerSettings (Graphic3d_ZLayerSettings theSettings) |
43 | { |
44 | myLayerSettings = theSettings; |
45 | } |
46 | |
47 | //! Returns true if theSetting is enabled for the layer. |
48 | const Standard_Boolean IsSettingEnabled (const Graphic3d_ZLayerSetting theSetting) const |
49 | { |
50 | return myLayerSettings.IsSettingEnabled (theSetting); |
51 | } |
52 | |
53 | //! Returns reference to associated priority list. |
54 | OpenGl_PriorityList& PriorityList() { return myPriorityList; } |
55 | |
56 | //! Returns const reference to associated priority list. |
57 | const OpenGl_PriorityList& PriorityList() const { return myPriorityList; } |
58 | |
550f3b8b |
59 | void Render (const Handle(OpenGl_Workspace) &AWorkspace, const OpenGl_GlobalLayerSettings& theDefaultSettings) const; |
c5751993 |
60 | |
61 | private: |
62 | |
63 | OpenGl_PriorityList myPriorityList; //!< Associated priority list object. |
64 | |
65 | Graphic3d_ZLayerSettings myLayerSettings; //!< Layer setting flags. |
66 | }; |
67 | #endif //_OpenGl_Layer_Header |