42cf5bc1 |
1 | // Created on: 1992-01-22 |
2 | // Created by: GG |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _V3d_SpotLight_HeaderFile |
18 | #define _V3d_SpotLight_HeaderFile |
19 | |
42cf5bc1 |
20 | #include <V3d_PositionLight.hxx> |
42cf5bc1 |
21 | #include <V3d_TypeOfOrientation.hxx> |
42cf5bc1 |
22 | |
42cf5bc1 |
23 | //! Creation and modification of a spot. |
992ed6b3 |
24 | //! The attenuation factor F determines the illumination of a surface: |
25 | //! @code |
26 | //! F = 1/(ConstAttenuation() + LinearAttenuation() * Distance) |
27 | //! @endcode |
28 | //! Where Distance is the distance from the source to the surface. |
29 | //! The default values (1.0, 0.0) correspond to a minimum of attenuation. |
30 | //! The concentration factor determines the dispersion of the light on the surface, the default value (1.0) corresponds to a minimum of dispersion. |
42cf5bc1 |
31 | class V3d_SpotLight : public V3d_PositionLight |
32 | { |
992ed6b3 |
33 | DEFINE_STANDARD_RTTIEXT(V3d_SpotLight, V3d_PositionLight) |
42cf5bc1 |
34 | public: |
35 | |
992ed6b3 |
36 | //! Creates a light source of the Spot type in the viewer with default attenuation factors (1.0, 0.0), |
37 | //! concentration factor 1.0 and spot angle 30 degrees. |
38 | Standard_EXPORT V3d_SpotLight (const gp_Pnt& thePos, |
39 | const V3d_TypeOfOrientation theDirection = V3d_XnegYnegZpos, |
40 | const Quantity_Color& theColor = Quantity_NOC_WHITE); |
41 | |
42 | //! Creates a light source of the Spot type in the viewer with default attenuation factors (1.0, 0.0), |
43 | //! concentration factor 1.0 and spot angle 30 degrees. |
44 | Standard_EXPORT V3d_SpotLight (const gp_Pnt& thePos, |
45 | const gp_Dir& theDirection, |
46 | const Quantity_Color& theColor = Quantity_NOC_WHITE); |
47 | |
48 | //! Defines the direction of the light source |
49 | //! according to a predefined directional vector. |
50 | Standard_EXPORT void SetDirection (V3d_TypeOfOrientation theOrientation); |
51 | using Graphic3d_CLight::SetDirection; |
52 | using Graphic3d_CLight::Position; |
53 | using Graphic3d_CLight::SetPosition; |
54 | |
42cf5bc1 |
55 | }; |
56 | |
992ed6b3 |
57 | DEFINE_STANDARD_HANDLE(V3d_SpotLight, V3d_PositionLight) |
58 | |
42cf5bc1 |
59 | #endif // _V3d_SpotLight_HeaderFile |