980a4ada220905b2d5e85bdcb7eb355cb19e9ab9
[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_TextureEnv.hxx>
20 #include <Graphic3d_Camera.hxx>
21
22 #include <Graphic3d_CLight.hxx>
23 #include <Graphic3d_SequenceOfHClipPlane.hxx>
24
25 class CALL_DEF_VIEWCONTEXT
26 {
27
28 public:
29
30   CALL_DEF_VIEWCONTEXT()
31   : Aliasing (0),
32     BackZClipping  (0),
33     FrontZClipping (0),
34     DepthCueing (0),
35     ZClipFrontPlane (0.0f),
36     ZClipBackPlane  (0.0f),
37     DepthFrontPlane (0.0f),
38     DepthBackPlane  (0.0f),
39     ZBufferActivity (0),
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   ZBufferActivity;
66   int   Model;
67   int   Visualization;
68
69   int   NbActiveLight;
70   Graphic3d_CLight* ActiveLight;
71
72   Handle(Graphic3d_TextureEnv) TextureEnv;
73   int   SurfaceDetail;
74
75   Graphic3d_SequenceOfHClipPlane ClipPlanes;
76
77   Handle(Graphic3d_Camera) Camera;
78 };
79
80 class Graphic3d_CView
81 {
82
83 public:
84
85   Graphic3d_CView()
86   : WsId (-1),
87     ViewId (0),
88     ptrView (NULL),
89     IsDeleted (0),
90     IsOpen (0),
91     Active (0),
92     ptrUnderLayer (NULL),
93     ptrOverLayer  (NULL),
94     Backfacing  (0),
95           GContext (NULL),
96     GDisplayCB  (NULL),
97     GClientData (NULL),
98     ptrFBO (NULL),
99     WasRedrawnGL (0),
100     IsRaytracing (0),
101     IsShadowsEnabled (1),
102     IsReflectionsEnabled (0),
103     IsAntialiasingEnabled (0)
104   {
105           memset(&DefWindow,0,sizeof(DefWindow));
106   }
107
108 public:
109
110   int   WsId;
111   int   ViewId;
112   void* ptrView;
113
114   int   IsDeleted;
115   int   IsOpen;
116
117   int   Active;
118
119   CALL_DEF_VIEWCONTEXT     Context;
120
121   CALL_DEF_WINDOW          DefWindow;
122
123   void* ptrUnderLayer;
124   void* ptrOverLayer;
125
126   int   Backfacing;
127
128   Aspect_RenderingContext    GContext;
129   Aspect_GraphicCallbackProc GDisplayCB;
130   void* GClientData;
131
132   void* ptrFBO;
133
134   //! Was the window redrawn by standard OpenGL?
135   mutable int WasRedrawnGL;
136
137   //! Enables/disables OpenCL-based ray-tracing.
138   int IsRaytracing;
139
140   //! Enables/disables ray-traced sharp shadows.
141   int IsShadowsEnabled;
142   
143   //! Enables/disables ray-traced reflections.
144   int IsReflectionsEnabled;
145   
146   //! Enables/disables ray-traced adaptive anti-aliasing.
147   int IsAntialiasingEnabled;
148
149 };
150
151 #endif // Graphic3d_CView_HeaderFile