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
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.
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.
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.
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
26 class Plane from AIS inherits InteractiveObject from AIS
28 ---Purpose: Constructs plane datums to be used in construction of
33 Presentation from Prs3d,
34 PresentationManager3d from PrsMgr,
35 NameOfColor from Quantity,
37 Selection from SelectMgr,
40 Transformation from Geom,
41 PresentationManager2d from PrsMgr,
42 GraphicObject from Graphic2d,
43 NameOfMaterial from Graphic3d,
45 Axis2Placement from Geom,
46 InteractiveContext from AIS,
47 KindOfInteractive from AIS
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.
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.
67 Create(aComponent : Plane from Geom;
68 aCenter : 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.
78 Create(aComponent : Axis2Placement from Geom;
79 aPlaneType : TypeOfPlane from AIS;
80 aCurrentMode : Boolean from Standard = Standard_False)
81 returns mutable Plane from AIS;
84 ---Category: Size Modifications...
86 SetSize(me:mutable;aValue:Real from Standard);
87 ---Purpose: Same value for x and y directions
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.
93 UnsetSize(me:mutable) ;
95 Size(me;X,Y:out Real from Standard) returns Boolean from Standard;
97 HasOwnSize(me) returns Boolean from Standard;
102 Signature(me) returns Integer from Standard is redefined;
104 Type(me) returns KindOfInteractive from AIS is redefined;
108 Component(me: mutable) returns Plane from Geom
110 ---Purpose: Returns the component specified in SetComponent.
112 ---C++: return const&
114 SetComponent(me: mutable;aComponent : Plane from Geom) is static;
115 ---Purpose: Creates an instance of the plane aComponent.
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
127 SetPlaneAttributes(me: mutable;
128 aComponent : Plane from Geom;
129 aCenter : Pnt from gp;
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.
137 Center (me) returns Pnt from gp;
138 ---Purpose: Returns the coordinates of the center point.
140 ---C++: return const&
142 SetCenter (me: mutable; aCenter : Pnt from gp);
144 -- Provides settings for the center aCenter other than (0, 0, 0).
147 SetAxis2Placement(me: mutable;
148 aComponent : Axis2Placement from Geom;
149 aPlaneType : TypeOfPlane from AIS)
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}.
160 Axis2Placement(me: mutable) returns Axis2Placement from Geom
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.
166 TypeOfPlane (me : mutable) returns TypeOfPlane from AIS;
167 ---Purpose: Returns the type of plane - xy, yz, xz or unknown.
171 IsXYZPlane (me : mutable) returns Boolean from Standard;
172 ---Purpose: Returns the type of plane - xy, yz, or xz.
175 CurrentMode (me : mutable) returns Boolean from Standard;
176 ---Purpose: Returns the non-default current display mode set by SetCurrentMode.
179 SetCurrentMode (me : mutable; aCurrentMode : Boolean from Standard ) ;
181 -- Allows you to provide settings for a non-default
182 -- current display mode.
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.
189 SetContext(me:mutable; aCtx : InteractiveContext from AIS) is redefined;
190 ---Purpose: connection to <aCtx> default drawer implies a recomputation of Frame values.
192 -- Methods from PresentableObject
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;
201 aProjector: Projector from Prs3d;
202 aPresentation: mutable Presentation from Prs3d)
203 is redefined virtual private;
206 aPresentationManager: PresentationManager2d from PrsMgr;
207 aPresentation: mutable GraphicObject from Graphic2d;
208 aMode: Integer from Standard = 0)
209 is redefined virtual private;
211 Compute(me : mutable;
212 aProjector : Projector from Prs3d;
213 aTrsf : Transformation from Geom;
214 aPresentation : mutable Presentation from Prs3d)
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 !!!
224 -- Methods from SelectableObject
226 ComputeSelection(me : mutable;
227 aSelection : mutable Selection from SelectMgr;
228 aMode : Integer from Standard) is redefined virtual;
230 -- Methods from InteractiveObject
232 SetColor(me :mutable; aColor : NameOfColor from Quantity)
235 SetColor(me :mutable; aColor : Color from Quantity)
238 UnsetColor(me:mutable) is redefined static;
240 ComputeFrame(me: mutable)
243 ComputeFields(me: mutable)
246 InitDrawerAttributes(me:mutable) is private;
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;