From c7b6656812f557896449adb276dff132633a505c Mon Sep 17 00:00:00 2001 From: dbp Date: Wed, 18 Sep 2013 14:20:42 +0400 Subject: [PATCH] 0024188: Doubling the number of light sources in Qt samples. --- src/V3d/V3d_Viewer_2.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/V3d/V3d_Viewer_2.cxx b/src/V3d/V3d_Viewer_2.cxx index 7afc4fd0f6..1d281c71df 100755 --- a/src/V3d/V3d_Viewer_2.cxx +++ b/src/V3d/V3d_Viewer_2.cxx @@ -104,14 +104,17 @@ void V3d_Viewer::DelLight( const Handle(V3d_Light)& TheLight ) { MyDefinedLights.Remove(TheLight); } -void V3d_Viewer::SetDefaultLights () { -// SetLightOn ( new V3d_DirectionalLight(this,V3d_XposYpos)); -// SetLightOn ( new V3d_DirectionalLight(this,V3d_Zpos)); -// SetLightOn ( new V3d_DirectionalLight(this,V3d_XnegYneg)); -// SetLightOn ( new V3d_DirectionalLight(this,V3d_Zneg)); - SetLightOn( new V3d_DirectionalLight(this, V3d_Zneg, Quantity_NOC_WHITE, Standard_True) ); - SetLightOn ( new V3d_AmbientLight(this)); +void V3d_Viewer::SetDefaultLights() +{ + while (MyDefinedLights.Extent() > 0) + { + DelLight ((Handle(V3d_Light)&)MyDefinedLights.First()); + } + + SetLightOn (new V3d_DirectionalLight (this, V3d_Zneg, Quantity_NOC_WHITE, Standard_True)); + SetLightOn (new V3d_AmbientLight (this)); } + void V3d_Viewer::Init() { MyDefaultPerspectiveView = new V3d_PerspectiveView(this); MyDefaultOrthographicView = new V3d_OrthographicView(this);