0024887: Visualization - revise and extend Raytracing controls
[occt.git] / src / V3d / V3d_View_5.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
7fd59977 14/***********************************************************************
15
16 FONCTION :
17 ----------
18 Classe V3d_View :
19
20 HISTORIQUE DES MODIFICATIONS :
21 --------------------------------
22 22-10-01 : SAV ; Created
23
24************************************************************************/
25
26/*----------------------------------------------------------------------*/
27/*
28 * Includes
29 */
30#include <V3d_View.jxx>
31
b8ddfc2f 32//BUC61044 25/10/01 SAV ; added functionality to control gl depth testing from higher API
33//BUC61045 25/10/01 SAV ; added functionality to control gl lighting from higher API
7fd59977 34
35
36void V3d_View::EnableDepthTest( const Standard_Boolean enable ) const
37{
7fd59977 38 MyView->EnableDepthTest( enable );
7fd59977 39}
40
41Standard_Boolean V3d_View::IsDepthTestEnabled() const
42{
7fd59977 43 return MyView->IsDepthTestEnabled();
7fd59977 44}
45
46void V3d_View::EnableGLLight( const Standard_Boolean enable ) const
47{
7fd59977 48 MyView->EnableGLLight( enable );
7fd59977 49}
50
51Standard_Boolean V3d_View::IsGLLightEnabled() const
52{
7fd59977 53 return MyView->IsGLLightEnabled();
7fd59977 54}
55
bc8c79bb 56const Graphic3d_RenderingParams& V3d_View::RenderingParams() const
e276548b 57{
bc8c79bb 58 return static_cast<Graphic3d_CView*> (MyView->CView())->RenderParams;
e276548b 59}
60
bc8c79bb 61Graphic3d_RenderingParams& V3d_View::ChangeRenderingParams()
e276548b 62{
bc8c79bb 63 return static_cast<Graphic3d_CView*> (MyView->CView())->RenderParams;
e276548b 64}
65
7fd59977 66void V3d_View::SetLayerMgr(const Handle(V3d_LayerMgr)& aMgr)
67{
68 MyLayerMgr = aMgr;
69}
70
71void V3d_View::ColorScaleDisplay()
72{
73 if ( MyLayerMgr.IsNull() )
74 MyLayerMgr = new V3d_LayerMgr( this );
75
76 MyLayerMgr->ColorScaleDisplay();
77 MustBeResized();
78 if ( !Window().IsNull() ) {
79 Standard_Integer aW( 0 ), aH( 0 );
80 Window()->Size( aW, aH );
81 Redraw( 0, 0, aW, aH );
82 }
83}
84
85void V3d_View::ColorScaleErase()
86{
87 if ( !MyLayerMgr.IsNull() )
88 MyLayerMgr->ColorScaleErase();
89}
90
91Standard_Boolean V3d_View::ColorScaleIsDisplayed() const
92{
93 Standard_Boolean aStatus = Standard_False;
94 if ( !MyLayerMgr.IsNull() )
95 aStatus = MyLayerMgr->ColorScaleIsDisplayed();
96
97 return aStatus;
98}
99
100Handle(Aspect_ColorScale) V3d_View::ColorScale() const
101{
102 if ( MyLayerMgr.IsNull() ) {
103 Handle(V3d_View) that = this;
104 that->MyLayerMgr = new V3d_LayerMgr( this );
105 }
106
107 return MyLayerMgr->ColorScale();
108}