1 // Created on: 2011-08-01
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_CappingAlgo.hxx>
17 #include <OpenGl_GlCore11.hxx>
18 #include <OpenGl_ClippingIterator.hxx>
19 #include <OpenGl_ShaderManager.hxx>
20 #include <OpenGl_ShaderProgram.hxx>
21 #include <OpenGl_StructureShadow.hxx>
22 #include <OpenGl_Vec.hxx>
23 #include <OpenGl_View.hxx>
24 #include <OpenGl_Workspace.hxx>
26 IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Structure,Graphic3d_CStructure)
28 // =======================================================================
29 // function : renderBoundingBox
31 // =======================================================================
32 void OpenGl_Structure::renderBoundingBox (const Handle(OpenGl_Workspace)& theWorkspace) const
34 if (!myBndBox.IsValid())
39 const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
40 const Handle(OpenGl_TextureSet) aPrevTexture = aCtx->BindTextures (Handle(OpenGl_TextureSet)(), Handle(OpenGl_ShaderProgram)());
41 const Graphic3d_ZLayerSettings& aLayer = myGraphicDriver->ZLayerSettings (myZLayer);
42 const Graphic3d_Vec3d aMoveVec = myTrsfPers.IsNull()
43 && !aLayer.OriginTransformation().IsNull()
44 ? -Graphic3d_Vec3d (aLayer.Origin().X(), aLayer.Origin().Y(), aLayer.Origin().Z())
45 : Graphic3d_Vec3d (0.0, 0.0, 0.0);
46 if (aCtx->core20fwd != NULL
47 && aCtx->ShaderManager()->BindBoundBoxProgram())
49 const Graphic3d_Vec3d aCenter = myBndBox.Center() + aMoveVec;
50 const Graphic3d_Vec3d aSize = myBndBox.Size();
51 aCtx->ActiveProgram()->SetUniform (aCtx, "occBBoxCenter", Graphic3d_Vec3 ((float )aCenter.x(), (float )aCenter.y(), (float )aCenter.z()));
52 aCtx->ActiveProgram()->SetUniform (aCtx, "occBBoxSize", Graphic3d_Vec3 ((float )aSize.x(), (float )aSize.y(), (float )aSize.z()));
53 aCtx->SetColor4fv (theWorkspace->InteriorColor());
55 const Handle(OpenGl_VertexBuffer)& aBoundBoxVertBuffer = aCtx->ShaderManager()->BoundBoxVertBuffer();
56 aBoundBoxVertBuffer->BindAttribute (aCtx, Graphic3d_TOA_POS);
57 aCtx->core20fwd->glDrawArrays (GL_LINES, 0, aBoundBoxVertBuffer->GetElemsNb());
58 aBoundBoxVertBuffer->UnbindAttribute(aCtx, Graphic3d_TOA_POS);
60 else if (aCtx->core11ffp != NULL)
62 const Graphic3d_Vec3d aMind = myBndBox.CornerMin() + aMoveVec;
63 const Graphic3d_Vec3d aMaxd = myBndBox.CornerMax() + aMoveVec;
64 const Graphic3d_Vec3 aMin ((float )aMind.x(), (float )aMind.y(), (float )aMind.z());
65 const Graphic3d_Vec3 aMax ((float )aMaxd.x(), (float )aMaxd.y(), (float )aMaxd.z());
66 const OpenGl_Vec3 aVerts[16] =
68 OpenGl_Vec3 (aMin.x(), aMin.y(), aMin.z()),
69 OpenGl_Vec3 (aMin.x(), aMin.y(), aMax.z()),
70 OpenGl_Vec3 (aMin.x(), aMax.y(), aMax.z()),
71 OpenGl_Vec3 (aMin.x(), aMax.y(), aMin.z()),
72 OpenGl_Vec3 (aMin.x(), aMin.y(), aMin.z()),
73 OpenGl_Vec3 (aMax.x(), aMin.y(), aMin.z()),
74 OpenGl_Vec3 (aMax.x(), aMin.y(), aMax.z()),
75 OpenGl_Vec3 (aMax.x(), aMax.y(), aMax.z()),
76 OpenGl_Vec3 (aMax.x(), aMax.y(), aMin.z()),
77 OpenGl_Vec3 (aMax.x(), aMin.y(), aMin.z()),
78 OpenGl_Vec3 (aMax.x(), aMax.y(), aMin.z()),
79 OpenGl_Vec3 (aMin.x(), aMax.y(), aMin.z()),
80 OpenGl_Vec3 (aMin.x(), aMax.y(), aMax.z()),
81 OpenGl_Vec3 (aMax.x(), aMax.y(), aMax.z()),
82 OpenGl_Vec3 (aMax.x(), aMin.y(), aMax.z()),
83 OpenGl_Vec3 (aMin.x(), aMin.y(), aMax.z())
86 aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID, Graphic3d_TypeOfShadingModel_Unlit, Graphic3d_AlphaMode_Opaque, false, Handle(OpenGl_ShaderProgram)());
87 aCtx->SetColor4fv (theWorkspace->InteriorColor());
88 aCtx->core11fwd->glDisable (GL_LIGHTING);
89 aCtx->core11ffp->glEnableClientState (GL_VERTEX_ARRAY);
90 aCtx->core11ffp->glVertexPointer (3, GL_FLOAT, 0, aVerts[0].GetData());
91 aCtx->core11fwd->glDrawArrays (GL_LINE_STRIP, 0, 16);
92 aCtx->core11ffp->glDisableClientState (GL_VERTEX_ARRAY);
94 aCtx->BindTextures (aPrevTexture, Handle(OpenGl_ShaderProgram)());
97 // =======================================================================
98 // function : OpenGl_Structure
100 // =======================================================================
101 OpenGl_Structure::OpenGl_Structure (const Handle(Graphic3d_StructureManager)& theManager)
102 : Graphic3d_CStructure (theManager),
103 myInstancedStructure (NULL),
104 myIsRaytracable (Standard_False),
105 myModificationState (0),
106 myIsMirrored (Standard_False)
108 updateLayerTransformation();
111 // =======================================================================
112 // function : ~OpenGl_Structure
114 // =======================================================================
115 OpenGl_Structure::~OpenGl_Structure()
117 Release (Handle(OpenGl_Context)());
120 // =======================================================================
121 // function : SetZLayer
123 // =======================================================================
124 void OpenGl_Structure::SetZLayer (const Graphic3d_ZLayerId theLayerIndex)
126 Graphic3d_CStructure::SetZLayer (theLayerIndex);
127 updateLayerTransformation();
130 // =======================================================================
131 // function : SetTransformation
133 // =======================================================================
134 void OpenGl_Structure::SetTransformation (const Handle(TopLoc_Datum3D)& theTrsf)
137 myIsMirrored = Standard_False;
138 if (!myTrsf.IsNull())
140 // Determinant of transform matrix less then 0 means that mirror transform applied.
141 const gp_Trsf& aTrsf = myTrsf->Transformation();
142 const Standard_Real aDet = aTrsf.Value(1, 1) * (aTrsf.Value (2, 2) * aTrsf.Value (3, 3) - aTrsf.Value (3, 2) * aTrsf.Value (2, 3))
143 - aTrsf.Value(1, 2) * (aTrsf.Value (2, 1) * aTrsf.Value (3, 3) - aTrsf.Value (3, 1) * aTrsf.Value (2, 3))
144 + aTrsf.Value(1, 3) * (aTrsf.Value (2, 1) * aTrsf.Value (3, 2) - aTrsf.Value (3, 1) * aTrsf.Value (2, 2));
145 myIsMirrored = aDet < 0.0;
148 updateLayerTransformation();
151 ++myModificationState;
155 // =======================================================================
156 // function : SetTransformPersistence
158 // =======================================================================
159 void OpenGl_Structure::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
161 if ((myTrsfPers.IsNull() || theTrsfPers.IsNull()) && myTrsfPers != theTrsfPers)
163 ++myModificationState;
165 myTrsfPers = theTrsfPers;
166 updateLayerTransformation();
169 // =======================================================================
170 // function : updateLayerTransformation
172 // =======================================================================
173 void OpenGl_Structure::updateLayerTransformation()
176 if (!myTrsf.IsNull())
178 aRenderTrsf = myTrsf->Trsf();
181 const Graphic3d_ZLayerSettings& aLayer = myGraphicDriver->ZLayerSettings (myZLayer);
182 if (!aLayer.OriginTransformation().IsNull()
183 && myTrsfPers.IsNull())
185 aRenderTrsf.SetTranslationPart (aRenderTrsf.TranslationPart() - aLayer.Origin());
187 aRenderTrsf.GetMat4 (myRenderTrsf);
190 // =======================================================================
191 // function : GraphicHighlight
193 // =======================================================================
194 void OpenGl_Structure::GraphicHighlight (const Handle(Graphic3d_PresentationAttributes)& theStyle)
196 myHighlightStyle = theStyle;
200 // =======================================================================
201 // function : GraphicUnhighlight
203 // =======================================================================
204 void OpenGl_Structure::GraphicUnhighlight()
207 myHighlightStyle.Nullify();
210 // =======================================================================
211 // function : OnVisibilityChanged
213 // =======================================================================
214 void OpenGl_Structure::OnVisibilityChanged()
218 ++myModificationState;
222 // =======================================================================
223 // function : IsRaytracable
225 // =======================================================================
226 Standard_Boolean OpenGl_Structure::IsRaytracable() const
228 if (!myGroups.IsEmpty()
230 && myTrsfPers.IsNull())
232 return Standard_True;
235 return myInstancedStructure != NULL
236 && myInstancedStructure->IsRaytracable();
239 // =======================================================================
240 // function : UpdateRaytracableState
242 // =======================================================================
243 void OpenGl_Structure::UpdateStateIfRaytracable (const Standard_Boolean toCheck) const
245 myIsRaytracable = !toCheck;
246 if (!myIsRaytracable)
248 for (OpenGl_Structure::GroupIterator anIter (myGroups); anIter.More(); anIter.Next())
250 if (anIter.Value()->IsRaytracable())
252 myIsRaytracable = Standard_True;
260 ++myModificationState;
264 // =======================================================================
265 // function : Connect
267 // =======================================================================
268 void OpenGl_Structure::Connect (Graphic3d_CStructure& theStructure)
270 OpenGl_Structure* aStruct = static_cast<OpenGl_Structure*> (&theStructure);
272 Standard_ASSERT_RAISE (myInstancedStructure == NULL || myInstancedStructure == aStruct,
273 "Error! Instanced structure is already defined");
275 myInstancedStructure = aStruct;
277 if (aStruct->IsRaytracable())
279 UpdateStateIfRaytracable (Standard_False);
283 // =======================================================================
284 // function : Disconnect
286 // =======================================================================
287 void OpenGl_Structure::Disconnect (Graphic3d_CStructure& theStructure)
289 OpenGl_Structure* aStruct = static_cast<OpenGl_Structure*> (&theStructure);
291 if (myInstancedStructure == aStruct)
293 myInstancedStructure = NULL;
295 if (aStruct->IsRaytracable())
297 UpdateStateIfRaytracable();
302 // =======================================================================
303 // function : NewGroup
305 // =======================================================================
306 Handle(Graphic3d_Group) OpenGl_Structure::NewGroup (const Handle(Graphic3d_Structure)& theStruct)
308 Handle(OpenGl_Group) aGroup = new OpenGl_Group (theStruct);
309 myGroups.Append (aGroup);
313 // =======================================================================
314 // function : RemoveGroup
316 // =======================================================================
317 void OpenGl_Structure::RemoveGroup (const Handle(Graphic3d_Group)& theGroup)
319 if (theGroup.IsNull())
324 for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (myGroups); aGroupIter.More(); aGroupIter.Next())
326 // Check for the given group
327 if (aGroupIter.Value() == theGroup)
329 const Standard_Boolean wasRaytracable =
330 static_cast<const OpenGl_Group&> (*theGroup).IsRaytracable();
332 theGroup->Clear (Standard_False);
336 UpdateStateIfRaytracable();
339 myGroups.Remove (aGroupIter);
345 // =======================================================================
348 // =======================================================================
349 void OpenGl_Structure::Clear()
351 Clear (GlDriver()->GetSharedContext());
354 // =======================================================================
357 // =======================================================================
358 void OpenGl_Structure::Clear (const Handle(OpenGl_Context)& theGlCtx)
360 Standard_Boolean aRaytracableGroupDeleted (Standard_False);
363 for (OpenGl_Structure::GroupIterator aGroupIter (myGroups); aGroupIter.More(); aGroupIter.Next())
365 aRaytracableGroupDeleted |= aGroupIter.Value()->IsRaytracable();
368 aGroupIter.ChangeValue()->Release (theGlCtx);
372 if (aRaytracableGroupDeleted)
374 myIsRaytracable = Standard_False;
377 Is2dText = Standard_False;
378 IsForHighlight = Standard_False;
381 // =======================================================================
382 // function : renderGeometry
384 // =======================================================================
385 void OpenGl_Structure::renderGeometry (const Handle(OpenGl_Workspace)& theWorkspace,
386 bool& theHasClosed) const
388 if (myInstancedStructure != NULL)
390 myInstancedStructure->renderGeometry (theWorkspace, theHasClosed);
393 bool anOldCastShadows = false;
394 const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
395 for (OpenGl_Structure::GroupIterator aGroupIter (myGroups); aGroupIter.More(); aGroupIter.Next())
397 const OpenGl_Group* aGroup = aGroupIter.Value();
399 const Handle(Graphic3d_TransformPers)& aTrsfPers = aGroup->TransformPersistence();
400 if (!aTrsfPers.IsNull())
402 applyPersistence (aCtx, aTrsfPers, true, anOldCastShadows);
403 aCtx->ApplyModelViewMatrix();
406 theHasClosed = theHasClosed || aGroup->IsClosed();
407 aGroup->Render (theWorkspace);
409 if (!aTrsfPers.IsNull())
411 revertPersistence (aCtx, aTrsfPers, true, anOldCastShadows);
412 aCtx->ApplyModelViewMatrix();
417 // =======================================================================
420 // =======================================================================
421 void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) const
423 // Process the structure only if visible
429 const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
431 // Render named status
432 if (highlight && !myHighlightStyle.IsNull() && myHighlightStyle->Method() != Aspect_TOHM_BOUNDBOX)
434 theWorkspace->SetHighlightStyle (myHighlightStyle);
437 // Apply local transformation
438 aCtx->ModelWorldState.Push();
439 OpenGl_Mat4& aModelWorld = aCtx->ModelWorldState.ChangeCurrent();
440 aModelWorld = myRenderTrsf;
442 const Standard_Boolean anOldGlNormalize = aCtx->IsGlNormalizeEnabled();
444 // detect scale transform
445 if (aCtx->core11ffp != NULL
448 const Standard_Real aScale = myTrsf->Trsf().ScaleFactor();
449 if (Abs (aScale - 1.0) > Precision::Confusion())
451 aCtx->SetGlNormalizeEnabled (Standard_True);
455 bool anOldCastShadows = false;
456 #ifdef GL_DEPTH_CLAMP
457 bool toRestoreDepthClamp = false;
459 if (!myTrsfPers.IsNull())
461 applyPersistence (aCtx, myTrsfPers, false, anOldCastShadows);
463 #ifdef GL_DEPTH_CLAMP
464 if (myTrsfPers->Mode() == Graphic3d_TMF_CameraPers
465 && aCtx->arbDepthClamp)
467 toRestoreDepthClamp = true;
468 aCtx->core11fwd->glEnable (GL_DEPTH_CLAMP);
473 // Take into account transform persistence
474 aCtx->ApplyModelViewMatrix();
477 const OpenGl_Aspects* aPrevAspectFace = theWorkspace->Aspects();
479 // Apply correction for mirror transform
482 aCtx->core11fwd->glFrontFace (GL_CW);
485 // Collect clipping planes of structure scope
486 aCtx->ChangeClipping().SetLocalPlanes (myClipPlanes);
488 // True if structure is fully clipped
489 bool isClipped = false;
490 bool hasDisabled = false;
491 if (aCtx->Clipping().IsClippingOrCappingOn())
493 const Graphic3d_BndBox3d& aBBox = BoundingBox();
494 if (!myClipPlanes.IsNull()
495 && myClipPlanes->ToOverrideGlobal())
497 aCtx->ChangeClipping().DisableGlobal();
498 hasDisabled = aCtx->Clipping().HasDisabled();
500 else if (!myTrsfPers.IsNull())
502 if (myTrsfPers->IsZoomOrRotate())
504 // Zoom/rotate persistence object lives in two worlds at the same time.
505 // Global clipping planes can not be trivially applied without being converted
506 // into local space of transformation persistence object.
507 // As more simple alternative - just clip entire object by its anchor point defined in the world space.
508 const gp_Pnt anAnchor = myTrsfPers->AnchorPoint();
509 for (OpenGl_ClippingIterator aPlaneIt (aCtx->Clipping()); aPlaneIt.More() && aPlaneIt.IsGlobal(); aPlaneIt.Next())
511 const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
517 // check for clipping
518 const Graphic3d_Vec4d aCheckPnt (anAnchor.X(), anAnchor.Y(), anAnchor.Z(), 1.0);
519 if (aPlane->ProbePoint (aCheckPnt) == Graphic3d_ClipState_Out)
527 aCtx->ChangeClipping().DisableGlobal();
528 hasDisabled = aCtx->Clipping().HasDisabled();
531 // Set of clipping planes that do not intersect the structure,
532 // and thus can be disabled to improve rendering performance
534 && myTrsfPers.IsNull())
536 for (OpenGl_ClippingIterator aPlaneIt (aCtx->Clipping()); aPlaneIt.More(); aPlaneIt.Next())
538 const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
539 if (aPlaneIt.IsDisabled())
544 const Graphic3d_ClipState aBoxState = aPlane->ProbeBox (aBBox);
545 if (aBoxState == Graphic3d_ClipState_In)
547 aCtx->ChangeClipping().SetEnabled (aPlaneIt, false);
550 else if (aBoxState == Graphic3d_ClipState_Out && myBndBoxClipCheck)
558 if ((!myClipPlanes.IsNull() && !myClipPlanes->IsEmpty())
561 // Set OCCT state uniform variables
562 aCtx->ShaderManager()->UpdateClippingState();
567 bool hasClosedPrims = false;
570 renderGeometry (theWorkspace, hasClosedPrims);
573 // Reset correction for mirror transform
576 aCtx->core11fwd->glFrontFace (GL_CCW);
579 // Render capping for structure groups
581 && aCtx->Clipping().IsCappingOn())
583 OpenGl_CappingAlgo::RenderCapping (theWorkspace, *this);
586 // Revert structure clippings
589 // enable planes that were previously disabled
590 aCtx->ChangeClipping().RestoreDisabled();
592 aCtx->ChangeClipping().SetLocalPlanes (Handle(Graphic3d_SequenceOfHClipPlane)());
593 if ((!myClipPlanes.IsNull() && !myClipPlanes->IsEmpty())
596 // Set OCCT state uniform variables
597 aCtx->ShaderManager()->RevertClippingState();
600 // Restore local transformation
601 aCtx->ModelWorldState.Pop();
602 aCtx->SetGlNormalizeEnabled (anOldGlNormalize);
605 theWorkspace->SetAspects (aPrevAspectFace);
607 // Apply highlight box
609 && !myHighlightStyle.IsNull()
610 && myHighlightStyle->Method() == Aspect_TOHM_BOUNDBOX)
612 aCtx->ApplyModelViewMatrix();
613 theWorkspace->SetHighlightStyle (myHighlightStyle);
614 renderBoundingBox (theWorkspace);
617 if (!myTrsfPers.IsNull())
619 revertPersistence (aCtx, myTrsfPers, false, anOldCastShadows);
620 #ifdef GL_DEPTH_CLAMP
621 if (toRestoreDepthClamp) { aCtx->core11fwd->glDisable (GL_DEPTH_CLAMP); }
625 // Restore named status
626 theWorkspace->SetHighlightStyle (Handle(Graphic3d_PresentationAttributes)());
629 // =======================================================================
630 // function : Release
632 // =======================================================================
633 void OpenGl_Structure::Release (const Handle(OpenGl_Context)& theGlCtx)
637 myHighlightStyle.Nullify();
640 // =======================================================================
641 // function : ReleaseGlResources
643 // =======================================================================
644 void OpenGl_Structure::ReleaseGlResources (const Handle(OpenGl_Context)& theGlCtx)
646 for (OpenGl_Structure::GroupIterator aGroupIter (myGroups); aGroupIter.More(); aGroupIter.Next())
648 aGroupIter.ChangeValue()->Release (theGlCtx);
652 //=======================================================================
653 //function : ShadowLink
655 //=======================================================================
656 Handle(Graphic3d_CStructure) OpenGl_Structure::ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const
658 return new OpenGl_StructureShadow (theManager, this);
661 // =======================================================================
662 // function : applyPersistence
664 // =======================================================================
665 void OpenGl_Structure::applyPersistence (const Handle(OpenGl_Context)& theCtx,
666 const Handle(Graphic3d_TransformPers)& theTrsfPers,
667 const Standard_Boolean theIsLocal,
668 Standard_Boolean& theOldCastShadows) const
670 // temporarily disable shadows on non-3d objects
671 theOldCastShadows = theCtx->ShaderManager()->SetCastShadows (false);
673 theCtx->WorldViewState.Push();
674 OpenGl_Mat4& aWorldView = theCtx->WorldViewState.ChangeCurrent();
677 && theTrsfPers->IsZoomOrRotate())
679 // move anchor point to presentation location
680 theCtx->ModelWorldState.Push();
681 OpenGl_Mat4& aModelWorld = theCtx->ModelWorldState.ChangeCurrent();
682 gp_Pnt aStartPnt = theTrsfPers->AnchorPoint();
683 Graphic3d_Vec4 anAnchorPoint = aModelWorld * Graphic3d_Vec4 ((Standard_ShortReal)aStartPnt.X(),
684 (Standard_ShortReal)aStartPnt.Y(),
685 (Standard_ShortReal)aStartPnt.Z(), 1.0f);
686 aModelWorld.SetColumn (3, Graphic3d_Vec4 (Graphic3d_Vec3 (0.0), 1.0)); // reset translation part
687 aStartPnt.SetCoord (anAnchorPoint.x(), anAnchorPoint.y(), anAnchorPoint.z());
689 theTrsfPers->Apply (theCtx->Camera(),
690 theCtx->ProjectionState.Current(), aWorldView,
691 theCtx->VirtualViewport()[2], theCtx->VirtualViewport()[3],
696 theTrsfPers->Apply (theCtx->Camera(),
697 theCtx->ProjectionState.Current(), aWorldView,
698 theCtx->VirtualViewport()[2], theCtx->VirtualViewport()[3]);
701 if (!theCtx->IsGlNormalizeEnabled()
702 && theCtx->core11ffp != NULL)
704 const Standard_Real aScale = Graphic3d_TransformUtils::ScaleFactor (aWorldView);
705 if (Abs (aScale - 1.0) > Precision::Confusion())
707 theCtx->SetGlNormalizeEnabled (true);
712 // =======================================================================
713 // function : revertPersistence
715 // =======================================================================
716 void OpenGl_Structure::revertPersistence (const Handle(OpenGl_Context)& theCtx,
717 const Handle(Graphic3d_TransformPers)& theTrsfPers,
718 const Standard_Boolean theIsLocal,
719 const Standard_Boolean theOldCastShadows) const
722 && theTrsfPers->IsZoomOrRotate())
724 theCtx->ModelWorldState.Pop();
726 theCtx->WorldViewState.Pop();
727 theCtx->ShaderManager()->SetCastShadows (theOldCastShadows);
730 //=======================================================================
731 //function : DumpJson
733 //=======================================================================
734 void OpenGl_Structure::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
736 OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
738 OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Graphic3d_CStructure)
740 OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myInstancedStructure)
742 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRaytracable)
743 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myModificationState)
744 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsMirrored)