b311480e |
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 | |
7fd59977 |
21 | -- Update: FDA Oct 15 1994 |
22 | -- ZOV - Mars 30 1998 |
7fd59977 |
23 | |
24 | |
25 | class DirectionalLight from V3d |
26 | |
27 | ---Purpose: Create and modify a directional light source |
28 | -- in a viewer. |
29 | |
30 | |
31 | |
32 | inherits PositionLight from V3d |
33 | |
34 | uses |
35 | |
36 | Viewer from V3d, |
37 | TypeOfOrientation from V3d, |
38 | TypeOfRepresentation from V3d, |
39 | Coordinate from V3d, |
40 | NameOfColor from Quantity, |
41 | Parameter from Quantity, |
42 | Vertex from Graphic3d, |
43 | Structure from Graphic3d, |
44 | Group from Graphic3d, |
45 | View from V3d |
46 | |
6942f04a |
47 | raises BadValue from V3d |
7fd59977 |
48 | |
49 | is |
50 | |
51 | Create ( VM : mutable Viewer ; |
52 | Direction : TypeOfOrientation = V3d_XposYposZpos; |
53 | Color : NameOfColor = Quantity_NOC_WHITE; |
54 | Headlight : Boolean from Standard = Standard_False) |
55 | returns mutable DirectionalLight ; |
56 | ---Level: Public |
57 | ---Purpose : Creates a directional light source in the viewer. |
58 | |
59 | Create ( VM : mutable Viewer ; Xt,Yt,Zt : Coordinate; |
60 | Xp,Yp,Zp : Coordinate; |
61 | Color : NameOfColor = Quantity_NOC_WHITE; |
62 | Headlight : Boolean from Standard = Standard_False) |
63 | returns mutable DirectionalLight; |
64 | ---Level: Public |
65 | ---Purpose: Creates a directional light source in the viewer. |
66 | -- Xt,Yt,Zt : Coordinate of light source Target. |
67 | -- Xp,Yp,Zp : Coordinate of light source Position. |
68 | -- The others parameters describe before. |
69 | |
70 | -------------------------------------------------------- |
71 | ---Category: Methods to modify the attributes of the light |
72 | -------------------------------------------------------- |
73 | |
74 | SetDirection ( me : mutable; Direction : TypeOfOrientation ) is static; |
75 | ---Level: Public |
76 | ---Purpose : Defines the direction of the light source |
77 | -- by a predefined orientation. |
78 | |
6942f04a |
79 | SetDirection ( me : mutable; Xm, Ym, Zm : Parameter ) raises BadValue from V3d is static; |
7fd59977 |
80 | ---Level: Public |
81 | ---Purpose : Defines the direction of the light source by the predefined |
82 | -- vector Xm,Ym,Zm. |
6942f04a |
83 | -- Warning: raises BadValue from V3d if the vector is null. |
7fd59977 |
84 | |
85 | SetDisplayPosition (me : mutable; X,Y,Z : Coordinate) is static; |
86 | ---Level: Public |
87 | ---Purpose: Defines the point of light source representation. |
88 | |
89 | SetPosition (me : mutable; Xp,Yp,Zp : Coordinate) is redefined; |
90 | ---Level: Public |
91 | ---Purpose: Calls SetDisplayPosition method. |
92 | |
93 | --------------------------------------------------- |
94 | ---Category: display methods |
95 | --------------------------------------------------- |
96 | |
97 | Display(me: mutable; aView: View from V3d; |
98 | Representation : TypeOfRepresentation) |
99 | is redefined static; |
100 | ---Level: Public |
101 | ---Purpose: Display the graphic structure of light source |
102 | -- in the choosen view. We have three type of representation |
103 | -- - SIMPLE : Only the light source is displayed. |
104 | -- - PARTIAL : The light source and the light space are |
105 | -- displayed. |
106 | -- - COMPLETE : The same representation as PARTIAL. |
107 | -- We can choose the "SAMELAST" as parameter of representation |
108 | -- In this case the graphic structure representation will be |
109 | -- the last displayed. |
110 | |
111 | --------------------------------------------------- |
112 | ---Category: Inquiry methods |
113 | --------------------------------------------------- |
114 | |
115 | Position ( me; X,Y,Z : out Coordinate ) is redefined; |
116 | ---Level: Public |
117 | ---Purpose: Calls DisplayPosition method. |
118 | |
119 | DisplayPosition ( me; X,Y,Z : out Coordinate ) is static; |
120 | ---Level: Public |
121 | ---Purpose: Returns the choosen position to represent the light |
122 | -- source. |
123 | |
124 | Direction ( me; Vx,Vy,Vz : out Parameter ) is static; |
125 | ---Level: Public |
126 | ---Purpose : Returns the Vx,Vy,Vz direction of the light source. |
127 | |
128 | ----------------------------------------- |
129 | ---Category: Private or Protected methods |
130 | ----------------------------------------- |
131 | |
132 | Symbol ( me ; gsymbol : mutable Group from Graphic3d ; |
133 | aView : View from V3d ) is redefined static private; |
134 | ---Level: Internal |
135 | ---Purpose: Defines the representation of the directional light source. |
136 | |
137 | fields |
138 | |
139 | MyDisplayPosition: Vertex from Graphic3d; |
140 | |
141 | end DirectionalLight; |
142 | |