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 -- Update: FDA Oct 15 1994
21 class PositionalLight from V3d
25 ---Purpose: Creation and modification of an isolated
26 -- (positional) light source.
28 ---Keywords: Light,Positional
35 inherits PositionLight 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,
50 raises BadValue from V3d
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
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
66 -- F = 1/(A1 + A2*Length)
67 -- A1,A2 being the two factors of attenuation
68 -- Length is the distance of the isolated source
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.
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
81 ---Purpose: Creates a light source of the Positional type
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.
97 --------------------------------------------------------
98 ---Category: Methods to modify the Attributes of the Light
99 --------------------------------------------------------
101 SetPosition ( me : mutable; X,Y,Z : Coordinate ) is redefined;
103 ---Purpose: Defines the position of the light source.
105 SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from V3d is static;
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.
111 ---------------------------------------------------
112 ---Category: Displaying methods
113 ---------------------------------------------------
115 Display(me: mutable; aView: View from V3d;
116 Representation : TypeOfRepresentation)
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
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.
130 ---------------------------------------------------
131 ---Category: Inquire methods
132 ---------------------------------------------------
134 Position ( me; X,Y,Z : out Coordinate ) is redefined static;
136 ---Purpose : Returns the position of the light source.
138 Attenuation ( me; A1,A2 : out Coefficient ) is static;
140 ---Purpose : Returns the attenuation factors A1,A2 of the light
141 -- source used at construction time.
143 -----------------------------------------
144 ---Category: Private or Protected methods
145 -----------------------------------------
147 Symbol ( me ; gsymbol : Group from Graphic3d ;
148 aView : View from V3d ) is redefined static private;
150 ---Purpose: Defined the representation of the positional light source.