Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2011-09-20 |
2 | // Created by: Sergey ZERCHANINOV | |
973c2be1 | 3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
d5f74e42 | 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 | |
973c2be1 | 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. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
b311480e | 15 | |
2166f0fa SK |
16 | #ifndef _OpenGl_Display_Header |
17 | #define _OpenGl_Display_Header | |
18 | ||
19 | #include <Handle_OpenGl_Display.hxx> | |
20 | #include <MMgt_TShared.hxx> | |
21 | ||
2166f0fa | 22 | #include <Aspect_Display.hxx> |
dc3fe572 | 23 | #include <Aspect_DisplayConnection.hxx> |
2166f0fa SK |
24 | #include <Aspect_TypeOfLine.hxx> |
25 | #include <Aspect_TypeOfMarker.hxx> | |
26 | ||
eeaaaefb | 27 | #include <Font_FontAspect.hxx> |
2166f0fa SK |
28 | |
29 | #include <InterfaceGraphic_telem.hxx> | |
30 | ||
31 | #include <Handle_OpenGl_Window.hxx> | |
32 | ||
33 | struct OpenGl_Facilities | |
34 | { | |
35 | int AntiAliasing; | |
36 | int DepthCueing; | |
37 | int DoubleBuffer; | |
38 | int ZBuffer; | |
39 | int MaxLights; | |
40 | int MaxViews; | |
41 | }; | |
42 | ||
fd4a6963 | 43 | class OpenGl_Context; |
2166f0fa SK |
44 | |
45 | class OpenGl_Display : public MMgt_TShared | |
46 | { | |
fd4a6963 | 47 | public: |
48 | ||
dc3fe572 | 49 | OpenGl_Display (const Handle(Aspect_DisplayConnection)& theDisplayConnection); |
2166f0fa SK |
50 | virtual ~OpenGl_Display (); |
51 | ||
52 | Aspect_Display GetDisplay () const { return myDisplay; } | |
53 | ||
2166f0fa SK |
54 | const OpenGl_Facilities & Facilities () const { return myFacilities; } |
55 | ||
56 | Standard_Boolean DBuffer () const { return myDBuffer; } | |
57 | Standard_Boolean Dither () const { return myDither; } | |
58 | Standard_Boolean BackDither () const { return myBackDither; } | |
2166f0fa SK |
59 | Standard_Boolean SymPerspective() const { return mySymPerspective; } |
60 | Standard_Boolean PolygonOffset (Standard_ShortReal &AFactor, Standard_ShortReal &AUnits) const | |
61 | { | |
62 | AFactor = myOffsetFactor; | |
63 | AUnits = myOffsetUnits; | |
64 | return Standard_True; | |
65 | } | |
66 | Standard_Integer AntiAliasingMode () const { return myAntiAliasingMode; } | |
67 | ||
68 | // System attributes | |
69 | ||
fd4a6963 | 70 | void InitAttributes(); |
71 | void ReleaseAttributes (const OpenGl_Context* theGlCtx); | |
2166f0fa | 72 | |
2166f0fa SK |
73 | void SetTypeOfLine (const Aspect_TypeOfLine AType) const; |
74 | ||
75 | void SetTypeOfHatch (const int AType) const; | |
76 | ||
2166f0fa SK |
77 | friend class OpenGl_Window; |
78 | ||
79 | // Type definition | |
80 | // | |
81 | DEFINE_STANDARD_RTTI(OpenGl_Display) | |
82 | ||
83 | protected: | |
84 | ||
85 | void Init (); | |
86 | ||
2166f0fa SK |
87 | Aspect_Display myDisplay; |
88 | OpenGl_Facilities myFacilities; | |
89 | ||
90 | Standard_Boolean myDBuffer; | |
91 | Standard_Boolean myDither; | |
92 | Standard_Boolean myBackDither; | |
2166f0fa SK |
93 | Standard_Boolean mySymPerspective; |
94 | Standard_ShortReal myOffsetFactor; | |
95 | Standard_ShortReal myOffsetUnits; | |
96 | Standard_Integer myAntiAliasingMode; | |
97 | ||
2166f0fa SK |
98 | unsigned int myLinestyleBase; |
99 | unsigned int myPatternBase; | |
2166f0fa | 100 | |
2166f0fa | 101 | public: |
1c35b92f | 102 | DEFINE_STANDARD_ALLOC |
2166f0fa SK |
103 | }; |
104 | ||
fd4a6963 | 105 | #endif // _OpenGl_Display_Header |