0024001: Stereographic rendering support
[occt.git] / src / OpenGl / OpenGl_Display.hxx
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
8 // under the terms of the GNU Lesser General Public 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_Display_Header
17 #define _OpenGl_Display_Header
18
19 #include <Handle_OpenGl_Display.hxx>
20 #include <MMgt_TShared.hxx>
21
22 #include <Aspect_Display.hxx>
23 #include <Aspect_DisplayConnection.hxx>
24 #include <Aspect_TypeOfLine.hxx>
25 #include <Aspect_TypeOfMarker.hxx>
26
27 #include <Font_FontAspect.hxx>
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
43 class OpenGl_Context;
44
45 class OpenGl_Display : public MMgt_TShared
46 {
47 public:
48
49   OpenGl_Display (const Handle(Aspect_DisplayConnection)& theDisplayConnection);
50   virtual ~OpenGl_Display ();
51
52   Aspect_Display GetDisplay () const { return myDisplay; }
53
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; }
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
70   void InitAttributes();
71   void ReleaseAttributes (const OpenGl_Context* theGlCtx);
72
73   void SetTypeOfLine (const Aspect_TypeOfLine AType) const;
74
75   void SetTypeOfHatch (const int AType) const;
76
77   friend class OpenGl_Window;
78
79   // Type definition
80   //
81   DEFINE_STANDARD_RTTI(OpenGl_Display)
82
83  protected:
84
85   void Init ();
86
87   Aspect_Display   myDisplay;
88   OpenGl_Facilities myFacilities;
89
90   Standard_Boolean myDBuffer;
91   Standard_Boolean myDither;
92   Standard_Boolean myBackDither;
93   Standard_Boolean mySymPerspective;
94   Standard_ShortReal myOffsetFactor;
95   Standard_ShortReal myOffsetUnits;
96   Standard_Integer myAntiAliasingMode;
97
98   unsigned int myLinestyleBase;
99   unsigned int myPatternBase;
100
101  public:
102   DEFINE_STANDARD_ALLOC
103 };
104
105 #endif // _OpenGl_Display_Header