0026149: Visualization - depth buffer should not be written within Z-layers without...
[occt.git] / src / Graphic3d / Graphic3d_CView.hxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Graphic3d_CView_HeaderFile
15 #define _Graphic3d_CView_HeaderFile
16
17 #include <InterfaceGraphic_Graphic3d.hxx>
18 #include <InterfaceGraphic_Visual3d.hxx>
19 #include <Graphic3d_RenderingParams.hxx>
20 #include <Graphic3d_TextureEnv.hxx>
21 #include <Graphic3d_Camera.hxx>
22
23 #include <Graphic3d_CLight.hxx>
24 #include <Graphic3d_SequenceOfHClipPlane.hxx>
25
26 class CALL_DEF_VIEWCONTEXT
27 {
28
29 public:
30
31   CALL_DEF_VIEWCONTEXT()
32   : Aliasing (0),
33     BackZClipping  (0),
34     FrontZClipping (0),
35     DepthCueing (0),
36     ZClipFrontPlane (0.0f),
37     ZClipBackPlane  (0.0f),
38     DepthFrontPlane (0.0f),
39     DepthBackPlane  (0.0f),
40     Model (0),
41     Visualization (0),
42     NbActiveLight (0),
43     ActiveLight (NULL),
44     SurfaceDetail (0),
45     ClipPlanes()
46   {
47     //
48   }
49
50 public:
51
52   int   Aliasing;
53
54   int   BackZClipping;
55   int   FrontZClipping;
56
57   int   DepthCueing;
58
59   float ZClipFrontPlane;
60   float ZClipBackPlane;
61
62   float DepthFrontPlane;
63   float DepthBackPlane;
64
65   int   Model;
66   int   Visualization;
67
68   int   NbActiveLight;
69   Graphic3d_CLight* ActiveLight;
70
71   Handle(Graphic3d_TextureEnv) TextureEnv;
72   int   SurfaceDetail;
73
74   Graphic3d_SequenceOfHClipPlane ClipPlanes;
75
76   Handle(Graphic3d_Camera) Camera;
77 };
78
79 class Graphic3d_CView
80 {
81
82 public:
83
84   Graphic3d_CView()
85   : WsId (-1),
86     ViewId (0),
87     ptrView (NULL),
88     IsDeleted (0),
89     IsOpen (0),
90     Active (0),
91     ptrUnderLayer (NULL),
92     ptrOverLayer  (NULL),
93     Backfacing  (0),
94     GContext (NULL),
95     GDisplayCB  (NULL),
96     GClientData (NULL),
97     ptrFBO (NULL),
98     WasRedrawnGL (0),
99     IsCullingEnabled (Standard_True)
100   {
101     memset (&DefWindow, 0, sizeof(DefWindow));
102   }
103
104 public:
105
106   int   WsId;
107   int   ViewId;
108   void* ptrView;
109
110   int   IsDeleted;
111   int   IsOpen;
112
113   int   Active;
114
115   CALL_DEF_VIEWCONTEXT     Context;
116
117   CALL_DEF_WINDOW          DefWindow;
118
119   void* ptrUnderLayer;
120   void* ptrOverLayer;
121
122   int   Backfacing;
123
124   Aspect_RenderingContext    GContext;
125   Aspect_GraphicCallbackProc GDisplayCB;
126   void* GClientData;
127
128   void* ptrFBO;
129
130   //! Was the window redrawn by standard OpenGL?
131   mutable int WasRedrawnGL;
132
133   //! Specifies rendering parameters and effects.
134   Graphic3d_RenderingParams RenderParams;
135
136   //! Enables/disables frustum culling.
137   Standard_Boolean IsCullingEnabled;
138
139 };
140
141 #endif // Graphic3d_CView_HeaderFile