Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2011-10-20 |
2 | // Created by: Sergey ZERCHANINOV | |
973c2be1 | 3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
d5f74e42 | 7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 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. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
b311480e | 15 | |
2166f0fa SK |
16 | #ifndef _OpenGl_GraphicDriver_HeaderFile |
17 | #define _OpenGl_GraphicDriver_HeaderFile | |
18 | ||
19 | #include <Graphic3d_GraphicDriver.hxx> | |
20 | #include <Handle_OpenGl_GraphicDriver.hxx> | |
5e27df78 | 21 | #include <OpenGl_Context.hxx> |
a174a3c5 | 22 | #include <OpenGl_PrinterContext.hxx> |
2166f0fa SK |
23 | |
24 | #include <Standard_CString.hxx> | |
25 | ||
26 | #include <Handle_TColStd_HArray1OfByte.hxx> | |
27 | #include <Handle_TColStd_HArray1OfReal.hxx> | |
28 | #include <Quantity_PlaneAngle.hxx> | |
29 | #include <Quantity_NameOfColor.hxx> | |
bf75be98 | 30 | #include <Handle_OpenGl_View.hxx> |
1981cb22 | 31 | #include <Handle_OpenGl_Workspace.hxx> |
2166f0fa SK |
32 | |
33 | #include <Aspect_Display.hxx> | |
dc3fe572 | 34 | #include <Aspect_DisplayConnection.hxx> |
2166f0fa SK |
35 | #include <Aspect_GradientFillMethod.hxx> |
36 | #include <Aspect_FillMethod.hxx> | |
37 | #include <Aspect_CLayer2d.hxx> | |
38 | #include <Aspect_TypeOfTriedronPosition.hxx> | |
39 | #include <Aspect_TypeOfTriedronEcho.hxx> | |
40 | #include <Aspect_Handle.hxx> | |
41 | #include <Aspect_PrintAlgo.hxx> | |
938d4544 | 42 | #include <gp_Ax2.hxx> |
2166f0fa SK |
43 | #include <Graphic3d_CView.hxx> |
44 | #include <Graphic3d_CStructure.hxx> | |
2166f0fa | 45 | #include <Graphic3d_CPick.hxx> |
2166f0fa SK |
46 | #include <Graphic3d_TextPath.hxx> |
47 | #include <Graphic3d_HorizontalTextAlignment.hxx> | |
48 | #include <Graphic3d_VerticalTextAlignment.hxx> | |
2166f0fa SK |
49 | #include <Graphic3d_CUserDraw.hxx> |
50 | #include <Graphic3d_CGraduatedTrihedron.hxx> | |
51 | #include <Graphic3d_TypeOfComposition.hxx> | |
2166f0fa SK |
52 | #include <Graphic3d_ExportFormat.hxx> |
53 | #include <Graphic3d_SortType.hxx> | |
54 | #include <Graphic3d_PtrFrameBuffer.hxx> | |
55 | #include <Graphic3d_Array1OfVertex.hxx> | |
2166f0fa | 56 | #include <Graphic3d_Array2OfVertex.hxx> |
692613e5 | 57 | #include <Graphic3d_BufferType.hxx> |
2166f0fa SK |
58 | #include <NCollection_DataMap.hxx> |
59 | ||
60 | class TColStd_Array1OfInteger; | |
61 | class TColStd_Array1OfReal; | |
62 | class TColStd_Array2OfReal; | |
63 | class TColStd_HArray1OfByte; | |
2166f0fa SK |
64 | class Graphic3d_Vector; |
65 | class Quantity_Color; | |
66 | class Graphic3d_Vertex; | |
67 | class Aspect_Array1OfEdge; | |
68 | class TCollection_ExtendedString; | |
692613e5 | 69 | class Image_PixMap; |
2166f0fa | 70 | class TColStd_HArray1OfReal; |
2166f0fa | 71 | class Handle(OpenGl_Workspace); |
5e27df78 | 72 | class OpenGl_Element; |
2166f0fa | 73 | class OpenGl_Structure; |
a174a3c5 | 74 | class OpenGl_Text; |
2166f0fa | 75 | |
392ac980 | 76 | //! Tool class to implement consistent state counter |
77 | //! for objects inside the same driver instance. | |
78 | class OpenGl_StateCounter | |
79 | { | |
80 | public: | |
81 | ||
82 | OpenGl_StateCounter() : myCounter (0) { } | |
83 | ||
84 | Standard_Size Increment() { return ++myCounter; } | |
85 | ||
86 | private: | |
87 | ||
88 | Standard_Size myCounter; | |
89 | }; | |
90 | ||
ebc93ae7 | 91 | //! This class defines an OpenGl graphic driver |
2166f0fa SK |
92 | class OpenGl_GraphicDriver : public Graphic3d_GraphicDriver |
93 | { | |
bf75be98 | 94 | public: |
2166f0fa SK |
95 | |
96 | //! Constructor | |
fe9fc669 | 97 | Standard_EXPORT OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp); |
65993a95 | 98 | |
2166f0fa | 99 | Standard_EXPORT Standard_Integer InquireLightLimit (); |
2166f0fa | 100 | Standard_EXPORT Standard_Integer InquireViewLimit (); |
2166f0fa | 101 | |
2166f0fa SK |
102 | public: // Methods for graphical structures |
103 | ||
63bcc448 | 104 | Standard_EXPORT void DisplayStructure (const Graphic3d_CView& theCView, |
105 | Graphic3d_CStructure& theCStructure, | |
106 | const Standard_Integer thePriority); | |
107 | Standard_EXPORT void EraseStructure (const Graphic3d_CView& theCView, | |
108 | Graphic3d_CStructure& theCStructure); | |
109 | Standard_EXPORT void RemoveStructure (Handle(Graphic3d_CStructure)& theCStructure); | |
110 | Standard_EXPORT Handle(Graphic3d_CStructure) Structure (const Handle(Graphic3d_StructureManager)& theManager); | |
2166f0fa | 111 | |
679ecdee | 112 | Standard_EXPORT Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView, |
113 | const Standard_Boolean theDrawToFrontBuffer); | |
114 | Standard_EXPORT void DisplayImmediateStructure (const Graphic3d_CView& theCView, | |
115 | const Graphic3d_CStructure& theCStructure); | |
116 | Standard_EXPORT void EraseImmediateStructure (const Graphic3d_CView& theCView, | |
117 | const Graphic3d_CStructure& theCStructure); | |
118 | ||
2166f0fa SK |
119 | public: |
120 | ||
2166f0fa SK |
121 | Standard_EXPORT void ActivateView (const Graphic3d_CView& ACView); |
122 | Standard_EXPORT void AntiAliasing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag); | |
123 | Standard_EXPORT void Background (const Graphic3d_CView& ACView); | |
124 | Standard_EXPORT void GradientBackground (const Graphic3d_CView& ACView, const Quantity_Color& AColor1, const Quantity_Color& AColor2, const Aspect_GradientFillMethod FillStyle); | |
125 | Standard_EXPORT void BackgroundImage (const Standard_CString FileName, const Graphic3d_CView& ACView, const Aspect_FillMethod FillStyle); | |
126 | Standard_EXPORT void SetBgImageStyle (const Graphic3d_CView& ACView, const Aspect_FillMethod FillStyle); | |
127 | Standard_EXPORT void SetBgGradientStyle (const Graphic3d_CView& ACView, const Aspect_GradientFillMethod FillStyle); | |
128 | Standard_EXPORT void ClipLimit (const Graphic3d_CView& ACView, const Standard_Boolean AWait); | |
129 | Standard_EXPORT void DeactivateView (const Graphic3d_CView& ACView); | |
130 | Standard_EXPORT void DepthCueing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag); | |
2166f0fa | 131 | Standard_EXPORT void RatioWindow (const Graphic3d_CView& ACView); |
679ecdee | 132 | Standard_EXPORT void Redraw (const Graphic3d_CView& theCView, |
133 | const Aspect_CLayer2d& theCUnderLayer, | |
134 | const Aspect_CLayer2d& theCOverLayer, | |
135 | const Standard_Integer theX = 0, | |
136 | const Standard_Integer theY = 0, | |
137 | const Standard_Integer theWidth = 0, | |
138 | const Standard_Integer theHeight = 0); | |
139 | Standard_EXPORT void RedrawImmediate (const Graphic3d_CView& theCView, | |
140 | const Aspect_CLayer2d& theCUnderLayer, | |
141 | const Aspect_CLayer2d& theCOverLayer); | |
142 | Standard_EXPORT void Invalidate (const Graphic3d_CView& theCView); | |
2166f0fa SK |
143 | Standard_EXPORT void RemoveView (const Graphic3d_CView& ACView); |
144 | Standard_EXPORT void SetLight (const Graphic3d_CView& ACView); | |
4269bd1b | 145 | Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView); |
b5ac8292 | 146 | Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView); |
2166f0fa | 147 | Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView); |
2166f0fa | 148 | Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag); |
2166f0fa | 149 | Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView); |
2166f0fa | 150 | Standard_EXPORT void Environment (const Graphic3d_CView& ACView); |
2166f0fa SK |
151 | Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12); |
152 | Standard_EXPORT void TriedronDisplay (const Graphic3d_CView& ACView, const Aspect_TypeOfTriedronPosition APosition = Aspect_TOTP_CENTER, const Quantity_NameOfColor AColor = Quantity_NOC_WHITE, const Standard_Real AScale = 0.02, const Standard_Boolean AsWireframe = Standard_True); | |
153 | Standard_EXPORT void TriedronErase (const Graphic3d_CView& ACView); | |
154 | Standard_EXPORT void TriedronEcho (const Graphic3d_CView& ACView, const Aspect_TypeOfTriedronEcho AType = Aspect_TOTE_NONE); | |
155 | Standard_EXPORT void GraduatedTrihedronDisplay (const Graphic3d_CView& view, const Graphic3d_CGraduatedTrihedron& cubic); | |
156 | Standard_EXPORT void GraduatedTrihedronErase (const Graphic3d_CView& view); | |
157 | Standard_EXPORT void GraduatedTrihedronMinMaxValues (const Standard_ShortReal xmin, const Standard_ShortReal ymin, const Standard_ShortReal zmin, const Standard_ShortReal xmax, const Standard_ShortReal ymax, const Standard_ShortReal zmax); | |
2166f0fa SK |
158 | Standard_EXPORT void Layer (Aspect_CLayer2d& ACLayer); |
159 | Standard_EXPORT void RemoveLayer (const Aspect_CLayer2d& ACLayer); | |
160 | Standard_EXPORT void BeginLayer (const Aspect_CLayer2d& ACLayer); | |
161 | Standard_EXPORT void BeginPolygon2d (); | |
162 | Standard_EXPORT void BeginPolyline2d (); | |
163 | Standard_EXPORT void ClearLayer (const Aspect_CLayer2d& ACLayer); | |
164 | Standard_EXPORT void Draw (const Standard_ShortReal X,const Standard_ShortReal Y); | |
165 | Standard_EXPORT void Edge (const Standard_ShortReal X,const Standard_ShortReal Y); | |
166 | Standard_EXPORT void EndLayer (); | |
167 | Standard_EXPORT void EndPolygon2d (); | |
168 | Standard_EXPORT void EndPolyline2d (); | |
169 | Standard_EXPORT void Move (const Standard_ShortReal X,const Standard_ShortReal Y); | |
170 | Standard_EXPORT void Rectangle (const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal Width,const Standard_ShortReal Height); | |
171 | Standard_EXPORT void SetColor (const Standard_ShortReal R,const Standard_ShortReal G,const Standard_ShortReal B); | |
172 | Standard_EXPORT void SetTransparency (const Standard_ShortReal ATransparency); | |
173 | Standard_EXPORT void UnsetTransparency (); | |
174 | Standard_EXPORT void SetLineAttributes (const Standard_Integer Type,const Standard_ShortReal Width); | |
25289ec1 | 175 | |
ebc93ae7 | 176 | //! Set text attributes for under-/overlayer. |
177 | //! @param theFontName the name of the font to be used | |
178 | //! @param theType the display type of the text | |
179 | //! theR theG theB values define the color of decal or subtitle background | |
180 | //! To set the color of the text you can use the SetColor method. | |
181 | Standard_EXPORT void SetTextAttributes (const Standard_CString theFontName, | |
182 | const Standard_Integer theType, | |
183 | const Standard_ShortReal theR, | |
184 | const Standard_ShortReal theG, | |
185 | const Standard_ShortReal theB); | |
2166f0fa SK |
186 | Standard_EXPORT void Text (const Standard_CString AText,const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal AHeight); |
187 | Standard_EXPORT void TextSize (const Standard_CString AText,const Standard_ShortReal AHeight,Standard_ShortReal& AWidth,Standard_ShortReal& AnAscent,Standard_ShortReal& ADescent) const; | |
188 | Standard_EXPORT void SetBackFacingModel (const Graphic3d_CView& aView); | |
ebc93ae7 | 189 | |
190 | //! Print the contents of all layers of the view to the printer. | |
191 | //! @param thePrinterDC pass the PrinterDeviceContext (HDC) | |
192 | //! @param theToShowBackground when set to FALSE then print the view without background color (background is white) else set to TRUE for printing with current background color | |
193 | //! @param theFileName if != NULL, then the view will be printed to a file | |
194 | //! @param thePrintAlgorithm select print algorithm: stretch, tile | |
195 | //! @param theScaleFactor scaling coefficient, used internally to scale the printings accordingly to the scale factor selected in the printer properties dialog | |
196 | //! @return Standard_True if the data is passed to the printer, otherwise Standard_False if the print operation failed due to the printer errors, | |
197 | //! or lack of system memory. This might be related to insufficient memory or some internal errors. | |
198 | //! All this errors are indicated by the message boxes (on level of OpenGl_GraphicDriver). | |
199 | //! Warning: This function can reuse FBO assigned to the view, please take it into account if you use it for your purposes. | |
200 | Standard_EXPORT Standard_Boolean Print (const Graphic3d_CView& theCView, | |
201 | const Aspect_CLayer2d& theCUnderLayer, | |
202 | const Aspect_CLayer2d& theCOverLayer, | |
203 | const Aspect_Handle thePrinterDC, | |
204 | const Standard_Boolean theToShowBackground, | |
205 | const Standard_CString theFileName, | |
206 | const Aspect_PrintAlgo thePrintAlgorithm = Aspect_PA_STRETCH, | |
207 | const Standard_Real theScaleFactor = 1.0) const; | |
2166f0fa SK |
208 | Standard_EXPORT void SetDepthTestEnabled (const Graphic3d_CView& view,const Standard_Boolean isEnabled) const; |
209 | Standard_EXPORT Standard_Boolean IsDepthTestEnabled (const Graphic3d_CView& view) const; | |
ebc93ae7 | 210 | |
211 | //! Reads depths of shown pixels of the given rectangle (glReadPixels with GL_DEPTH_COMPONENT) | |
2166f0fa | 212 | Standard_EXPORT void ReadDepths (const Graphic3d_CView& view,const Standard_Integer x,const Standard_Integer y,const Standard_Integer width,const Standard_Integer height,const Standard_Address buffer) const; |
ebc93ae7 | 213 | |
214 | //! Generate offscreen FBO (needs OpenGL2+ hardware). | |
215 | //! If not supported on hardware returns NULL. | |
2166f0fa | 216 | Standard_EXPORT Graphic3d_PtrFrameBuffer FBOCreate (const Graphic3d_CView& view, const Standard_Integer width, const Standard_Integer height); |
ebc93ae7 | 217 | |
218 | //! Remove offscreen FBO | |
2166f0fa | 219 | Standard_EXPORT void FBORelease (const Graphic3d_CView& view, Graphic3d_PtrFrameBuffer& fboPtr); |
ebc93ae7 | 220 | |
221 | //! Dump active rendering buffer into specified memory buffer. | |
692613e5 | 222 | Standard_EXPORT Standard_Boolean BufferDump (const Graphic3d_CView& theCView, |
223 | Image_PixMap& theImage, | |
224 | const Graphic3d_BufferType& theBufferType); | |
ebc93ae7 | 225 | |
2166f0fa | 226 | Standard_EXPORT void SetGLLightEnabled (const Graphic3d_CView& view,const Standard_Boolean isEnabled) const; |
ebc93ae7 | 227 | |
2166f0fa | 228 | Standard_EXPORT Standard_Boolean IsGLLightEnabled (const Graphic3d_CView& view) const; |
ebc93ae7 | 229 | |
2166f0fa | 230 | Standard_EXPORT Standard_Integer InquirePlaneLimit(); |
ebc93ae7 | 231 | |
2166f0fa | 232 | Standard_EXPORT Standard_ShortReal DefaultTextHeight() const; |
ebc93ae7 | 233 | |
2166f0fa | 234 | Standard_EXPORT void FBOGetDimensions(const Graphic3d_CView& view,const Graphic3d_PtrFrameBuffer fboPtr,Standard_Integer& width,Standard_Integer& height,Standard_Integer& widthMax,Standard_Integer& heightMax); |
ebc93ae7 | 235 | |
2166f0fa | 236 | Standard_EXPORT void FBOChangeViewport(const Graphic3d_CView& view,Graphic3d_PtrFrameBuffer& fboPtr,const Standard_Integer width,const Standard_Integer height); |
ebc93ae7 | 237 | |
2166f0fa | 238 | Standard_EXPORT Standard_Boolean Export(const Standard_CString theFileName,const Graphic3d_ExportFormat theFormat,const Graphic3d_SortType theSortType,const Standard_Integer theWidth,const Standard_Integer theHeight,const Graphic3d_CView& theView,const Aspect_CLayer2d& theLayerUnder,const Aspect_CLayer2d& theLayerOver,const Standard_Real thePrecision = 0.005,const Standard_Address theProgressBarFunc = NULL,const Standard_Address theProgressObject = NULL); |
3c3131a0 | 239 | |
ebc93ae7 | 240 | //! Add a new top-level z layer with ID theLayerId for the view. Z layers allow drawing structures in higher layers in foreground of structures in lower layers. |
241 | //! To add a structure to desired layer on display it is necessary to set the layer index for the structure. | |
242 | Standard_EXPORT void AddZLayer (const Graphic3d_CView& theCView, | |
243 | const Standard_Integer theLayerId); | |
244 | ||
245 | //! Remove Z layer from the specified view. | |
246 | //! All structures displayed at the moment in layer will be displayed in default layer (the bottom-level z layer). | |
247 | //! To unset layer index from associated structures use method UnsetZLayer (...). | |
248 | Standard_EXPORT void RemoveZLayer (const Graphic3d_CView& theCView, | |
249 | const Standard_Integer theLayerId); | |
250 | ||
251 | //! Unset Z layer ID for all structures. | |
252 | //! The structure indexes will be set to default layer (the bottom-level z layer with ID = 0). | |
253 | Standard_EXPORT void UnsetZLayer (const Standard_Integer theLayerId); | |
254 | ||
255 | //! Change Z layer of a structure. | |
256 | //! The new z layer ID will be used to define the associated layer for structure on display. | |
257 | //! It is recommended to take care of redisplaying the structures already presented in view with previously set layer index. | |
258 | //! This is usually done by viewer manager. Z layers allow drawing structures in higher layers in foreground of structures in lower layers. | |
259 | Standard_EXPORT void ChangeZLayer (const Graphic3d_CStructure& theCStructure, | |
260 | const Standard_Integer theLayerId); | |
261 | ||
262 | //! Change Z layer of a structure already presented in view. | |
263 | //! It is recommended to update z layer of already displayed structures with this method before setting new z layer index to the structure. | |
264 | //! This is usually done by viewer manager. | |
265 | Standard_EXPORT void ChangeZLayer (const Graphic3d_CStructure& theCStructure, | |
266 | const Graphic3d_CView& theCView, | |
267 | const Standard_Integer theNewLayerId); | |
268 | ||
269 | //! Get Z layer ID of the structure. If the structure doesn't exists in graphic driver, the method returns -1. | |
270 | Standard_EXPORT Standard_Integer GetZLayer (const Graphic3d_CStructure& theCStructure) const; | |
2166f0fa | 271 | |
c5751993 | 272 | //! Sets the settings for a single Z layer of specified view. |
273 | Standard_EXPORT void SetZLayerSettings (const Graphic3d_CView& theCView, | |
274 | const Standard_Integer theLayerId, | |
275 | const Graphic3d_ZLayerSettings& theSettings); | |
276 | ||
b7cd4ba7 | 277 | //! Changes priority of a structure within its Z layer for the specified view. |
278 | Standard_EXPORT void ChangePriority (const Graphic3d_CStructure& theCStructure, | |
279 | const Graphic3d_CView& theCView, | |
280 | const Standard_Integer theNewPriority); | |
281 | ||
2166f0fa SK |
282 | public: |
283 | ||
58655684 | 284 | //! @return the visualization options |
285 | inline const OpenGl_Caps& Options() const | |
286 | { | |
287 | return *myCaps.operator->(); | |
288 | } | |
289 | ||
290 | //! @return the visualization options | |
291 | inline OpenGl_Caps& ChangeOptions() | |
292 | { | |
293 | return *myCaps.operator->(); | |
294 | } | |
2166f0fa SK |
295 | |
296 | //! VBO usage can be forbidden by this method even if it is supported by GL driver. | |
297 | //! Notice that disabling of VBO will cause rendering performance degradation. | |
298 | //! Warning! This method should be called only before any primitives are displayed in GL scene! | |
299 | Standard_EXPORT void EnableVBO (const Standard_Boolean theToTurnOn); | |
300 | ||
f0430952 | 301 | //! Returns information about GPU memory usage. |
302 | //! Please read OpenGl_Context::MemoryInfo() for more description. | |
303 | Standard_EXPORT Standard_Boolean MemoryInfo (Standard_Size& theFreeBytes, | |
304 | TCollection_AsciiString& theInfo) const; | |
305 | ||
5e27df78 | 306 | //! UserDraw function prototype |
307 | typedef OpenGl_Element* (*OpenGl_UserDrawCallback_t )(const CALL_DEF_USERDRAW* ); | |
2166f0fa | 308 | |
5e27df78 | 309 | //! Method to setup UserDraw callback |
310 | Standard_EXPORT OpenGl_UserDrawCallback_t& UserDrawCallback(); | |
2166f0fa | 311 | |
e276548b | 312 | public: |
e276548b | 313 | |
5e27df78 | 314 | //! Method to retrieve valid GL context. |
315 | //! Could return NULL-handle if no window created by this driver. | |
316 | Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const; | |
2166f0fa | 317 | |
b7cd4ba7 | 318 | //! Marks BVH tree for given priority list as dirty and |
319 | //! marks primitive set for rebuild. | |
320 | Standard_EXPORT void InvalidateBVHData (Graphic3d_CView& theCView, const Standard_Integer theLayerId); | |
321 | ||
2166f0fa SK |
322 | public: |
323 | ||
324 | DEFINE_STANDARD_RTTI(OpenGl_GraphicDriver) | |
5e27df78 | 325 | |
326 | private: | |
327 | ||
58655684 | 328 | Handle(OpenGl_Caps) myCaps; |
5e27df78 | 329 | NCollection_DataMap<Standard_Integer, Handle(OpenGl_View)> myMapOfView; |
330 | NCollection_DataMap<Standard_Integer, Handle(OpenGl_Workspace)> myMapOfWS; | |
331 | NCollection_DataMap<Standard_Integer, OpenGl_Structure*> myMapOfStructure; | |
a174a3c5 | 332 | mutable Handle(OpenGl_PrinterContext) myPrintContext; |
5e27df78 | 333 | OpenGl_UserDrawCallback_t myUserDrawCallback; |
a174a3c5 | 334 | OpenGl_Text* myTempText; //!< variable for compatibility (drawing text in layers) |
5e27df78 | 335 | |
392ac980 | 336 | public: |
337 | ||
8d3f219f | 338 | //! State counter for OpenGl structures. |
392ac980 | 339 | OpenGl_StateCounter* GetStateCounter() const { return &myStateCounter; } |
340 | ||
8d3f219f | 341 | //! Returns unique ID for primitive arrays. |
342 | const Standard_Size GetNextPrimitiveArrayUID() const { return myUIDGenerator.Increment(); } | |
343 | ||
392ac980 | 344 | private: |
345 | ||
8d3f219f | 346 | mutable OpenGl_StateCounter myStateCounter; //!< State counter for OpenGl structures. |
347 | mutable OpenGl_StateCounter myUIDGenerator; //!< Unique ID counter for primitive arrays. | |
392ac980 | 348 | |
2166f0fa SK |
349 | }; |
350 | ||
351 | #endif //_OpenGl_GraphicDriver_HeaderFile |