1 // Created on: 1992-01-22
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _V3d_PositionalLight_HeaderFile
18 #define _V3d_PositionalLight_HeaderFile
20 #include <V3d_PositionLight.hxx>
22 //! Creation and modification of an isolated (positional) light source.
23 //! It is also defined by the color and two attenuation factors ConstAttentuation() and LinearAttentuation().
24 //! The resulting attenuation factor determining the illumination of a surface depends on the following formula:
26 //! F = 1 / (ConstAttenuation() + LinearAttenuation() * Distance)
28 //! Where Distance is the distance of the isolated source from the surface.
29 class V3d_PositionalLight : public V3d_PositionLight
31 DEFINE_STANDARD_RTTIEXT(V3d_PositionalLight, V3d_PositionLight)
34 //! Creates an isolated light source in the viewer with default attenuation factors (1.0, 0.0).
35 Standard_EXPORT V3d_PositionalLight (const gp_Pnt& thePos,
36 const Quantity_Color& theColor = Quantity_NOC_WHITE);
38 using Graphic3d_CLight::Position;
39 using Graphic3d_CLight::SetPosition;
43 Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()")
44 Standard_EXPORT V3d_PositionalLight (const Handle(V3d_Viewer)& theViewer,
45 const Standard_Real theX,
46 const Standard_Real theY,
47 const Standard_Real theZ,
48 const Quantity_Color& theColor = Quantity_NOC_WHITE,
49 const Standard_Real theConstAttenuation = 1.0,
50 const Standard_Real theLinearAttenuation = 0.0);
52 //! @name hidden properties not applicable to positional light
55 using Graphic3d_CLight::Direction;
56 using Graphic3d_CLight::SetDirection;
57 using Graphic3d_CLight::Angle;
58 using Graphic3d_CLight::SetAngle;
59 using Graphic3d_CLight::Concentration;
60 using Graphic3d_CLight::SetConcentration;
64 DEFINE_STANDARD_HANDLE(V3d_PositionalLight, V3d_PositionLight)
66 #endif // _V3d_PositionalLight_HeaderFile