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