0023076: Empty result done by intersection algorithm for a curve and a surface
[occt.git] / src / OpenGl / OpenGl_GraphicDriver.hxx
CommitLineData
b311480e 1// Created on: 2011-10-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
2166f0fa
SK
20
21#ifndef _OpenGl_GraphicDriver_HeaderFile
22#define _OpenGl_GraphicDriver_HeaderFile
23
24#include <Graphic3d_GraphicDriver.hxx>
25#include <Handle_OpenGl_GraphicDriver.hxx>
26
27#include <Standard_CString.hxx>
28
29#include <Handle_TColStd_HArray1OfByte.hxx>
30#include <Handle_TColStd_HArray1OfReal.hxx>
31#include <Quantity_PlaneAngle.hxx>
32#include <Quantity_NameOfColor.hxx>
33#include <Handle_AlienImage_AlienImage.hxx>
34#include <Image_CRawBufferData.hxx>
35
36#include <Aspect_Display.hxx>
37#include <Aspect_GradientFillMethod.hxx>
38#include <Aspect_FillMethod.hxx>
39#include <Aspect_CLayer2d.hxx>
40#include <Aspect_TypeOfTriedronPosition.hxx>
41#include <Aspect_TypeOfTriedronEcho.hxx>
42#include <Aspect_Handle.hxx>
43#include <Aspect_PrintAlgo.hxx>
44
45#include <Graphic3d_CView.hxx>
46#include <Graphic3d_CStructure.hxx>
47#include <Graphic3d_CGroup.hxx>
48#include <Graphic3d_TypeOfPrimitive.hxx>
49#include <Graphic3d_CPick.hxx>
50#include <Graphic3d_TypeOfPolygon.hxx>
51#include <Graphic3d_TextPath.hxx>
52#include <Graphic3d_HorizontalTextAlignment.hxx>
53#include <Graphic3d_VerticalTextAlignment.hxx>
54#include <Graphic3d_PrimitiveArray.hxx>
55#include <Graphic3d_CUserDraw.hxx>
56#include <Graphic3d_CGraduatedTrihedron.hxx>
57#include <Graphic3d_TypeOfComposition.hxx>
58#include <Graphic3d_TypeOfTexture.hxx>
59#include <Graphic3d_CInitTexture.hxx>
60#include <Graphic3d_ExportFormat.hxx>
61#include <Graphic3d_SortType.hxx>
62#include <Graphic3d_PtrFrameBuffer.hxx>
63#include <Graphic3d_Array1OfVertex.hxx>
64#include <Graphic3d_Array1OfVertexN.hxx>
65#include <Graphic3d_Array1OfVertexNT.hxx>
66#include <Graphic3d_Array1OfVertexC.hxx>
67#include <Graphic3d_Array1OfVertexNC.hxx>
68#include <Graphic3d_Array2OfVertex.hxx>
69#include <Graphic3d_Array2OfVertexN.hxx>
70#include <Graphic3d_Array2OfVertexNT.hxx>
71#include <NCollection_DataMap.hxx>
72
73class TColStd_Array1OfInteger;
74class TColStd_Array1OfReal;
75class TColStd_Array2OfReal;
76class TColStd_HArray1OfByte;
77class Graphic3d_VertexNC;
78class Graphic3d_Vector;
79class Quantity_Color;
80class Graphic3d_Vertex;
81class Aspect_Array1OfEdge;
82class TCollection_ExtendedString;
83class AlienImage_AlienImage;
84class TColStd_HArray1OfReal;
85class Handle(OpenGl_View);
86class Handle(OpenGl_Workspace);
87class OpenGl_Structure;
88
89//! This class defines an OpenGl graphic driver <br>
90class OpenGl_GraphicDriver : public Graphic3d_GraphicDriver
91{
92 public:
93
94 //! Constructor
95 Standard_EXPORT OpenGl_GraphicDriver (const Standard_CString theShrName);
96
97 Standard_EXPORT Standard_Boolean Begin (const Standard_CString ADisplay);
98 Standard_EXPORT Standard_Boolean Begin (const Aspect_Display ADisplay);
99 Standard_EXPORT void End ();
100 Standard_EXPORT Standard_Integer InquireLightLimit ();
101 Standard_EXPORT void InquireMat (const Graphic3d_CView& ACView, TColStd_Array2OfReal& AMatO, TColStd_Array2OfReal& AMatM);
102 Standard_EXPORT Standard_Integer InquireViewLimit ();
103 Standard_EXPORT Standard_Boolean InquireTextureAvailable ();
104 Standard_EXPORT void Blink (const Graphic3d_CStructure& ACStructure,const Standard_Boolean Create);
105 Standard_EXPORT void BoundaryBox (const Graphic3d_CStructure& ACStructure, const Standard_Boolean Create);
106 Standard_EXPORT void HighlightColor (const Graphic3d_CStructure& ACStructure, const Standard_ShortReal R, const Standard_ShortReal G, const Standard_ShortReal B, const Standard_Boolean Create);
107 Standard_EXPORT void NameSetStructure (const Graphic3d_CStructure& ACStructure);
108
109public: // Methods for graphical groups
110
111 Standard_EXPORT void ClearGroup (const Graphic3d_CGroup& ACGroup);
112 Standard_EXPORT void CloseGroup (const Graphic3d_CGroup& ACGroup);
113 Standard_EXPORT void FaceContextGroup (const Graphic3d_CGroup& theCGroup,
114 const Standard_Integer theNoInsert);
115 Standard_EXPORT void Group (Graphic3d_CGroup& theCGroup);
116 Standard_EXPORT void LineContextGroup (const Graphic3d_CGroup& theCGroup,
117 const Standard_Integer theNoInsert);
118 Standard_EXPORT void MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
119 const Standard_Integer theNoInsert);
120 Standard_EXPORT void MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
121 const Standard_Integer theNoInsert,
122 const Standard_Integer theMarkWidth,
123 const Standard_Integer theMarkHeight,
124 const Handle(TColStd_HArray1OfByte)& theTexture);
125 Standard_EXPORT void OpenGroup (const Graphic3d_CGroup& theCGroup);
126 Standard_EXPORT void RemoveGroup (const Graphic3d_CGroup& theCGroup);
127 Standard_EXPORT void TextContextGroup (const Graphic3d_CGroup& theCGroup,
128 const Standard_Integer theNoInsert);
129
130public: // Methods for graphical structures
131
132 Standard_EXPORT void ClearStructure (const Graphic3d_CStructure& theCStructure);
133 Standard_EXPORT void ContextStructure (const Graphic3d_CStructure& theCStructure);
134 Standard_EXPORT void Connect (const Graphic3d_CStructure& theFather,
135 const Graphic3d_CStructure& theSon);
136 Standard_EXPORT void Disconnect (const Graphic3d_CStructure& theFather,
137 const Graphic3d_CStructure& theSon);
138 Standard_EXPORT void DisplayStructure (const Graphic3d_CView& theCView,
139 const Graphic3d_CStructure& theCStructure,
140 const Standard_Integer thePriority);
141 Standard_EXPORT void EraseStructure (const Graphic3d_CView& theCView,
142 const Graphic3d_CStructure& theCStructure);
143 Standard_EXPORT void RemoveStructure (const Graphic3d_CStructure& theCStructure);
144 Standard_EXPORT void Structure (Graphic3d_CStructure& theCStructure);
145
146public:
147
2166f0fa
SK
148 Standard_EXPORT void ActivateView (const Graphic3d_CView& ACView);
149 Standard_EXPORT void AntiAliasing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
150 Standard_EXPORT void Background (const Graphic3d_CView& ACView);
151 Standard_EXPORT void GradientBackground (const Graphic3d_CView& ACView, const Quantity_Color& AColor1, const Quantity_Color& AColor2, const Aspect_GradientFillMethod FillStyle);
152 Standard_EXPORT void BackgroundImage (const Standard_CString FileName, const Graphic3d_CView& ACView, const Aspect_FillMethod FillStyle);
153 Standard_EXPORT void SetBgImageStyle (const Graphic3d_CView& ACView, const Aspect_FillMethod FillStyle);
154 Standard_EXPORT void SetBgGradientStyle (const Graphic3d_CView& ACView, const Aspect_GradientFillMethod FillStyle);
155 Standard_EXPORT void ClipLimit (const Graphic3d_CView& ACView, const Standard_Boolean AWait);
156 Standard_EXPORT void DeactivateView (const Graphic3d_CView& ACView);
157 Standard_EXPORT void DepthCueing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
158 Standard_EXPORT Standard_Boolean ProjectRaster (const Graphic3d_CView& ACView, const Standard_ShortReal AX, const Standard_ShortReal AY, const Standard_ShortReal AZ, Standard_Integer& AU, Standard_Integer& AV);
159 Standard_EXPORT Standard_Boolean UnProjectRaster (const Graphic3d_CView& ACView, const Standard_Integer Axm, const Standard_Integer Aym, const Standard_Integer AXM, const Standard_Integer AYM, const Standard_Integer AU, const Standard_Integer AV, Standard_ShortReal& AX, Standard_ShortReal& AY, Standard_ShortReal& AZ);
160 Standard_EXPORT Standard_Boolean UnProjectRasterWithRay (const Graphic3d_CView& ACView, const Standard_Integer Axm, const Standard_Integer Aym, const Standard_Integer AXM, const Standard_Integer AYM, const Standard_Integer AU, const Standard_Integer AV, Standard_ShortReal& AX, Standard_ShortReal& AY, Standard_ShortReal& AZ, Standard_ShortReal& DX, Standard_ShortReal& DY, Standard_ShortReal& DZ);
161 Standard_EXPORT void RatioWindow (const Graphic3d_CView& ACView);
162 Standard_EXPORT void Redraw (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Standard_Integer x = 0, const Standard_Integer y = 0, const Standard_Integer width = 0, const Standard_Integer height = 0);
163 Standard_EXPORT void RemoveView (const Graphic3d_CView& ACView);
164 Standard_EXPORT void SetLight (const Graphic3d_CView& ACView);
165 Standard_EXPORT void SetPlane (const Graphic3d_CView& ACView);
166 Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView);
167 Standard_EXPORT void TransformStructure (const Graphic3d_CStructure& ACStructure);
168 Standard_EXPORT void DegenerateStructure (const Graphic3d_CStructure& ACStructure);
169 Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
170 Standard_EXPORT void Update (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer);
171 Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView);
172 Standard_EXPORT void ViewMapping (const Graphic3d_CView& ACView, const Standard_Boolean AWait);
173 Standard_EXPORT void ViewOrientation (const Graphic3d_CView& ACView,const Standard_Boolean AWait);
174 Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
175 Standard_EXPORT void Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex& APoint, const Standard_Boolean EvalMinMax = Standard_True);
176 Standard_EXPORT void MarkerSet (const Graphic3d_CGroup& ACGroup, const Graphic3d_Array1OfVertex& ListVertex, const Standard_Boolean EvalMinMax = Standard_True);
177 Standard_EXPORT void Polygon (const Graphic3d_CGroup& ACGroup, const Graphic3d_Array1OfVertex& ListVertex, const Graphic3d_TypeOfPolygon AType = Graphic3d_TOP_CONVEX, const Standard_Boolean EvalMinMax = Standard_True);
2166f0fa
SK
178 Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
179 Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
180 Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
181 Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
2166f0fa
SK
182 Standard_EXPORT void PrimitiveArray (const Graphic3d_CGroup& ACGroup,const Graphic3d_PrimitiveArray& parray,const Standard_Boolean EvalMinMax = Standard_True);
183 Standard_EXPORT void UserDraw (const Graphic3d_CGroup& ACGroup,const Graphic3d_CUserDraw& AUserDraw);
184 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);
185 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);
186 Standard_EXPORT void TriedronErase (const Graphic3d_CView& ACView);
187 Standard_EXPORT void TriedronEcho (const Graphic3d_CView& ACView, const Aspect_TypeOfTriedronEcho AType = Aspect_TOTE_NONE);
188 Standard_EXPORT void GraduatedTrihedronDisplay (const Graphic3d_CView& view, const Graphic3d_CGraduatedTrihedron& cubic);
189 Standard_EXPORT void GraduatedTrihedronErase (const Graphic3d_CView& view);
190 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);
191 Standard_EXPORT void BeginAnimation (const Graphic3d_CView& ACView);
192 Standard_EXPORT void EndAnimation (const Graphic3d_CView& ACView);
193 Standard_EXPORT Standard_Boolean BeginAddMode (const Graphic3d_CView& ACView);
194 Standard_EXPORT void EndAddMode ();
195 Standard_EXPORT Standard_Boolean BeginImmediatMode(const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Standard_Boolean DoubleBuffer, const Standard_Boolean RetainMode);
196 Standard_EXPORT void BeginPolyline ();
197 Standard_EXPORT void ClearImmediatMode (const Graphic3d_CView& ACView,const Standard_Boolean aFlush = Standard_True);
198 Standard_EXPORT void Draw (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z);
199 Standard_EXPORT void DrawStructure (const Graphic3d_CStructure& ACStructure);
200 Standard_EXPORT void EndImmediatMode (const Standard_Integer Synchronize);
201 Standard_EXPORT void EndPolyline ();
202 Standard_EXPORT void Move (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z);
203 Standard_EXPORT void SetLineColor (const Standard_ShortReal R, const Standard_ShortReal G, const Standard_ShortReal B);
204 Standard_EXPORT void SetLineType (const Standard_Integer Type);
205 Standard_EXPORT void SetLineWidth (const Standard_ShortReal Width);
206 Standard_EXPORT void SetMinMax (const Standard_ShortReal X1, const Standard_ShortReal Y1, const Standard_ShortReal Z1, const Standard_ShortReal X2, const Standard_ShortReal Y2, const Standard_ShortReal Z2);
207 Standard_EXPORT void Transform (const TColStd_Array2OfReal& AMatrix, const Graphic3d_TypeOfComposition AType);
208 Standard_EXPORT void Layer (Aspect_CLayer2d& ACLayer);
209 Standard_EXPORT void RemoveLayer (const Aspect_CLayer2d& ACLayer);
210 Standard_EXPORT void BeginLayer (const Aspect_CLayer2d& ACLayer);
211 Standard_EXPORT void BeginPolygon2d ();
212 Standard_EXPORT void BeginPolyline2d ();
213 Standard_EXPORT void ClearLayer (const Aspect_CLayer2d& ACLayer);
214 Standard_EXPORT void Draw (const Standard_ShortReal X,const Standard_ShortReal Y);
215 Standard_EXPORT void Edge (const Standard_ShortReal X,const Standard_ShortReal Y);
216 Standard_EXPORT void EndLayer ();
217 Standard_EXPORT void EndPolygon2d ();
218 Standard_EXPORT void EndPolyline2d ();
219 Standard_EXPORT void Move (const Standard_ShortReal X,const Standard_ShortReal Y);
220 Standard_EXPORT void Rectangle (const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal Width,const Standard_ShortReal Height);
221 Standard_EXPORT void SetColor (const Standard_ShortReal R,const Standard_ShortReal G,const Standard_ShortReal B);
222 Standard_EXPORT void SetTransparency (const Standard_ShortReal ATransparency);
223 Standard_EXPORT void UnsetTransparency ();
224 Standard_EXPORT void SetLineAttributes (const Standard_Integer Type,const Standard_ShortReal Width);
25289ec1 225
226 //! Set text attributes for under-/overlayer. <br>
227 //! <Font> argument defines the name of the font to be used, <br>
228 //! <Type> argument defines the display type of the text, <br>
229 //! <R> <G> <B> values define the color of decal or subtitle background. <br>
230 //! To set the color of the text you can use the SetColor method. <br>
2166f0fa
SK
231 Standard_EXPORT void SetTextAttributes (const Standard_CString FontName,const Standard_Integer Type,const Standard_ShortReal R,const Standard_ShortReal G,const Standard_ShortReal B);
232 Standard_EXPORT void Text (const Standard_CString AText,const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal AHeight);
233 Standard_EXPORT void TextSize (const Standard_CString AText,const Standard_ShortReal AHeight,Standard_ShortReal& AWidth,Standard_ShortReal& AnAscent,Standard_ShortReal& ADescent) const;
234 Standard_EXPORT void SetBackFacingModel (const Graphic3d_CView& aView);
235 //! print the contents of all layers of the view to the printer. <br>
236 //! <hPrnDC> : Pass the PrinterDeviceContext (HDC), <br>
237 //! <showBackground> : When set to FALSE then print the view without background color <br>
238 //! (background is white) <br>
239 //! else set to TRUE for printing with current background color. <br>
240 //! <filename>: If != NULL, then the view will be printed to a file. <br>
241 //! <printAlgorithm>: Select print algorithm: stretch, tile. <br>
242 //! <theScaleFactor>: Scaling coefficient, used internally to scale the <br>
243 //! printings accordingly to the scale factor selected in the printer <br>
244 //! properties dialog. <br>
245 //! Returns Standard_True if the data is passed to the printer, otherwise <br>
246 //! Standard_False if the print operation failed due to the printer errors, <br>
247 //! or lack of system memory. This might be related to insufficient memory <br>
248 //! or some internal errors. All this errors are indicated by the message <br>
249 //! boxes (on level of OpenGl_GraphicDriver). <br>
250 //! Warning: This function can reuse FBO assigned to the view <br>
251 //! Please take it into account if you use it for your purposes; <br>
252 Standard_EXPORT Standard_Boolean Print (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Aspect_Handle hPrnDC, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm = Aspect_PA_STRETCH, const Standard_Real theScaleFactor = 1.0) const;
253 Standard_EXPORT void SetDepthTestEnabled (const Graphic3d_CView& view,const Standard_Boolean isEnabled) const;
254 Standard_EXPORT Standard_Boolean IsDepthTestEnabled (const Graphic3d_CView& view) const;
255 //! Reads depths of shown pixels of the given rectangle (glReadPixels with GL_DEPTH_COMPONENT) <br>
256 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;
257 //! Generate offscreen FBO (needs OpenGL2+ hardware) <br>
258 //! If not supported on hardware returns NULL. <br>
259 Standard_EXPORT Graphic3d_PtrFrameBuffer FBOCreate (const Graphic3d_CView& view, const Standard_Integer width, const Standard_Integer height);
260 //! Remove offscreen FBO <br>
261 Standard_EXPORT void FBORelease (const Graphic3d_CView& view, Graphic3d_PtrFrameBuffer& fboPtr);
262 //! Dump active rendering buffer into specified memory buffer. <br>
263 Standard_EXPORT Standard_Boolean BufferDump (const Graphic3d_CView& view, Image_CRawBufferData& buffer);
264 Standard_EXPORT void SetGLLightEnabled (const Graphic3d_CView& view,const Standard_Boolean isEnabled) const;
265 Standard_EXPORT Standard_Boolean IsGLLightEnabled (const Graphic3d_CView& view) const;
266 //! Clear visualization data in graphical driver and stop <br>
267 //! displaying the primitives array of the graphical group <theCGroup>. <br>
268 //! This method is internal and should be used by Graphic3d_Group only. <br>
269 Standard_EXPORT void RemovePrimitiveArray(const Graphic3d_CGroup& theCGroup,const Graphic3d_PrimitiveArray& thePArray);
270 Standard_EXPORT Standard_Integer InquirePlaneLimit();
271 Standard_EXPORT Standard_Integer CreateTexture(const Graphic3d_TypeOfTexture Type,const Handle(AlienImage_AlienImage)& Image,const Standard_CString FileName,const Handle(TColStd_HArray1OfReal)& TexUpperBounds) const;
272 Standard_EXPORT void DestroyTexture(const Standard_Integer TexId) const;
273 Standard_EXPORT void ModifyTexture(const Standard_Integer TexId,const Graphic3d_CInitTexture& AValue) const;
274 Standard_EXPORT Standard_ShortReal DefaultTextHeight() const;
275 Standard_EXPORT void FBOGetDimensions(const Graphic3d_CView& view,const Graphic3d_PtrFrameBuffer fboPtr,Standard_Integer& width,Standard_Integer& height,Standard_Integer& widthMax,Standard_Integer& heightMax);
276 Standard_EXPORT void FBOChangeViewport(const Graphic3d_CView& view,Graphic3d_PtrFrameBuffer& fboPtr,const Standard_Integer width,const Standard_Integer height);
277 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);
59f45b7c 278
279 //! Add a new top-level z layer with ID <theLayerId> for <br>
280 //! the view. Z layers allow drawing structures in higher layers <br>
281 //! in foreground of structures in lower layers. To add a structure <br>
282 //! to desired layer on display it is necessary to set the layer <br>
283 //! index for the structure. <br>
284 Standard_EXPORT void AddZLayer(const Graphic3d_CView& theCView,
285 const Standard_Integer theLayerId);
286
287 //! Remove Z layer from the specified view. All structures <br>
288 //! displayed at the moment in layer will be displayed in default layer <br>
289 //! ( the bottom-level z layer ). To unset layer index from associated <br>
290 //! structures use method UnsetZLayer (...). <br>
291 Standard_EXPORT void RemoveZLayer(const Graphic3d_CView& theCView,
292 const Standard_Integer theLayerId);
293
294 //! Unset Z layer ID for all structures. The structure <br>
295 //! indexes will be set to default layer ( the bottom-level z layer with <br>
296 //! ID = 0 ). <br>
297 Standard_EXPORT void UnsetZLayer(const Standard_Integer theLayerId);
298
299 //! Change Z layer of a structure. The new z layer ID will <br>
300 //! be used to define the associated layer for structure on display. <br>
301 //! It is recommended to take care of redisplaying the structures already <br>
302 //! presented in view with previously set layer index. This is usually <br>
303 //! done by viewer manager. Z layers allow drawing structures in <br>
304 //! higher layers in foreground of structures in lower layers. <br>
305 Standard_EXPORT void ChangeZLayer(const Graphic3d_CStructure& theCStructure,
306 const Standard_Integer theLayerId);
307
308 //! Change Z layer of a structure already presented in view. <br>
309 //! It is recommended to update z layer of already <br>
310 //! displayed structures with this method before setting new z layer <br>
311 //! index to the structure. This is usually done by viewer manager. <br>
312 Standard_EXPORT void ChangeZLayer(const Graphic3d_CStructure& theCStructure,
313 const Graphic3d_CView& theCView,
314 const Standard_Integer theNewLayerId);
315
316 //! Get Z layer ID of the structure. If the structure doesn't exists in <br>
317 //! graphic driver, the method returns -1. <br>
318 Standard_EXPORT Standard_Integer GetZLayer(const Graphic3d_CStructure& theCStructure) const;
2166f0fa
SK
319
320public:
321
322 //! Returns true if VBO usage does not forbidden.
323 Standard_EXPORT static Standard_Boolean ToUseVBO();
324
325 //! VBO usage can be forbidden by this method even if it is supported by GL driver.
326 //! Notice that disabling of VBO will cause rendering performance degradation.
327 //! Warning! This method should be called only before any primitives are displayed in GL scene!
328 Standard_EXPORT void EnableVBO (const Standard_Boolean theToTurnOn);
329
330private:
331
332 //! Access the global map of views.
333 static NCollection_DataMap<Standard_Integer, Handle(OpenGl_View)>& GetMapOfViews();
334
335 //! Access the global map of workspaces.
336 static NCollection_DataMap<Standard_Integer, Handle(OpenGl_Workspace)>& GetMapOfWorkspaces();
337
338 //! Access the global map of structures.
339 static NCollection_DataMap<Standard_Integer, OpenGl_Structure*>& GetMapOfStructures();
340
298f9ad7 341 //! Deprecated.
2166f0fa
SK
342 static void InvalidateAllWorkspaces();
343
344public:
345
346 DEFINE_STANDARD_RTTI(OpenGl_GraphicDriver)
347};
348
349#endif //_OpenGl_GraphicDriver_HeaderFile