0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / OpenGl / OpenGl_Display.hxx
1 // Created on: 2011-09-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20 #ifndef _OpenGl_Display_Header
21 #define _OpenGl_Display_Header
22
23 #include <Handle_OpenGl_Display.hxx>
24 #include <MMgt_TShared.hxx>
25
26 #include <Aspect_Display.hxx>
27 #include <Aspect_DisplayConnection.hxx>
28 #include <Aspect_TypeOfLine.hxx>
29 #include <Aspect_TypeOfMarker.hxx>
30
31 #include <Font_FontAspect.hxx>
32
33 #include <InterfaceGraphic_telem.hxx>
34
35 #include <Handle_OpenGl_Window.hxx>
36
37 struct OpenGl_Facilities
38 {
39   int AntiAliasing;
40   int DepthCueing;
41   int DoubleBuffer;
42   int ZBuffer;
43   int MaxLights;
44   int MaxViews;
45 };
46
47 class OpenGl_Context;
48
49 class OpenGl_Display : public MMgt_TShared
50 {
51 public:
52
53   OpenGl_Display (const Handle(Aspect_DisplayConnection)& theDisplayConnection);
54   virtual ~OpenGl_Display ();
55
56   Aspect_Display GetDisplay () const { return myDisplay; }
57
58   const OpenGl_Facilities & Facilities () const { return myFacilities; }
59
60   Standard_Boolean DBuffer () const { return myDBuffer; }
61   Standard_Boolean Dither () const { return myDither; }
62   Standard_Boolean BackDither () const { return myBackDither; }
63   Standard_Boolean Walkthrough () const { return myWalkthrough; }
64   Standard_Boolean SymPerspective() const { return mySymPerspective; }
65   Standard_Boolean PolygonOffset (Standard_ShortReal &AFactor, Standard_ShortReal &AUnits) const
66   {
67     AFactor = myOffsetFactor;
68     AUnits = myOffsetUnits;
69     return Standard_True;
70   }
71   Standard_Integer AntiAliasingMode () const { return myAntiAliasingMode; }
72
73   // System attributes
74
75   void InitAttributes();
76   void ReleaseAttributes (const OpenGl_Context* theGlCtx);
77
78   void SetTypeOfLine (const Aspect_TypeOfLine AType) const;
79
80   void SetTypeOfHatch (const int AType) const;
81
82   friend class OpenGl_Window;
83
84   // Type definition
85   //
86   DEFINE_STANDARD_RTTI(OpenGl_Display)
87
88  protected:
89
90   void Init ();
91
92   Aspect_Display   myDisplay;
93   OpenGl_Facilities myFacilities;
94
95   Standard_Boolean myDBuffer;
96   Standard_Boolean myDither;
97   Standard_Boolean myBackDither;
98   Standard_Boolean myWalkthrough;
99   Standard_Boolean mySymPerspective;
100   Standard_ShortReal myOffsetFactor;
101   Standard_ShortReal myOffsetUnits;
102   Standard_Integer myAntiAliasingMode;
103
104   unsigned int myLinestyleBase;
105   unsigned int myPatternBase;
106
107  public:
108   DEFINE_STANDARD_ALLOC
109 };
110
111 #endif // _OpenGl_Display_Header