be612b4da20afef1fd7851be97d3b0055bbf1ab1
[occt.git] / src / V3d / V3d_PositionalLight.cdl
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 -- Update:      FDA Oct 15 1994
18 --              ZOV - Mars 30 1998
19
20
21 class PositionalLight from V3d
22
23         ---Version:
24
25         ---Purpose: Creation and modification of an isolated
26         --          (positional) light source.
27
28         ---Keywords: Light,Positional 
29
30         ---Warning:
31
32         ---References:
33
34
35 inherits PositionLight from V3d
36
37 uses 
38
39         Viewer from V3d,
40         Coordinate from V3d,
41         View from V3d,
42         TypeOfRepresentation from V3d,
43         NameOfColor from Quantity,
44         Coefficient from Quantity,
45         Parameter from Quantity,
46         Structure from Graphic3d,
47         Vertex from Graphic3d,
48         Group from Graphic3d
49         
50 raises BadValue from V3d
51
52 is
53
54         Create ( VM : Viewer ; X,Y,Z : Coordinate ;
55                  Color : NameOfColor = Quantity_NOC_WHITE ;
56                  Attenuation1 : Coefficient = 1.0 ; 
57                  Attenuation2 : Coefficient = 0.0 ) 
58                                 returns PositionalLight 
59         ---Level: Public
60         ---Purpose: Creates an isolated light source X,Y,Z in the viewer.
61         --          It is also defined by the color Color and
62         --          two attenuation factors Attenuation1, Attenuation2.
63         --          The resulting attenuation factor determining the
64         --          illumination of a surface depends on the following
65         --          formula :
66         --          F = 1/(A1 + A2*Length)
67         --              A1,A2 being the two factors of attenuation
68         --              Length is the distance of the isolated source
69         --          from the surface.
70         raises BadValue from V3d;
71         ---Purpose:  Warning!  raises BadValue from V3d
72         --          if one of the attenuation coefficients is not between 0 et 1.
73
74         Create ( VM : Viewer ; Xt,Yt,Zt : Coordinate;
75                  Xp,Yp,Zp : Coordinate;
76                  Color : NameOfColor = Quantity_NOC_WHITE ;
77                  Attenuation1 : Coefficient = 1.0 ; 
78                  Attenuation2 : Coefficient = 0.0 ) 
79                        returns PositionalLight 
80         ---Level: Public
81         ---Purpose: Creates a light source of the Positional type 
82         --          in the viewer.
83         --          Xt,Yt,Zt : Coordinate of Target light source.
84         --          Xp,Yp,Zp : Coordinate of Position light source.
85         --          The light source is also defined by the color Color
86         --          and two attenuation factors Attenuation1,
87         --          Attenuation2 that determine the illumination of a
88         --          surface using the following formula :
89         --          F = 1/(A1 + A2*Length) where:
90         --          -   A1,A2 are the two attenuation factors, and
91         --          -   Length is the distance from the isolated source.
92         raises BadValue from V3d;
93         ---Purpose:  Warning! raises BadValue from V3d
94         --          if one of the attenuation coefficients is not between 0 et 1.
95
96
97         --------------------------------------------------------
98         ---Category: Methods to modify the Attributes of the Light
99         --------------------------------------------------------
100
101         SetPosition ( me : mutable; X,Y,Z : Coordinate ) is redefined;
102         ---Level: Public
103         ---Purpose: Defines the position of the light source.
104
105             SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from V3d is static;
106         ---Level: Public
107         ---Purpose: Defines the attenuation factors.
108         --  Warning: raises BadValue from V3d
109         --          if one of the attenuation coefficients is not between 0 et 1.
110
111         ---------------------------------------------------
112         ---Category: Displaying methods 
113         ---------------------------------------------------
114
115         Display(me: mutable; aView: View from V3d;
116                 Representation : TypeOfRepresentation)
117         is redefined static;
118         ---Level: Public
119         ---Purpose: Display the graphic structure of light source
120         --          in the choosen view. We have three type of representation
121         --          - SIMPLE   : Only the light source is displayed.
122         --          - PARTIAL  : The light source and the light space are
123         --                       displayed.
124         --          - COMPLETE : The light source, the light space and the
125         --                       radius of light space are displayed.
126         --          We can choose the "SAMELAST" as parameter of representation
127         --          In this case the graphic structure representation will be 
128         --          the last displayed.
129         
130         ---------------------------------------------------
131         ---Category: Inquire methods
132         ---------------------------------------------------
133
134         Position ( me; X,Y,Z : out Coordinate ) is redefined static;
135         ---Level: Public
136         ---Purpose : Returns the position of the light source.
137
138         Attenuation ( me; A1,A2 : out Coefficient ) is static;
139         ---Level: Public
140         ---Purpose : Returns the attenuation factors A1,A2 of the light
141         -- source used at construction time.
142
143         -----------------------------------------
144         ---Category: Private or Protected methods
145         -----------------------------------------
146
147         Symbol ( me ; gsymbol : Group from Graphic3d ;
148                       aView   : View from V3d ) is redefined static private;
149         ---Level: Internal
150         ---Purpose: Defined the representation of the positional light source.
151
152 end PositionalLight;
153
154