0024001: Stereographic rendering support
[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
6 // under the terms of the GNU Lesser General Public 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 <Handle_Graphic3d_TextureEnv.hxx>
20 #include <Graphic3d_Camera.hxx>
21
22 #include <Standard_Type.hxx>
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     ZBufferActivity (0),
41     Model (0),
42     Visualization (0),
43     NbActiveLight (0),
44     ActiveLight (NULL),
45     SurfaceDetail (0),
46     ClipPlanes()
47   {
48     //
49   }
50
51 public:
52
53   int   Aliasing;
54
55   int   BackZClipping;
56   int   FrontZClipping;
57
58   int   DepthCueing;
59
60   float ZClipFrontPlane;
61   float ZClipBackPlane;
62
63   float DepthFrontPlane;
64   float DepthBackPlane;
65
66   int   ZBufferActivity;
67   int   Model;
68   int   Visualization;
69
70   int   NbActiveLight;
71   Graphic3d_CLight* ActiveLight;
72
73   Handle(Graphic3d_TextureEnv) TextureEnv;
74   int   SurfaceDetail;
75
76   Graphic3d_SequenceOfHClipPlane ClipPlanes;
77
78   Handle(Graphic3d_Camera) Camera;
79 };
80
81 class Graphic3d_CView
82 {
83
84 public:
85
86   Graphic3d_CView()
87   : WsId (-1),
88     ViewId (0),
89     ptrView (NULL),
90     IsDeleted (0),
91     IsOpen (0),
92     Active (0),
93     ptrUnderLayer (NULL),
94     ptrOverLayer  (NULL),
95     Backfacing  (0),
96           GContext (NULL),
97     GDisplayCB  (NULL),
98     GClientData (NULL),
99     ptrFBO (NULL),
100     WasRedrawnGL (0),
101     IsRaytracing (0),
102     IsShadowsEnabled (1),
103     IsReflectionsEnabled (1),
104     IsAntialiasingEnabled (0)
105   {
106           memset(&DefWindow,0,sizeof(DefWindow));
107   }
108
109 public:
110
111   int   WsId;
112   int   ViewId;
113   void* ptrView;
114
115   int   IsDeleted;
116   int   IsOpen;
117
118   int   Active;
119
120   CALL_DEF_VIEWCONTEXT     Context;
121
122   CALL_DEF_WINDOW          DefWindow;
123
124   void* ptrUnderLayer;
125   void* ptrOverLayer;
126
127   int   Backfacing;
128
129   Aspect_RenderingContext    GContext;
130   Aspect_GraphicCallbackProc GDisplayCB;
131   void* GClientData;
132
133   void* ptrFBO;
134
135   //! Was the window redrawn by standard OpenGL?
136   mutable int WasRedrawnGL;
137
138   //! Enables/disables OpenCL-based ray-tracing.
139   int IsRaytracing;
140
141   //! Enables/disables ray-traced sharp shadows.
142   int IsShadowsEnabled;
143   
144   //! Enables/disables ray-traced reflections.
145   int IsReflectionsEnabled;
146   
147   //! Enables/disables ray-traced adaptive anti-aliasing.
148   int IsAntialiasingEnabled;
149
150 };
151
152 const Handle(Standard_Type)& TYPE(Graphic3d_CView);
153
154 #endif // Graphic3d_CView_HeaderFile