0024058: Eliminate compiler warning C4702 in MSVC++ with warning level 4
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_7.cxx
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
20
21 #include <OpenGl_GraphicDriver.hxx>
22
23 #include <OpenGl_FrameBuffer.hxx>
24
25 #include <OpenGl_Structure.hxx>
26 #include <OpenGl_CView.hxx>
27 #include <OpenGl_Display.hxx>
28
29 /*----------------------------------------------------------------------*/
30
31 void OpenGl_GraphicDriver::ActivateView (const Graphic3d_CView& ACView)
32 {
33   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
34   if (aCView)
35     aCView->WS->SetActiveView(aCView->View);
36 }
37
38 void OpenGl_GraphicDriver::AntiAliasing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
39 {
40   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
41   if (aCView)
42     aCView->View->SetAntiAliasing(AFlag);
43 }
44
45 void OpenGl_GraphicDriver::Background (const Graphic3d_CView& ACView)
46 {
47   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
48   if (aCView)
49   {
50     aCView->WS->SetBackgroundColor(ACView.DefWindow.Background.r,ACView.DefWindow.Background.g,ACView.DefWindow.Background.b);
51   }
52 }
53
54 void OpenGl_GraphicDriver::GradientBackground (const Graphic3d_CView& ACView,
55                                               const Quantity_Color& AColor1,
56                                               const Quantity_Color& AColor2,
57                                               const Aspect_GradientFillMethod AType)
58 {
59   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
60   if (aCView)
61   {
62     aCView->View->SetBackgroundGradient(AColor1,AColor2,AType);
63   }
64 }
65
66 void OpenGl_GraphicDriver::Blink (const Graphic3d_CStructure &, const Standard_Boolean)
67 {
68   // Do nothing
69 }
70
71 void OpenGl_GraphicDriver::BoundaryBox (const Graphic3d_CStructure& theCStructure,
72                                         const Standard_Boolean      toCreate)
73 {
74   OpenGl_Structure* aStructure = (OpenGl_Structure* )theCStructure.ptrStructure;
75   if (aStructure == NULL)
76     return;
77
78   if (toCreate)
79     aStructure->SetHighlightBox (GetSharedContext(), theCStructure.BoundBox);
80   else
81     aStructure->ClearHighlightBox (GetSharedContext());
82 }
83
84 void OpenGl_GraphicDriver::HighlightColor (const Graphic3d_CStructure& theCStructure,
85                                            const Standard_ShortReal R,
86                                            const Standard_ShortReal G,
87                                            const Standard_ShortReal B,
88                                            const Standard_Boolean   toCreate)
89 {
90   OpenGl_Structure* aStructure = (OpenGl_Structure* )theCStructure.ptrStructure;
91   if (aStructure == NULL)
92     return;
93
94   if (toCreate)
95     aStructure->SetHighlightColor (GetSharedContext(), R, G, B);
96   else
97     aStructure->ClearHighlightColor (GetSharedContext());
98 }
99
100 void OpenGl_GraphicDriver::NameSetStructure (const Graphic3d_CStructure& ACStructure)
101 {
102   OpenGl_Structure *astructure = (OpenGl_Structure *)ACStructure.ptrStructure;
103   if (astructure)
104   {
105     Standard_Integer aStatus = 0;
106     if (ACStructure.highlight) aStatus |= OPENGL_NS_HIGHLIGHT;
107     if (!ACStructure.visible) aStatus |= OPENGL_NS_HIDE;
108     astructure->SetNamedStatus( aStatus );
109   }
110 }
111
112 void OpenGl_GraphicDriver::ClipLimit (const Graphic3d_CView& ACView, const Standard_Boolean AWait)
113 {
114   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
115   if (aCView)
116   {
117     aCView->View->SetClipLimit(ACView);
118     if (!AWait)
119     {
120       aCView->WS->Resize(ACView.DefWindow);
121     }
122   }
123 }
124
125 void OpenGl_GraphicDriver::DeactivateView (const Graphic3d_CView& ACView)
126 {
127   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
128   if (aCView)
129   {
130     const Handle(OpenGl_View) aDummyView;
131     aCView->WS->SetActiveView(aDummyView);
132   }
133 }
134
135 void OpenGl_GraphicDriver::DepthCueing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
136 {
137   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
138   if (aCView)
139     aCView->View->SetFog(ACView, AFlag);
140 }
141
142 Standard_Boolean OpenGl_GraphicDriver::ProjectRaster (const Graphic3d_CView& ACView, const Standard_ShortReal AX, const Standard_ShortReal AY, const Standard_ShortReal AZ, Standard_Integer& AU, Standard_Integer& AV)
143 {
144   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
145   if (!aCView)
146     return Standard_False;
147
148   Standard_Integer aWidth = aCView->WS->Width();
149   Standard_Integer aHeight = aCView->WS->Height();
150   Standard_ShortReal xr, yr;
151   if (aCView->View->ProjectObjectToRaster(aWidth, aHeight, AX, AY, AZ, xr, yr))
152   {
153     AU = (Standard_Integer) xr;
154     AV = aHeight - (Standard_Integer) yr;
155     return Standard_True;
156   }
157
158   return Standard_False;
159 }
160
161 Standard_Boolean OpenGl_GraphicDriver::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)
162 {
163   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
164   if (!aCView)
165     return Standard_False;
166
167   const Standard_Integer aWidth = aCView->WS->Width();
168   const Standard_Integer aHeight = aCView->WS->Height();
169
170   /*
171   Patched by P.Dolbey: the window pixel height decreased by one
172   in order for yr to remain within valid coordinate range [0; Ym -1]
173   where Ym means window pixel height.
174   */
175   return aCView->View->ProjectRasterToObject( aWidth, aHeight, AU, (AYM-1)-Aym-AV, Ax, Ay, Az );
176 }
177
178 Standard_Boolean OpenGl_GraphicDriver::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)
179 {
180   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
181   if (!aCView)
182     return Standard_False;
183
184   const Standard_Integer aWidth = aCView->WS->Width();
185   const Standard_Integer aHeight = aCView->WS->Height();
186
187   return aCView->View->ProjectRasterToObjectWithRay( aWidth, aHeight, AU, AYM-Aym-AV, Ax, Ay, Az, Dx, Dy, Dz );
188 }
189
190 void OpenGl_GraphicDriver::RatioWindow (const Graphic3d_CView& theCView)
191 {
192   const OpenGl_CView* aCView = (const OpenGl_CView* )theCView.ptrView;
193   if (aCView != NULL)
194     aCView->WS->Resize (theCView.DefWindow);
195 }
196
197 void OpenGl_GraphicDriver::Redraw (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height)
198 {
199   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
200   if (aCView)
201   {
202     /*if( width <= 0 || height <= 0  )
203       aCView->WS->Redraw(ACView, ACUnderLayer, ACOverLayer);
204     else
205       aCView->WS->RedrawArea(ACView, ACUnderLayer, ACOverLayer, x, y, width, height);*/
206     // Always do full redraw
207     aCView->WS->Redraw(ACView, ACUnderLayer, ACOverLayer);
208   }
209 }
210
211 Graphic3d_PtrFrameBuffer OpenGl_GraphicDriver::FBOCreate (const Graphic3d_CView& ACView, const Standard_Integer theWidth, const Standard_Integer theHeight)
212 {
213   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
214   if (aCView)
215     return aCView->WS->FBOCreate(theWidth, theHeight);
216   return (Graphic3d_PtrFrameBuffer)NULL;
217 }
218
219 Graphic3d_PtrFrameBuffer OpenGl_Workspace::FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight)
220 {
221   // activate OpenGL context
222   if (!Activate())
223     return NULL;
224
225   // create the FBO
226   OpenGl_FrameBuffer* aFrameBuffer = new OpenGl_FrameBuffer();
227   if (!aFrameBuffer->Init (GetGlContext(), theWidth, theHeight))
228   {
229     delete aFrameBuffer;
230     return NULL;
231   }
232   return (Graphic3d_PtrFrameBuffer )aFrameBuffer;
233 }
234
235 void OpenGl_GraphicDriver::FBORelease (const Graphic3d_CView& ACView, Graphic3d_PtrFrameBuffer& theFBOPtr)
236 {
237   if (theFBOPtr == NULL)
238     return;
239   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
240   if (aCView)
241   {
242     aCView->WS->FBORelease(theFBOPtr);
243     theFBOPtr = NULL;
244   }
245 }
246
247 void OpenGl_Workspace::FBORelease (Graphic3d_PtrFrameBuffer theFBOPtr)
248 {
249   // activate OpenGL context
250   if (!Activate())
251     return;
252
253   // release the object
254   OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer*)theFBOPtr;
255   aFrameBuffer->Release (GetGlContext());
256   delete aFrameBuffer;
257 }
258
259 void OpenGl_GraphicDriver::FBOGetDimensions (const Graphic3d_CView& ,
260                                              const Graphic3d_PtrFrameBuffer theFBOPtr,
261                                              Standard_Integer& theWidth,    Standard_Integer& theHeight,
262                                              Standard_Integer& theWidthMax, Standard_Integer& theHeightMax)
263 {
264   if (theFBOPtr == NULL)
265   {
266     return;
267   }
268   const OpenGl_FrameBuffer* aFrameBuffer = (const OpenGl_FrameBuffer* )theFBOPtr;
269   theWidth  = aFrameBuffer->GetVPSizeX(); // current viewport size
270   theHeight = aFrameBuffer->GetVPSizeY();
271   theWidthMax  = aFrameBuffer->GetSizeX(); // texture size
272   theHeightMax = aFrameBuffer->GetSizeY();
273 }
274
275 void OpenGl_GraphicDriver::FBOChangeViewport (const Graphic3d_CView& ,
276                                               Graphic3d_PtrFrameBuffer& theFBOPtr,
277                                               const Standard_Integer theWidth, const Standard_Integer theHeight)
278 {
279   if (theFBOPtr == NULL)
280   {
281     return;
282   }
283   OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )theFBOPtr;
284   aFrameBuffer->ChangeViewport (theWidth, theHeight);
285 }
286
287 inline bool getDataFormat (const Image_PixMap& theData,
288                            GLenum&             thePixelFormat,
289                            GLenum&             theDataType)
290 {
291   thePixelFormat = GL_RGB;
292   theDataType    = GL_UNSIGNED_BYTE;
293   switch (theData.Format())
294   {
295     case Image_PixMap::ImgGray:
296       thePixelFormat = GL_DEPTH_COMPONENT;
297       theDataType    = GL_UNSIGNED_BYTE;
298       return true;
299     case Image_PixMap::ImgRGB:
300       thePixelFormat = GL_RGB;
301       theDataType    = GL_UNSIGNED_BYTE;
302       return true;
303     case Image_PixMap::ImgBGR:
304       thePixelFormat = GL_BGR;
305       theDataType    = GL_UNSIGNED_BYTE;
306       return true;
307     case Image_PixMap::ImgRGBA:
308     case Image_PixMap::ImgRGB32:
309       thePixelFormat = GL_RGBA;
310       theDataType    = GL_UNSIGNED_BYTE;
311       return true;
312     case Image_PixMap::ImgBGRA:
313     case Image_PixMap::ImgBGR32:
314       thePixelFormat = GL_BGRA;
315       theDataType    = GL_UNSIGNED_BYTE;
316       return true;
317     case Image_PixMap::ImgGrayF:
318       thePixelFormat = GL_DEPTH_COMPONENT;
319       theDataType    = GL_FLOAT;
320       return true;
321     case Image_PixMap::ImgRGBF:
322       thePixelFormat = GL_RGB;
323       theDataType    = GL_FLOAT;
324       return true;
325     case Image_PixMap::ImgBGRF:
326       thePixelFormat = GL_BGR;
327       theDataType    = GL_FLOAT;
328       return true;
329     case Image_PixMap::ImgRGBAF:
330       thePixelFormat = GL_RGBA;
331       theDataType    = GL_FLOAT;
332       return true;
333     case Image_PixMap::ImgBGRAF:
334       thePixelFormat = GL_BGRA;
335       theDataType    = GL_FLOAT;
336       return true;
337     default:
338       return false;
339   }
340 }
341
342 Standard_Boolean OpenGl_GraphicDriver::BufferDump (const Graphic3d_CView&      theCView,
343                                                    Image_PixMap&               theImage,
344                                                    const Graphic3d_BufferType& theBufferType)
345 {
346   const OpenGl_CView* aCView = (const OpenGl_CView* )theCView.ptrView;
347   return (aCView != NULL) && aCView->WS->BufferDump ((OpenGl_FrameBuffer* )theCView.ptrFBO, theImage, theBufferType);
348 }
349
350 Standard_Boolean OpenGl_Workspace::BufferDump (OpenGl_FrameBuffer*         theFBOPtr,
351                                                Image_PixMap&               theImage,
352                                                const Graphic3d_BufferType& theBufferType)
353 {
354   GLenum aFormat, aType;
355   if (theImage.IsEmpty()
356    || !getDataFormat (theImage, aFormat, aType)
357    || ((theBufferType == Graphic3d_BT_Depth) && (aFormat != GL_DEPTH_COMPONENT))
358    || !Activate())
359   {
360     return Standard_False;
361   }
362
363   // bind FBO if used
364   GLint aReadBufferPrev = GL_BACK;
365   if (theFBOPtr != NULL && theFBOPtr->IsValid())
366   {
367     theFBOPtr->BindBuffer (GetGlContext());
368   }
369   else
370   {
371     glGetIntegerv (GL_READ_BUFFER, &aReadBufferPrev);
372     GLint aDrawBufferPrev = GL_BACK;
373     glGetIntegerv (GL_DRAW_BUFFER, &aDrawBufferPrev);
374     glReadBuffer (aDrawBufferPrev);
375   }
376
377   GLint anAlignBack = 1;
378   glGetIntegerv (GL_PACK_ALIGNMENT, &anAlignBack);
379   GLint anExtraBytes = (GLint )theImage.RowExtraBytes();
380   GLint anAligment   = Min (GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL
381   glPixelStorei (GL_PACK_ALIGNMENT, anAligment);
382
383   if (anExtraBytes >= anAligment)
384   {
385     // copy row by row
386     for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
387     {
388       glReadPixels (0, GLint(aRow), GLsizei (theImage.SizeX()), 1, aFormat, aType, theImage.ChangeRow (aRow));
389     }
390   }
391   else
392   {
393     // read pixels
394     glReadPixels (0, 0, GLsizei (theImage.SizeX()), GLsizei (theImage.SizeY()), aFormat, aType, theImage.ChangeData());
395     theImage.SetTopDown (false); // image bottom-up in OpenGL
396   }
397
398   glPixelStorei (GL_PACK_ALIGNMENT, anAlignBack);
399
400   if (theFBOPtr != NULL && theFBOPtr->IsValid())
401   {
402     theFBOPtr->UnbindBuffer (GetGlContext());
403   }
404   else
405   {
406     glReadBuffer (aReadBufferPrev);
407   }
408   return Standard_True;
409 }
410
411 void OpenGl_GraphicDriver::RemoveView (const Graphic3d_CView& theCView)
412 {
413   Handle(OpenGl_Context) aShareCtx = GetSharedContext();
414   if (myMapOfView.IsBound (theCView.ViewId))
415     myMapOfView.UnBind (theCView.ViewId);
416
417   if (myMapOfWS.IsBound (theCView.WsId))
418     myMapOfWS.UnBind (theCView.WsId);
419
420   if (myMapOfWS.IsEmpty() && !myMapOfStructure.IsEmpty())
421   {
422     // The last view removed but some objects still present.
423     // Release GL resources now without object destruction.
424     for (NCollection_DataMap<Standard_Integer, OpenGl_Structure*>::Iterator aStructIt (myMapOfStructure);
425          aStructIt.More (); aStructIt.Next())
426     {
427       OpenGl_Structure* aStruct = aStructIt.ChangeValue();
428       aStruct->ReleaseGlResources (aShareCtx);
429     }
430   }
431
432   OpenGl_CView* aCView = (OpenGl_CView* )theCView.ptrView;
433   aCView->View->ReleaseGlResources (aShareCtx);
434   delete aCView;
435   ((Graphic3d_CView *)&theCView)->ptrView = NULL;
436 }
437
438 void OpenGl_GraphicDriver::SetLight (const Graphic3d_CView& ACView)
439 {
440   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
441   if (aCView)
442     aCView->View->SetLights(ACView.Context);
443 }
444
445 void OpenGl_GraphicDriver::SetPlane (const Graphic3d_CView& ACView)
446 {
447   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
448   if (aCView)
449     aCView->View->SetClippingPlanes(ACView.Context);
450 }
451
452 void OpenGl_GraphicDriver::SetVisualisation (const Graphic3d_CView& ACView)
453 {
454   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
455   if (aCView)
456   {
457     aCView->View->SetVisualisation(ACView.Context);
458     aCView->WS->UseZBuffer() = ( ACView.Context.Visualization == 0? (ACView.Context.ZBufferActivity == 1) : (ACView.Context.ZBufferActivity != 0) );
459   }
460 }
461
462 void OpenGl_GraphicDriver::TransformStructure (const Graphic3d_CStructure& ACStructure)
463 {
464   OpenGl_Structure *astructure = (OpenGl_Structure *)ACStructure.ptrStructure;
465   if (astructure)
466     astructure->SetTransformation(&(ACStructure.Transformation[0][0]));
467 }
468
469 void OpenGl_GraphicDriver::Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
470 {
471   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
472   if (aCView)
473     aCView->WS->UseTransparency(AFlag);
474 }
475
476 void OpenGl_GraphicDriver::Update (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer)
477 {
478   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
479   if (aCView)
480     aCView->WS->Update(ACView,ACUnderLayer,ACOverLayer);
481 }
482
483 Standard_Boolean OpenGl_GraphicDriver::View (Graphic3d_CView& theCView)
484 {
485   if (openglDisplay.IsNull())
486     return Standard_False;
487
488   if (myMapOfView.IsBound (theCView.ViewId))
489     myMapOfView.UnBind (theCView.ViewId);
490
491   if (myMapOfWS.IsBound (theCView.WsId))
492     myMapOfWS.UnBind (theCView.WsId);
493
494   Handle(OpenGl_Workspace) aWS = Handle(OpenGl_Workspace)::DownCast(openglDisplay->GetWindow (theCView.DefWindow.XWindow));
495   if (aWS.IsNull())
496   {
497     Handle(OpenGl_Context) aShareCtx = GetSharedContext();
498     aWS = new OpenGl_Workspace (openglDisplay, theCView.DefWindow, theCView.GContext, aShareCtx);
499     openglDisplay->SetWindow (theCView.DefWindow.XWindow, aWS);
500   }
501
502   myMapOfWS.Bind (theCView.WsId, aWS);
503
504   Handle(OpenGl_View) aView = new OpenGl_View (theCView.Context);
505   myMapOfView.Bind (theCView.ViewId, aView);
506
507   OpenGl_CView* aCView = new OpenGl_CView();
508   aCView->View = aView;
509   aCView->WS = aWS;
510   theCView.ptrView = aCView;
511
512   return Standard_True;
513 }
514
515 void OpenGl_GraphicDriver::ViewMapping (const Graphic3d_CView& ACView, const Standard_Boolean AWait)
516 {
517   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
518   if (aCView)
519   {
520     aCView->View->SetMapping(ACView);
521     if (!AWait)
522     {
523       aCView->WS->Resize(ACView.DefWindow);
524     }
525   }
526 }
527
528 void OpenGl_GraphicDriver::ViewOrientation (const Graphic3d_CView& ACView, const Standard_Boolean AWait)
529 {
530   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
531   if (aCView)
532   {
533     aCView->View->SetOrientation(ACView);
534     if (!AWait)
535     {
536       aCView->WS->Resize(ACView.DefWindow);
537     }
538   }
539 }
540
541 void OpenGl_GraphicDriver::SetBackFacingModel (const Graphic3d_CView& ACView)
542 {
543   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
544   if (aCView)
545     aCView->View->SetBackfacing(ACView.Backfacing);
546 }
547
548 //=======================================================================
549 //function : AddZLayer
550 //purpose  :
551 //=======================================================================
552
553 void OpenGl_GraphicDriver::AddZLayer (const Graphic3d_CView& theCView,
554                                       const Standard_Integer theLayerId)
555 {
556   const OpenGl_CView *aCView = (const OpenGl_CView *)theCView.ptrView;
557   if (aCView)
558     aCView->View->AddZLayer (theLayerId);
559 }
560
561 //=======================================================================
562 //function : RemoveZLayer
563 //purpose  :
564 //=======================================================================
565
566 void OpenGl_GraphicDriver::RemoveZLayer (const Graphic3d_CView& theCView,
567                                          const Standard_Integer theLayerId)
568 {
569   const OpenGl_CView* aCView = (const OpenGl_CView *)theCView.ptrView;
570   if (aCView)
571     aCView->View->RemoveZLayer (theLayerId);
572 }