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_SpotLight_HeaderFile
18 #define _V3d_SpotLight_HeaderFile
20 #include <V3d_PositionLight.hxx>
21 #include <V3d_TypeOfOrientation.hxx>
23 //! Creation and modification of a spot.
24 //! The attenuation factor F determines the illumination of a surface:
26 //! F = 1/(ConstAttenuation() + LinearAttenuation() * Distance)
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.
31 class V3d_SpotLight : public V3d_PositionLight
33 DEFINE_STANDARD_RTTIEXT(V3d_SpotLight, V3d_PositionLight)
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);
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);
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;
57 Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()")
58 Standard_EXPORT V3d_SpotLight (const Handle(V3d_Viewer)& theViewer,
59 const Standard_Real theX,
60 const Standard_Real theY,
61 const Standard_Real theZ,
62 const V3d_TypeOfOrientation theDirection = V3d_XnegYnegZpos,
63 const Quantity_Color& theColor = Quantity_NOC_WHITE,
64 const Standard_Real theConstAttenuation = 1.0,
65 const Standard_Real theLinearAttenuation = 0.0,
66 const Standard_Real theConcentration = 1.0,
67 const Standard_Real theAngle = 0.523599);
69 //! theXt, theYt, theZt : Coordinate of light source Target.
70 //! theXp, theYp, theZp : Coordinate of light source Position.
71 Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()")
72 Standard_EXPORT V3d_SpotLight (const Handle(V3d_Viewer)& theViewer,
73 const Standard_Real theXt,
74 const Standard_Real theYt,
75 const Standard_Real theZt,
76 const Standard_Real theXp,
77 const Standard_Real theYp,
78 const Standard_Real theZp,
79 const Quantity_Color& theColor = Quantity_NOC_WHITE,
80 const Standard_Real theConstAttenuation = 1.0,
81 const Standard_Real theLinearAttenuation = 0.0,
82 const Standard_Real theConcentration = 1.0,
83 const Standard_Real theAngle = 0.523599);
87 DEFINE_STANDARD_HANDLE(V3d_SpotLight, V3d_PositionLight)
89 #endif // _V3d_SpotLight_HeaderFile