Salome HOME
Updated copyright comment
[modules/gui.git] / src / OCCViewer / OCCViewer_LightSourceDlg.cxx
index 7cf3e294e00e0f482ccc822a7512d105b32b1109..1f205f2ead2af97a419d171c4ca9b2cd0576df13 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2015-2024  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -76,7 +76,6 @@ OCCViewer_LightSourceDlg::OCCViewer_LightSourceDlg( OCCViewer_ViewWindow* view,
 
   const double min = -RealLast();
   const double max = RealLast();
-  const int precision = 3;
 
   /**********************   Directional light   **********************/
   /* Controls for directional light:
@@ -286,14 +285,16 @@ void OCCViewer_LightSourceDlg::initParam( bool theIsDefault )
     aLight = myModel->getViewer3d()->DefinedLight();
     if ( aLight->Type() == V3d_DIRECTIONAL ) {
       myDirLight = Handle(V3d_DirectionalLight)::DownCast( aLight );
-      myPosLight = new V3d_PositionalLight( myModel->getViewer3d(), 0, 0, 0 );
+      myPosLight = new V3d_PositionalLight( gp_Pnt(0, 0, 0) );
+      myModel->getViewer3d()->AddLight( myPosLight );
       myDirType->setChecked( true );
       myStackedLayout->setCurrentIndex(0);
       break;
     }
     if ( aLight->Type() == V3d_POSITIONAL ) {
       myPosLight = Handle(V3d_PositionalLight)::DownCast( aLight );
-      myDirLight = new V3d_DirectionalLight( myModel->getViewer3d() );
+      myDirLight = new V3d_DirectionalLight();
+      myModel->getViewer3d()->AddLight( myDirLight );
       myPosType->setChecked( true );
       myStackedLayout->setCurrentIndex(1);
       break;
@@ -301,7 +302,7 @@ void OCCViewer_LightSourceDlg::initParam( bool theIsDefault )
     myModel->getViewer3d()->NextDefinedLights();
   }
 
-  double aX, aY, aZ;
+  double aX=0., aY=0., aZ=0.;
   Quantity_Color aColor = aLight->Color();
   if( myDirType->isChecked() ) {
     myDirColor->setColor( OCCViewer::color( aColor ) );