0024188: Doubling the number of light sources in Qt samples.
authordbp <dbp@opencascade.com>
Wed, 18 Sep 2013 10:20:42 +0000 (14:20 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 20 Sep 2013 08:09:46 +0000 (12:09 +0400)
src/V3d/V3d_Viewer_2.cxx

index 7afc4fd..1d281c7 100755 (executable)
@@ -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);