f85fe40d5b0adb5daeae32d49ca5211301f8bd20
[occt.git] / src / V3d / V3d_SpotLight.cdl
1 -- Created on: 1992-01-22
2 -- Created by: GG 
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21 -- Update:      FDA - Oct 15 1994, 
22 --              ZOV - Mars 30 1998
23
24
25 class SpotLight from V3d
26
27         ---Purpose: Creation and modification of a spot.
28
29       
30
31 inherits PositionLight from V3d
32
33 uses 
34
35         Viewer from V3d,
36         TypeOfOrientation from V3d,
37         TypeOfRepresentation from V3d,
38         Coordinate from V3d,
39         NameOfColor from Quantity,
40         PlaneAngle from Quantity,
41         Coefficient from Quantity,
42         Parameter from Quantity,
43         View from V3d,
44         Structure from Graphic3d,
45         Vertex from Graphic3d,
46         Group from Graphic3d
47
48 raises BadValue from Viewer
49
50 is
51
52         Create ( VM : mutable Viewer ; X,Y,Z : Coordinate ;
53                  Direction : TypeOfOrientation = V3d_XnegYnegZpos ;
54                  Color : NameOfColor = Quantity_NOC_WHITE ; 
55                  Attenuation1 : Coefficient = 1.0 ; 
56                  Attenuation2 : Coefficient = 0.0 ; 
57                  Concentration : Coefficient = 1.0 ;
58                  Angle : PlaneAngle = 0.523599 )
59                                 returns mutable SpotLight
60         ---Level: Public
61         ---Purpose: Creates a light source of the Spot type in the viewer.
62         --          The attenuation factor F which determines
63         --          the illumination of a surface depends on the following formula :
64         --          F = 1/(A1 + A2*Length)
65         --              A1,A2 being the 2 factors of attenuation
66         --              Length is the distance from the source to the surface.
67         --          The default values (1.0,0.0) correspond to a minimum
68         --          of attenuation .
69         --          The concentration factor determines the dispersion 
70         --          of the light on the surface, the default value
71         --          (1.0) corresponds to a minimum of dispersion .
72         raises BadValue from Viewer;
73         ---Purpose:  Warning! raises BadValue from Viewer  -
74         --      If one of the coefficients is not between 0 and 1 .
75         --      If the lighting angle is <= 0 ou > PI .
76         
77         Create ( VM : mutable Viewer ; Xt,Yt,Zt : Coordinate;
78                  Xp,Yp,Zp : Coordinate;
79                  Color : NameOfColor = Quantity_NOC_WHITE ;
80                  Attenuation1 : Coefficient = 1.0 ; 
81                  Attenuation2 : Coefficient = 0.0 ; 
82                  Concentration : Coefficient = 1.0 ;
83                  Angle : PlaneAngle = 0.523599 )                 
84                        returns mutable SpotLight
85         ---Level: Public
86         ---Purpose: Creates a light source of the Spot type in the viewer.
87         --          Xt,Yt,Zt : Coordinate of light source Target.
88         --          Xp,Yp,Zp : Coordinate of light source Position.
89         --          The others parameters describe before.
90         raises BadValue from Viewer;
91         ---Purpose:  Warning! raises BadValue from Viewer  -
92         --      If one of the coefficients is not between 0 and 1 .
93         --      If the lighting angle is <= 0 ou > PI .
94
95         --------------------------------------------------------
96         ---Category: Methods to modify the Attributes of the light
97         --------------------------------------------------------
98
99         SetPosition ( me : mutable; X,Y,Z : Coordinate ) is redefined;
100         ---Level: Public
101         ---Purpose: Defines the position of the light source.
102
103         SetDirection ( me : mutable; Vx, Vy, Vz : Parameter ) raises BadValue from Viewer is static;
104         ---Level: Public
105         ---Purpose : Defines the direction of the light source.
106         --      If the normal vector is NULL.
107
108         SetDirection ( me : mutable; Orientation : TypeOfOrientation ) is static;
109         ---Level: Public
110         ---Purpose : Defines the direction of the light source
111         --           according to a predefined directional vector.
112
113         SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from Viewer is static;
114         ---Level: Public
115         ---Purpose: Defines the coefficients of attenuation.
116         --  Warning! raises BadValue from Viewer 
117         --          if one of the coefficient is <0 ou >1 .
118     
119         SetConcentration( me : mutable; C : Coefficient ) raises BadValue from Viewer is static;
120         ---Level: Public
121         ---Purpose: Defines the coefficient of concentration.
122         --      if the coefficient is <0 ou >1 .
123         
124         SetAngle ( me : mutable; Angle : PlaneAngle ) raises BadValue from Viewer is static;
125         ---Level: Public
126         ---Purpose: Defines the spot angle in RADIANS.
127         --  Warning: raises BadValue from from Viewer
128         --      If the angle is <= 0 ou > PI .
129         
130         ---------------------------------------------------
131         ---Category: display methods
132         ---------------------------------------------------
133
134         Display(me: mutable; aView: View from V3d;
135                 Representation : TypeOfRepresentation)
136         is redefined static;
137         ---Level: Public
138         ---Purpose: Display the graphic structure of light source
139         --          in the choosen view. We have three type of representation
140         --          - SIMPLE   : Only the light source is displayed.
141         --          - PARTIAL  : The light source and the light space are
142         --                       displayed.
143         --          - COMPLETE : The light source, the light space and the
144         --                       radius of light space are displayed.
145         --          We can choose the "SAMELAST" as parameter of representation
146         --          In this case the graphic structure representation will be 
147         --          the last displayed. 
148         
149         ---------------------------------------------------
150         ---Category: Inquire methods
151         ---------------------------------------------------
152
153         Direction ( me; Vx, Vy, Vz : out Parameter ) is static;
154         ---Level: Public
155         ---Purpose : Returns the direction of the light source defined by Vx,Vy,Vz.
156
157         Position ( me; X,Y,Z : out Coordinate ) is redefined static;
158         ---Level: Public
159         ---Purpose : Returns the position of the light source.
160
161         Attenuation ( me; A1,A2 : out Coefficient ) is static;
162         ---Level: Public
163         ---Purpose : Returns the attenuation factors A1,A2 of the light source.
164
165             Concentration( me )  returns Coefficient  is static;
166         ---Level: Public
167
168         Angle ( me ) returns PlaneAngle  is static;
169         ---Level: Public
170         ---Purpose: Returns the spot angle.
171
172         -----------------------------------------
173         ---Category: Private or Protected methods
174         -----------------------------------------
175
176         Symbol ( me ; gsymbol : mutable Group from Graphic3d ;
177                       aView   : View from V3d ) is redefined static private;
178         ---Level: Internal
179         ---Purpose: Defines the representation of the spot light source.
180
181 end SpotLight;
182
183