0023634: Eliminate Polyline and Polygon usage in drawers
[occt.git] / src / V3d / V3d_View_5.cxx
CommitLineData
b311480e 1// Copyright (c) 1999-2012 OPEN CASCADE SAS
2//
3// The content of this file is subject to the Open CASCADE Technology Public
4// License Version 6.5 (the "License"). You may not use the content of this file
5// except in compliance with the License. Please obtain a copy of the License
6// at http://www.opencascade.org and read it completely before using this file.
7//
8// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10//
11// The Original Code and all software distributed under the License is
12// distributed on an "AS IS" basis, without warranty of any kind, and the
13// Initial Developer hereby disclaims all such warranties, including without
14// limitation, any warranties of merchantability, fitness for a particular
15// purpose or non-infringement. Please see the License for the specific terms
16// and conditions governing the rights and limitations under the License.
17
7fd59977 18/***********************************************************************
19
20 FONCTION :
21 ----------
22 Classe V3d_View :
23
24 HISTORIQUE DES MODIFICATIONS :
25 --------------------------------
26 22-10-01 : SAV ; Created
27
28************************************************************************/
29
30/*----------------------------------------------------------------------*/
31/*
32 * Includes
33 */
34#include <V3d_View.jxx>
35
b8ddfc2f 36//BUC61044 25/10/01 SAV ; added functionality to control gl depth testing from higher API
37//BUC61045 25/10/01 SAV ; added functionality to control gl lighting from higher API
7fd59977 38
39
40void V3d_View::EnableDepthTest( const Standard_Boolean enable ) const
41{
7fd59977 42 MyView->EnableDepthTest( enable );
7fd59977 43}
44
45Standard_Boolean V3d_View::IsDepthTestEnabled() const
46{
7fd59977 47 return MyView->IsDepthTestEnabled();
7fd59977 48}
49
50void V3d_View::EnableGLLight( const Standard_Boolean enable ) const
51{
7fd59977 52 MyView->EnableGLLight( enable );
7fd59977 53}
54
55Standard_Boolean V3d_View::IsGLLightEnabled() const
56{
7fd59977 57 return MyView->IsGLLightEnabled();
7fd59977 58}
59
60void V3d_View::SetLayerMgr(const Handle(V3d_LayerMgr)& aMgr)
61{
62 MyLayerMgr = aMgr;
63}
64
65void V3d_View::ColorScaleDisplay()
66{
67 if ( MyLayerMgr.IsNull() )
68 MyLayerMgr = new V3d_LayerMgr( this );
69
70 MyLayerMgr->ColorScaleDisplay();
71 MustBeResized();
72 if ( !Window().IsNull() ) {
73 Standard_Integer aW( 0 ), aH( 0 );
74 Window()->Size( aW, aH );
75 Redraw( 0, 0, aW, aH );
76 }
77}
78
79void V3d_View::ColorScaleErase()
80{
81 if ( !MyLayerMgr.IsNull() )
82 MyLayerMgr->ColorScaleErase();
83}
84
85Standard_Boolean V3d_View::ColorScaleIsDisplayed() const
86{
87 Standard_Boolean aStatus = Standard_False;
88 if ( !MyLayerMgr.IsNull() )
89 aStatus = MyLayerMgr->ColorScaleIsDisplayed();
90
91 return aStatus;
92}
93
94Handle(Aspect_ColorScale) V3d_View::ColorScale() const
95{
96 if ( MyLayerMgr.IsNull() ) {
97 Handle(V3d_View) that = this;
98 that->MyLayerMgr = new V3d_LayerMgr( this );
99 }
100
101 return MyLayerMgr->ColorScale();
102}