73192b37 |
1 | // Created on: 2011-09-20 |
2 | // Created by: Sergey ZERCHANINOV |
3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _OpenGl_LineAttributes_Header |
17 | #define _OpenGl_LineAttributes_Header |
18 | |
19 | #include <OpenGl_Resource.hxx> |
20 | |
640d5fe2 |
21 | #include <Graphic3d_HatchStyle.hxx> |
22 | #include <NCollection_DataMap.hxx> |
73192b37 |
23 | |
640d5fe2 |
24 | typedef NCollection_DataMap<Handle(Graphic3d_HatchStyle), unsigned int> OpenGl_MapOfHatchStylesAndIds; |
73192b37 |
25 | |
640d5fe2 |
26 | class OpenGl_Context; |
b6472664 |
27 | |
76fada68 |
28 | DEFINE_STANDARD_HANDLE(OpenGl_LineAttributes, OpenGl_Resource) |
29 | |
30 | //! Utility class to manage OpenGL resources of polygon hatching styles. |
31 | //! @note the implementation is not supported by Core Profile and by ES version. |
73192b37 |
32 | class OpenGl_LineAttributes : public OpenGl_Resource |
33 | { |
76fada68 |
34 | DEFINE_STANDARD_RTTIEXT(OpenGl_LineAttributes, OpenGl_Resource) |
73192b37 |
35 | public: |
36 | |
6d0e6be5 |
37 | //! Default constructor. |
b31fbc83 |
38 | Standard_EXPORT OpenGl_LineAttributes(); |
6d0e6be5 |
39 | |
40 | //! Default destructor. |
b31fbc83 |
41 | Standard_EXPORT virtual ~OpenGl_LineAttributes(); |
73192b37 |
42 | |
6d0e6be5 |
43 | //! Release GL resources. |
b31fbc83 |
44 | Standard_EXPORT virtual void Release (OpenGl_Context* theGlCtx) Standard_OVERRIDE; |
73192b37 |
45 | |
15669413 |
46 | //! Returns estimated GPU memory usage - not implemented. |
47 | virtual Standard_Size EstimatedDataSize() const Standard_OVERRIDE { return 0; } |
48 | |
6d0e6be5 |
49 | //! Sets type of the hatch. |
76fada68 |
50 | Standard_EXPORT bool SetTypeOfHatch (const OpenGl_Context* theGlCtx, |
51 | const Handle(Graphic3d_HatchStyle)& theStyle); |
73192b37 |
52 | |
76fada68 |
53 | private: |
73192b37 |
54 | |
640d5fe2 |
55 | unsigned int init (const OpenGl_Context* theGlCtx, |
56 | const Handle(Graphic3d_HatchStyle)& theStyle); |
57 | |
58 | protected: |
59 | |
640d5fe2 |
60 | OpenGl_MapOfHatchStylesAndIds myStyles; //!< Hatch patterns |
73192b37 |
61 | |
73192b37 |
62 | }; |
63 | |
73192b37 |
64 | #endif // _OpenGl_LineAttributes_Header |