1 // Created on: 2011-09-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <OpenGl_View.hxx>
18 #include <Aspect_RenderingContext.hxx>
19 #include <Aspect_Window.hxx>
20 #include <Graphic3d_AspectFillArea3d.hxx>
21 #include <Graphic3d_Texture2Dmanual.hxx>
22 #include <Graphic3d_TextureEnv.hxx>
23 #include <Graphic3d_Mat4d.hxx>
24 #include <NCollection_Mat4.hxx>
25 #include <OpenGl_Context.hxx>
26 #include <OpenGl_FrameBuffer.hxx>
27 #include <OpenGl_GlCore11.hxx>
28 #include <OpenGl_GraduatedTrihedron.hxx>
29 #include <OpenGl_GraphicDriver.hxx>
30 #include <OpenGl_ShaderManager.hxx>
31 #include <OpenGl_Texture.hxx>
32 #include <OpenGl_Trihedron.hxx>
33 #include <OpenGl_Window.hxx>
34 #include <OpenGl_Workspace.hxx>
35 #include <Standard_CLocaleSentry.hxx>
37 IMPLEMENT_STANDARD_RTTIEXT(OpenGl_View,Graphic3d_CView)
43 /*----------------------------------------------------------------------*/
47 static const OPENGL_ZCLIP myDefaultZClip = { { Standard_False, 0.F }, { Standard_False, 1.F } };
48 static const OPENGL_FOG myDefaultFog = { Standard_False, 0.F, 1.F, { { 0.F, 0.F, 0.F, 1.F } } };
49 static const TEL_COLOUR myDefaultBg = { { 0.F, 0.F, 0.F, 1.F } };
52 // =======================================================================
53 // function : Constructor
55 // =======================================================================
56 OpenGl_View::OpenGl_View (const Handle(Graphic3d_StructureManager)& theMgr,
57 const Handle(OpenGl_GraphicDriver)& theDriver,
58 const Handle(OpenGl_Caps)& theCaps,
59 Standard_Boolean& theDeviceLostFlag,
60 OpenGl_StateCounter* theCounter)
61 : Graphic3d_CView (theMgr),
62 myDriver (theDriver.operator->()),
64 myDeviceLostFlag (theDeviceLostFlag),
65 myWasRedrawnGL (Standard_False),
66 myAntiAliasing (Standard_False),
67 myCulling (Standard_True),
68 myShadingModel (Graphic3d_TOSM_FACET),
69 mySurfaceDetail (Graphic3d_TOD_ALL),
70 myBackfacing (Graphic3d_TOBM_AUTOMATIC),
71 myBgColor (myDefaultBg),
73 myZClip (myDefaultZClip),
74 myCamera (new Graphic3d_Camera()),
75 myUseGLLight (Standard_True),
76 myToShowTrihedron (false),
77 myToShowGradTrihedron (false),
78 myStateCounter (theCounter),
79 myLastLightSourceState (0, 0),
80 myFboColorFormat (GL_RGBA8),
81 myFboDepthFormat (GL_DEPTH24_STENCIL8),
82 myToFlipOutput (Standard_False),
84 myHasFboBlit (Standard_True),
85 myTransientDrawToFront (Standard_True),
86 myBackBufferRestored (Standard_False),
87 myIsImmediateDrawn (Standard_False),
88 myTextureParams (new OpenGl_AspectFace()),
89 myBgGradientArray (new OpenGl_BackgroundArray (Graphic3d_TOB_GRADIENT)),
90 myBgTextureArray (new OpenGl_BackgroundArray (Graphic3d_TOB_TEXTURE)),
91 // ray-tracing fields initialization
92 myRaytraceInitStatus (OpenGl_RT_NONE),
93 myIsRaytraceDataValid (Standard_False),
94 myIsRaytraceWarnTextures (Standard_False),
95 myToUpdateEnvironmentMap (Standard_False),
98 myWorkspace = new OpenGl_Workspace (this, NULL);
101 const char* anAaEnv = ::getenv ("CALL_OPENGL_ANTIALIASING_MODE");
105 if (sscanf (anAaEnv, "%d", &v) > 0) myAntiAliasing = v;
108 myCurrLightSourceState = myStateCounter->Increment();
109 myMainSceneFbos[0] = new OpenGl_FrameBuffer();
110 myMainSceneFbos[1] = new OpenGl_FrameBuffer();
111 myImmediateSceneFbos[0] = new OpenGl_FrameBuffer();
112 myImmediateSceneFbos[1] = new OpenGl_FrameBuffer();
113 myOpenGlFBO = new OpenGl_FrameBuffer();
114 myOpenGlFBO2 = new OpenGl_FrameBuffer();
115 myRaytraceFBO1[0] = new OpenGl_FrameBuffer();
116 myRaytraceFBO1[1] = new OpenGl_FrameBuffer();
117 myRaytraceFBO2[0] = new OpenGl_FrameBuffer();
118 myRaytraceFBO2[1] = new OpenGl_FrameBuffer();
121 // =======================================================================
122 // function : Destructor
124 // =======================================================================
125 OpenGl_View::~OpenGl_View()
127 ReleaseGlResources (NULL); // ensure ReleaseGlResources() was called within valid context
128 OpenGl_Element::Destroy (NULL, myBgGradientArray);
129 OpenGl_Element::Destroy (NULL, myBgTextureArray);
130 OpenGl_Element::Destroy (NULL, myTextureParams);
133 // =======================================================================
134 // function : ReleaseGlResources
136 // =======================================================================
137 void OpenGl_View::ReleaseGlResources (const Handle(OpenGl_Context)& theCtx)
139 myTrihedron .Release (theCtx.operator->());
140 myGraduatedTrihedron.Release (theCtx.operator->());
142 if (!myTextureEnv.IsNull())
144 theCtx->DelayedRelease (myTextureEnv);
145 myTextureEnv.Nullify();
148 if (myTextureParams != NULL)
150 myTextureParams->Release (theCtx.operator->());
152 if (myBgGradientArray != NULL)
154 myBgGradientArray->Release (theCtx.operator->());
156 if (myBgTextureArray != NULL)
158 myBgTextureArray->Release (theCtx.operator->());
161 myMainSceneFbos[0] ->Release (theCtx.operator->());
162 myMainSceneFbos[1] ->Release (theCtx.operator->());
163 myImmediateSceneFbos[0]->Release (theCtx.operator->());
164 myImmediateSceneFbos[1]->Release (theCtx.operator->());
165 myOpenGlFBO ->Release (theCtx.operator->());
166 myOpenGlFBO2 ->Release (theCtx.operator->());
167 myFullScreenQuad .Release (theCtx.operator->());
168 myFullScreenQuadFlip .Release (theCtx.operator->());
170 releaseRaytraceResources (theCtx);
173 // =======================================================================
176 // =======================================================================
177 void OpenGl_View::Remove()
184 myDriver->RemoveView (this);
187 Graphic3d_CView::Remove();
190 // =======================================================================
191 // function : SetTextureEnv
193 // =======================================================================
194 void OpenGl_View::SetTextureEnv (const Handle(Graphic3d_TextureEnv)& theTextureEnv)
196 Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
197 if (!aCtx.IsNull() && !myTextureEnv.IsNull())
199 aCtx->DelayedRelease (myTextureEnv);
202 myToUpdateEnvironmentMap = Standard_True;
203 myTextureEnvData = theTextureEnv;
204 myTextureEnv.Nullify();
205 initTextureEnv (aCtx);
208 // =======================================================================
209 // function : initTextureEnv
211 // =======================================================================
212 void OpenGl_View::initTextureEnv (const Handle(OpenGl_Context)& theContext)
214 if (myTextureEnvData.IsNull()
215 || theContext.IsNull()
216 || !theContext->MakeCurrent())
221 myTextureEnv = new OpenGl_Texture (myTextureEnvData->GetParams());
222 Handle(Image_PixMap) anImage = myTextureEnvData->GetImage();
223 if (!anImage.IsNull())
225 myTextureEnv->Init (theContext, *anImage.operator->(), myTextureEnvData->Type());
229 // =======================================================================
230 // function : SetImmediateModeDrawToFront
232 // =======================================================================
233 Standard_Boolean OpenGl_View::SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer)
235 const Standard_Boolean aPrevMode = myTransientDrawToFront;
236 myTransientDrawToFront = theDrawToFrontBuffer;
240 // =======================================================================
241 // function : SetWindow
243 // =======================================================================
244 void OpenGl_View::SetWindow (const Handle(Aspect_Window)& theWindow,
245 const Aspect_RenderingContext theContext)
247 myWindow = myDriver->CreateRenderWindow (theWindow, theContext);
248 Standard_ASSERT_RAISE (!myWindow.IsNull(),
249 "OpenGl_View::SetWindow, "
250 "Failed to create OpenGl window.");
252 myWorkspace = new OpenGl_Workspace (this, myWindow);
253 myWorldViewProjState.Reset();
254 myToUpdateEnvironmentMap = Standard_True;
255 myHasFboBlit = Standard_True;
258 // Environment texture resource does not support lazy initialization.
259 initTextureEnv (myWorkspace->GetGlContext());
262 // =======================================================================
263 // function : Resized
265 // =======================================================================
266 void OpenGl_View::Resized()
268 if (myWindow.IsNull())
274 // =======================================================================
275 // function : TriedronDisplay
277 // =======================================================================
278 void OpenGl_View::TriedronDisplay (const Aspect_TypeOfTriedronPosition thePosition,
279 const Quantity_NameOfColor theColor,
280 const Standard_Real theScale,
281 const Standard_Boolean theAsWireframe)
283 myToShowTrihedron = true;
284 myTrihedron.SetWireframe (theAsWireframe);
285 myTrihedron.SetPosition (thePosition);
286 myTrihedron.SetScale (theScale);
287 myTrihedron.SetLabelsColor (theColor);
290 // =======================================================================
291 // function : TriedronErase
293 // =======================================================================
294 void OpenGl_View::TriedronErase()
296 myToShowTrihedron = false;
297 myTrihedron.Release (myWorkspace->GetGlContext().operator->());
300 // =======================================================================
301 // function : ZBufferTriedronSetup
303 // =======================================================================
304 void OpenGl_View::ZBufferTriedronSetup (const Quantity_NameOfColor theXColor,
305 const Quantity_NameOfColor theYColor,
306 const Quantity_NameOfColor theZColor,
307 const Standard_Real theSizeRatio,
308 const Standard_Real theAxisDiametr,
309 const Standard_Integer theNbFacettes)
311 myTrihedron.SetArrowsColors (theXColor, theYColor, theZColor);
312 myTrihedron.SetSizeRatio (theSizeRatio);
313 myTrihedron.SetNbFacets (theNbFacettes);
314 myTrihedron.SetArrowDiameter (theAxisDiametr);
317 // =======================================================================
318 // function : TriedronEcho
320 // =======================================================================
321 void OpenGl_View::TriedronEcho (const Aspect_TypeOfTriedronEcho /*theType*/)
326 // =======================================================================
327 // function : SetMinMaxValuesCallback
329 // =======================================================================
330 static void SetMinMaxValuesCallback (Graphic3d_CView* theView)
332 OpenGl_View* aView = dynamic_cast<OpenGl_View*>(theView);
336 Bnd_Box aBox = theView->MinMaxValues();
339 gp_Pnt aMin = aBox.CornerMin();
340 gp_Pnt aMax = aBox.CornerMax();
342 Graphic3d_Vec3 aMinVec ((Standard_ShortReal )aMin.X(), (Standard_ShortReal )aMin.Y(), (Standard_ShortReal )aMin.Z());
343 Graphic3d_Vec3 aMaxVec ((Standard_ShortReal )aMax.X(), (Standard_ShortReal )aMax.Y(), (Standard_ShortReal )aMax.Z());
344 aView->GraduatedTrihedronMinMaxValues (aMinVec, aMaxVec);
348 // =======================================================================
349 // function : GraduatedTrihedronDisplay
351 // =======================================================================
352 void OpenGl_View::GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData)
354 myGTrihedronData = theTrihedronData;
355 myGTrihedronData.PtrView = this;
356 myGTrihedronData.CubicAxesCallback = SetMinMaxValuesCallback;
357 myGraduatedTrihedron.SetValues (myGTrihedronData);
358 myToShowGradTrihedron = true;
361 // =======================================================================
362 // function : GraduatedTrihedronErase
364 // =======================================================================
365 void OpenGl_View::GraduatedTrihedronErase()
367 myGTrihedronData.PtrView = NULL;
368 myGraduatedTrihedron.Release (myWorkspace->GetGlContext().operator->());
369 myToShowGradTrihedron = false;
372 // =======================================================================
373 // function : GraduatedTrihedronMinMaxValues
375 // =======================================================================
376 void OpenGl_View::GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax)
378 myGraduatedTrihedron.SetMinMax (theMin, theMax);
381 // =======================================================================
382 // function : BufferDump
384 // =======================================================================
385 Standard_Boolean OpenGl_View::BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType)
387 return myWorkspace->BufferDump (myFBO, theImage, theBufferType);
390 // =======================================================================
391 // function : Background
393 // =======================================================================
394 Aspect_Background OpenGl_View::Background() const
396 return Aspect_Background (Quantity_Color (myBgColor.rgb[0], myBgColor.rgb[1], myBgColor.rgb[2], Quantity_TOC_RGB));
399 // =======================================================================
400 // function : SetBackground
402 // =======================================================================
403 void OpenGl_View::SetBackground (const Aspect_Background& theBackground)
405 Quantity_Color aBgColor = theBackground.Color();
406 myBgColor.rgb[0] = static_cast<float> (aBgColor.Red());
407 myBgColor.rgb[1] = static_cast<float> (aBgColor.Green());
408 myBgColor.rgb[2] = static_cast<float> (aBgColor.Blue());
409 myFog.Color = myBgColor;
412 // =======================================================================
413 // function : GradientBackground
415 // =======================================================================
416 Aspect_GradientBackground OpenGl_View::GradientBackground() const
418 Quantity_Color aColor1, aColor2;
419 aColor1.SetValues (myBgGradientArray->GradientColor (0).r(),
420 myBgGradientArray->GradientColor (0).g(),
421 myBgGradientArray->GradientColor (0).b(), Quantity_TOC_RGB);
422 aColor2.SetValues (myBgGradientArray->GradientColor (1).r(),
423 myBgGradientArray->GradientColor (1).g(),
424 myBgGradientArray->GradientColor (1).b(), Quantity_TOC_RGB);
425 return Aspect_GradientBackground (aColor1, aColor2, myBgGradientArray->GradientFillMethod());
428 // =======================================================================
429 // function : SetGradientBackground
431 // =======================================================================
432 void OpenGl_View::SetGradientBackground (const Aspect_GradientBackground& theBackground)
434 Quantity_Color aColor1, aColor2;
435 theBackground.Colors (aColor1, aColor2);
436 myBgGradientArray->SetGradientParameters (aColor1, aColor2, theBackground.BgGradientFillMethod());
439 // =======================================================================
440 // function : SetBackgroundImage
442 // =======================================================================
443 void OpenGl_View::SetBackgroundImage (const TCollection_AsciiString& theFilePath)
445 // Prepare aspect for texture storage
446 myBackgroundImagePath = theFilePath;
447 Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
448 Handle(Graphic3d_Texture2Dmanual) aTextureMap = new Graphic3d_Texture2Dmanual (TCollection_AsciiString (theFilePath));
449 aTextureMap->EnableRepeat();
450 aTextureMap->DisableModulate();
451 aTextureMap->GetParams()->SetGenMode (Graphic3d_TOTM_MANUAL,
452 Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 0.0f),
453 Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 0.0f));
454 anAspect->SetTextureMap (aTextureMap);
455 anAspect->SetInteriorStyle (Aspect_IS_SOLID);
456 // Enable texture mapping
457 if (aTextureMap->IsDone())
459 anAspect->SetTextureMapOn();
463 anAspect->SetTextureMapOff();
467 // Set texture parameters
468 myTextureParams->SetAspect (anAspect);
471 // =======================================================================
472 // function : BackgroundImageStyle
474 // =======================================================================
475 Aspect_FillMethod OpenGl_View::BackgroundImageStyle() const
477 return myBgTextureArray->TextureFillMethod();
480 // =======================================================================
481 // function : SetBackgroundImageStyle
483 // =======================================================================
484 void OpenGl_View::SetBackgroundImageStyle (const Aspect_FillMethod theFillStyle)
486 myBgTextureArray->SetTextureFillMethod (theFillStyle);
489 //=======================================================================
490 //function : AddZLayer
492 //=======================================================================
493 void OpenGl_View::AddZLayer (const Graphic3d_ZLayerId theLayerId)
495 myZLayers.AddLayer (theLayerId);
498 //=======================================================================
499 //function : RemoveZLayer
501 //=======================================================================
502 void OpenGl_View::RemoveZLayer (const Graphic3d_ZLayerId theLayerId)
504 myZLayers.RemoveLayer (theLayerId);
507 //=======================================================================
508 //function : SetZLayerSettings
510 //=======================================================================
511 void OpenGl_View::SetZLayerSettings (const Graphic3d_ZLayerId theLayerId,
512 const Graphic3d_ZLayerSettings& theSettings)
514 myZLayers.SetLayerSettings (theLayerId, theSettings);
517 //=======================================================================
520 //=======================================================================
521 Handle(Standard_Transient) OpenGl_View::FBO() const
523 return Handle(Standard_Transient)(myFBO);
526 //=======================================================================
529 //=======================================================================
530 void OpenGl_View::SetFBO (const Handle(Standard_Transient)& theFbo)
532 myFBO = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
535 //=======================================================================
536 //function : FBOCreate
538 //=======================================================================
539 Handle(Standard_Transient) OpenGl_View::FBOCreate (const Standard_Integer theWidth,
540 const Standard_Integer theHeight)
542 return myWorkspace->FBOCreate (theWidth, theHeight);
545 //=======================================================================
546 //function : FBORelease
548 //=======================================================================
549 void OpenGl_View::FBORelease (Handle(Standard_Transient)& theFbo)
551 Handle(OpenGl_FrameBuffer) aFrameBuffer = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
552 if (aFrameBuffer.IsNull())
557 myWorkspace->FBORelease (aFrameBuffer);
561 //=======================================================================
562 //function : FBOGetDimensions
564 //=======================================================================
565 void OpenGl_View::FBOGetDimensions (const Handle(Standard_Transient)& theFbo,
566 Standard_Integer& theWidth,
567 Standard_Integer& theHeight,
568 Standard_Integer& theWidthMax,
569 Standard_Integer& theHeightMax)
571 const Handle(OpenGl_FrameBuffer) aFrameBuffer = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
572 if (aFrameBuffer.IsNull())
577 theWidth = aFrameBuffer->GetVPSizeX(); // current viewport size
578 theHeight = aFrameBuffer->GetVPSizeY();
579 theWidthMax = aFrameBuffer->GetSizeX(); // texture size
580 theHeightMax = aFrameBuffer->GetSizeY();
583 //=======================================================================
584 //function : FBOChangeViewport
586 //=======================================================================
587 void OpenGl_View::FBOChangeViewport (const Handle(Standard_Transient)& theFbo,
588 const Standard_Integer theWidth,
589 const Standard_Integer theHeight)
591 const Handle(OpenGl_FrameBuffer) aFrameBuffer = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
592 if (aFrameBuffer.IsNull())
597 aFrameBuffer->ChangeViewport (theWidth, theHeight);
600 // =======================================================================
603 // =======================================================================
605 Standard_Boolean OpenGl_View::Export (const Standard_CString theFileName,
606 const Graphic3d_ExportFormat theFormat,
607 const Graphic3d_SortType theSortType)
609 // gl2psBeginPage() will call OpenGL functions
610 // so we should activate correct GL context before redraw scene call
611 if (!myWorkspace->Activate())
613 return Standard_False;
616 Standard_Integer aFormat = -1;
617 Standard_Integer aSortType = Graphic3d_ST_BSP_Tree;
620 case Graphic3d_EF_PostScript:
623 case Graphic3d_EF_EnhPostScript:
626 case Graphic3d_EF_TEX:
629 case Graphic3d_EF_PDF:
632 case Graphic3d_EF_SVG:
635 case Graphic3d_EF_PGF:
638 case Graphic3d_EF_EMF:
639 //aFormat = GL2PS_EMF;
640 aFormat = GL2PS_PGF + 1; // 6
643 // unsupported format
644 return Standard_False;
649 case Graphic3d_ST_Simple:
650 aSortType = GL2PS_SIMPLE_SORT;
652 case Graphic3d_ST_BSP_Tree:
653 aSortType = GL2PS_BSP_SORT;
660 aViewport[2] = myWindow->Width();
661 aViewport[3] = myWindow->Height();
663 GLint aBufferSize = 1024 * 1024;
664 GLint anErrCode = GL2PS_SUCCESS;
666 // gl2ps uses standard write functions and do not check locale
667 Standard_CLocaleSentry aLocaleSentry;
669 while (aBufferSize > 0)
671 // current patch for EMF support in gl2ps uses WinAPI functions to create file
672 FILE* aFileH = (theFormat != Graphic3d_EF_EMF) ? fopen (theFileName, "wb") : NULL;
673 anErrCode = gl2psBeginPage ("", "", aViewport, aFormat, aSortType,
674 GL2PS_DRAW_BACKGROUND | GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT/* | GL2PS_SIMPLE_LINE_OFFSET*/,
676 0, 0, 0, aBufferSize, aFileH, theFileName);
677 if (anErrCode != GL2PS_SUCCESS)
679 // initialization failed
686 anErrCode = gl2psEndPage();
690 if (anErrCode == GL2PS_OVERFLOW)
695 return anErrCode == GL2PS_SUCCESS;
698 Standard_Boolean OpenGl_View::Export (const Standard_CString /*theFileName*/,
699 const Graphic3d_ExportFormat /*theFormat*/,
700 const Graphic3d_SortType /*theSortType*/)
702 return Standard_False;
706 //=======================================================================
707 //function : displayStructure
709 //=======================================================================
710 void OpenGl_View::displayStructure (const Handle(Graphic3d_CStructure)& theStructure,
711 const Standard_Integer thePriority)
713 const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
714 const Graphic3d_ZLayerId aZLayer = aStruct->ZLayer();
715 myZLayers.AddStructure (aStruct, aZLayer, thePriority);
718 //=======================================================================
719 //function : eraseStructure
721 //=======================================================================
722 void OpenGl_View::eraseStructure (const Handle(Graphic3d_CStructure)& theStructure)
724 const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
725 myZLayers.RemoveStructure (aStruct);
728 //=======================================================================
729 //function : changeZLayer
731 //=======================================================================
732 void OpenGl_View::changeZLayer (const Handle(Graphic3d_CStructure)& theStructure,
733 const Graphic3d_ZLayerId theNewLayerId)
735 const Graphic3d_ZLayerId anOldLayer = theStructure->ZLayer();
736 const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
737 myZLayers.ChangeLayer (aStruct, anOldLayer, theNewLayerId);
740 //=======================================================================
741 //function : changePriority
743 //=======================================================================
744 void OpenGl_View::changePriority (const Handle(Graphic3d_CStructure)& theStructure,
745 const Standard_Integer theNewPriority)
747 const Graphic3d_ZLayerId aLayerId = theStructure->ZLayer();
748 const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
749 myZLayers.ChangePriority (aStruct, aLayerId, theNewPriority);