7fd59977 |
1 | -- File: AIS_Plane.cdl |
2 | -- Created: Wed Aug 2 16:18:48 1995 |
3 | -- Author: Arnaud BOUZY/Odile Olivier |
4 | -- <adn@houblon> |
5 | -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead |
6 | -- the restricted NameOfColor. |
7 | --Modified by rob Wed 11 feb 98 : add Size Methods |
8 | ---Copyright: Matra Datavision 1995 |
9 | |
10 | |
11 | class Plane from AIS inherits InteractiveObject from AIS |
12 | |
13 | ---Purpose: Constructs plane datums to be used in construction of |
14 | -- composite shapes. |
15 | |
16 | uses |
17 | Plane from Geom, |
18 | Presentation from Prs3d, |
19 | PresentationManager3d from PrsMgr, |
20 | NameOfColor from Quantity, |
21 | Color from Quantity, |
22 | Selection from SelectMgr, |
23 | Pnt from gp, |
24 | Projector from Prs3d, |
25 | Transformation from Geom, |
26 | PresentationManager2d from PrsMgr, |
27 | GraphicObject from Graphic2d, |
28 | NameOfMaterial from Graphic3d, |
29 | TypeOfPlane from AIS, |
30 | Axis2Placement from Geom, |
31 | InteractiveContext from AIS, |
32 | KindOfInteractive from AIS |
33 | |
34 | is |
35 | Create(aComponent : Plane from Geom; |
36 | aCurrentMode : Boolean from Standard = Standard_False) |
37 | returns mutable Plane from AIS; |
38 | ---Purpose: initializes the plane aComponent. If |
39 | -- the mode aCurrentMode equals true, the drawing |
40 | -- tool, "Drawer" is not initialized. |
41 | |
42 | Create(aComponent : Plane from Geom; |
43 | aCenter : Pnt from gp; |
44 | aCurrentMode : Boolean from Standard = Standard_False) |
45 | returns mutable Plane from AIS; |
46 | --- Purpose: initializes the plane aComponent and |
47 | -- the point aCenter. If the mode aCurrentMode |
48 | -- equals true, the drawing tool, "Drawer" is not |
49 | -- initialized. aCurrentMode equals true, the drawing |
50 | -- tool, "Drawer" is not initialized. |
51 | |
52 | Create(aComponent : Plane from Geom; |
53 | aCenter : Pnt from gp; |
54 | aPmin : Pnt from gp; |
55 | aPmax : Pnt from gp; |
56 | aCurrentMode : Boolean from Standard = Standard_False) |
57 | returns mutable Plane from AIS; |
58 | ---Purpose: initializes the plane aComponent, the |
59 | -- point aCenter, and the minimum and maximum |
60 | -- points, aPmin and aPmax. If the mode |
61 | -- aCurrentMode equals true, the drawing tool, "Drawer" is not initialized. |
62 | |
63 | Create(aComponent : Axis2Placement from Geom; |
64 | aPlaneType : TypeOfPlane from AIS; |
65 | aCurrentMode : Boolean from Standard = Standard_False) |
66 | returns mutable Plane from AIS; |
67 | |
68 | |
69 | ---Category: Size Modifications... |
70 | |
71 | SetSize(me:mutable;aValue:Real from Standard); |
72 | ---Purpose: Same value for x and y directions |
73 | |
74 | SetSize(me:mutable;Xval,YVal:Real from Standard); |
75 | ---Purpose: Sets the size defined by the length along the X axis |
76 | -- XVal and the length along the Y axis YVal. |
77 | |
78 | UnsetSize(me:mutable) ; |
79 | |
80 | Size(me;X,Y:out Real from Standard) returns Boolean from Standard; |
81 | |
82 | HasOwnSize(me) returns Boolean from Standard; |
83 | ---C++: inline |
84 | |
85 | |
86 | |
87 | Signature(me) returns Integer from Standard is redefined; |
88 | |
89 | Type(me) returns KindOfInteractive from AIS is redefined; |
90 | |
91 | |
92 | |
93 | Component(me: mutable) returns Plane from Geom |
94 | is static; |
95 | ---Purpose: Returns the component specified in SetComponent. |
96 | ---C++: inline |
97 | ---C++: return const& |
98 | |
99 | SetComponent(me: mutable;aComponent : Plane from Geom) is static; |
100 | ---Purpose: Creates an instance of the plane aComponent. |
101 | |
102 | PlaneAttributes(me: mutable; |
103 | aComponent : out Plane from Geom; |
104 | aCenter : out Pnt from gp; |
105 | aPmin : out Pnt from gp; |
106 | aPmax : out Pnt from gp) |
107 | returns Boolean from Standard; |
108 | ---Purpose: Returns the settings for the selected plane |
109 | -- aComponent, provided in SetPlaneAttributes. |
110 | -- These include the points aCenter, aPmin, and aPmax |
111 | |
112 | SetPlaneAttributes(me: mutable; |
113 | aComponent : Plane from Geom; |
114 | aCenter : Pnt from gp; |
115 | aPmin : Pnt from gp; |
116 | aPmax : Pnt from gp) |
117 | is static; |
118 | ---Purpose: Allows you to provide settings other than default ones |
119 | -- for the selected plane. These include: center point |
120 | -- aCenter, maximum aPmax and minimum aPmin. |
121 | |
122 | Center (me) returns Pnt from gp; |
123 | ---Purpose: Returns the coordinates of the center point. |
124 | ---C++: inline |
125 | ---C++: return const& |
126 | |
127 | SetCenter (me: mutable; aCenter : Pnt from gp); |
128 | ---Purpose: |
129 | -- Provides settings for the center aCenter other than (0, 0, 0). |
130 | ---C++: inline |
131 | |
132 | SetAxis2Placement(me: mutable; |
133 | aComponent : Axis2Placement from Geom; |
134 | aPlaneType : TypeOfPlane from AIS) |
135 | is static; |
136 | ---Purpose: Allows you to provide settings for the position and |
137 | -- direction of one of the plane's axes, aComponent, in |
138 | -- 3D space. The coordinate system used is |
139 | -- right-handed, and the type of plane aPlaneType is one of: |
140 | -- - AIS_ TOPL_Unknown |
141 | -- - AIS_ TOPL_XYPlane |
142 | -- - AIS_ TOPL_XZPlane |
143 | -- - AIS_ TOPL_YZPlane}. |
144 | |
145 | Axis2Placement(me: mutable) returns Axis2Placement from Geom |
146 | is static; |
147 | ---Purpose: Returns the position of the plane's axis2 system |
148 | -- identifying the x, y, or z axis and giving the plane a |
149 | -- direction in 3D space. An axis2 system is a right-handed coordinate system. |
150 | |
151 | TypeOfPlane (me : mutable) returns TypeOfPlane from AIS; |
152 | ---Purpose: Returns the type of plane - xy, yz, xz or unknown. |
153 | ---C++: inline |
154 | |
155 | |
156 | IsXYZPlane (me : mutable) returns Boolean from Standard; |
157 | ---Purpose: Returns the type of plane - xy, yz, or xz. |
158 | ---C++: inline |
159 | |
160 | CurrentMode (me : mutable) returns Boolean from Standard; |
161 | ---Purpose: Returns the non-default current display mode set by SetCurrentMode. |
162 | ---C++: inline |
163 | |
164 | SetCurrentMode (me : mutable; aCurrentMode : Boolean from Standard ) ; |
165 | ---Purpose: |
166 | -- Allows you to provide settings for a non-default |
167 | -- current display mode. |
168 | ---C++: inline |
169 | |
170 | AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard |
171 | is redefined virtual; |
172 | ---Purpose: Returns true if the display mode selected, aMode, is valid for planes. |
173 | |
174 | SetContext(me:mutable; aCtx : InteractiveContext from AIS) is redefined; |
175 | ---Purpose: connection to <aCtx> default drawer implies a recomputation of Frame values. |
176 | |
177 | -- Methods from PresentableObject |
178 | |
179 | Compute(me : mutable; |
180 | aPresentationManager: PresentationManager3d from PrsMgr; |
181 | aPresentation : mutable Presentation from Prs3d; |
182 | aMode : Integer from Standard = 0) |
183 | is redefined virtual private; |
184 | |
185 | Compute(me:mutable; |
186 | aProjector: Projector from Prs3d; |
187 | aPresentation: mutable Presentation from Prs3d) |
188 | is redefined virtual private; |
189 | |
190 | Compute(me:mutable; |
191 | aPresentationManager: PresentationManager2d from PrsMgr; |
192 | aPresentation: mutable GraphicObject from Graphic2d; |
193 | aMode: Integer from Standard = 0) |
194 | is redefined virtual private; |
195 | |
196 | Compute(me : mutable; |
197 | aProjector : Projector from Prs3d; |
198 | aTrsf : Transformation from Geom; |
199 | aPresentation : mutable Presentation from Prs3d) |
200 | is redefined; |
201 | ---Purpose: computes the presentation according to a point of view |
202 | -- given by <aProjector>. |
203 | -- To be Used when the associated degenerated Presentations |
204 | -- have been transformed by <aTrsf> which is not a Pure |
205 | -- Translation. The HLR Prs can't be deducted automatically |
206 | -- WARNING :<aTrsf> must be applied |
207 | -- to the object to display before computation !!! |
208 | |
209 | -- Methods from SelectableObject |
210 | |
211 | ComputeSelection(me : mutable; |
212 | aSelection : mutable Selection from SelectMgr; |
213 | aMode : Integer from Standard) is redefined virtual; |
214 | |
215 | -- Methods from InteractiveObject |
216 | |
217 | SetColor(me :mutable; aColor : NameOfColor from Quantity) |
218 | is redefined static; |
219 | |
220 | SetColor(me :mutable; aColor : Color from Quantity) |
221 | is redefined static; |
222 | |
223 | UnsetColor(me:mutable) is redefined static; |
224 | |
225 | ComputeFrame(me: mutable) |
226 | is private; |
227 | |
228 | ComputeFields(me: mutable) |
229 | is private; |
230 | |
231 | InitDrawerAttributes(me:mutable) is private; |
232 | |
233 | fields |
234 | |
235 | myComponent : Plane from Geom; |
236 | myAx2 : Axis2Placement from Geom; |
237 | myCenter : Pnt from gp; |
238 | myPmin : Pnt from gp; |
239 | myPmax : Pnt from gp; |
240 | myCurrentMode : Boolean from Standard; |
241 | myAutomaticPosition : Boolean from Standard; |
242 | myTypeOfPlane : TypeOfPlane from AIS; |
243 | myIsXYZPlane : Boolean from Standard; |
244 | myHasOwnSize : Boolean from Standard; |
245 | |
246 | end Plane; |