0031099: Visualization, TKOpenGl - support Point light source with artistic full...
[occt.git] / src / Graphic3d / Graphic3d_CLight.cxx
index 0443787..0e8941c 100644 (file)
@@ -233,3 +233,16 @@ void Graphic3d_CLight::SetSmoothAngle (Standard_ShortReal theValue)
   updateRevisionIf (Abs (mySmoothness - theValue) > ShortRealEpsilon());
   mySmoothness = theValue;
 }
+
+// =======================================================================
+// function : SetRange
+// purpose  :
+// =======================================================================
+void Graphic3d_CLight::SetRange (Standard_ShortReal theValue)
+{
+  Standard_ProgramError_Raise_if (myType != Graphic3d_TOLS_POSITIONAL && myType != Graphic3d_TOLS_SPOT,
+                                  "Graphic3d_CLight::SetRange(), incorrect light type");
+  Standard_OutOfRange_Raise_if (theValue < 0.0, "Graphic3d_CLight::SetRange(), Bad value for falloff range");
+  updateRevisionIf (Abs (Range() - theValue) > ShortRealEpsilon());
+  myDirection.w() = theValue;
+};
\ No newline at end of file