1 -- File: AIS_Trihedron.cdl
2 -- Created: Mon Oct 9 16:23:38 1995
3 -- Author: Arnaud BOUZY/Odile Olivier
5 -- Modified by: rob Wed Feb 11 -> Size of Trihedron
6 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
7 -- the restricted NameOfColor.
8 -- GG : IMP120100 Add SetTextColor() methods.
9 -- SetArrowColor() methods.
11 ---Copyright: Matra Datavision 1995
13 class Trihedron from AIS inherits InteractiveObject from AIS
15 ---Purpose: Create a selectable trihedron
16 -- there are 4 modes of selection :
17 -- mode = 0 to select triedron ,priority = 1
18 -- mode = 1 to select its origine ,priority = 5
19 -- mode = 2 to select its axis ,priority = 3
20 -- mode = 3 to select its planes ,priority = 2
21 -- a trihedron has 1 origine,3 axes,3 planes.
23 -- For the presentation of trihedra, the default unit of
24 -- length is the millimetre, and the default value for the
25 -- representation of the axes is 100. If you modify these
26 -- dimensions, you must temporarily recover the Drawer.
27 -- From inside it, you take the aspect in which the values
28 -- for length are stocked. For trihedra, this is
29 -- AIS_Drawer_FirstAxisAspect. You change the
30 -- values inside this Aspect and recalculate the presentation.
31 -- If you want to use extended selection modes, different than 0,
32 -- you should take care of removing of the shapes from the interactive
33 -- context that has been computed for selection; it might be necessary
34 -- when you change selection mode. You can use methods Axis, Point,
35 -- Plane to retrieve the shapes.
38 Axis2Placement from Geom,
39 Presentation from Prs3d,
40 PresentationManager3d from PrsMgr,
41 NameOfColor from Quantity,
43 Selection from SelectMgr,
45 Transformation from Geom,
46 PresentationManager2d from PrsMgr,
47 GraphicObject from Graphic2d,
51 KindOfInteractive from AIS,
52 InteractiveContext from AIS,
53 Array1OfPnt from TColgp,
57 Create(aComponent : Axis2Placement from Geom)
58 returns mutable Trihedron from AIS;
59 --- Purpose: Initializes a trihedron entity.
61 Component(me) returns any Axis2Placement from Geom
63 ---Purpose: Returns the right-handed coordinate system set in SetComponent.
67 SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
69 ---Purpose: Constructs the right-handed coordinate system aComponent.
71 HasOwnSize(me) returns Boolean from Standard;
72 ---Purpose: Returns true if the trihedron object has a size other
73 -- than the default size of 100 mm. along each axis.
76 SetSize(me:mutable;aValue : Real from Standard);
77 ---Purpose: Sets the size aValue for the trihedron object.
78 -- The default value is 100 mm.
80 UnsetSize(me:mutable);
81 ---Purpose: Removes any non-default settings for size of this
84 Size(me) returns Real from Standard;
87 XAxis (me) returns Axis from AIS;
88 ---Purpose : Returns the "XAxis".
90 YAxis (me) returns Axis from AIS;
91 ---Purpose : Returns the "YAxis".
93 Axis (me) returns Axis from AIS;
94 ---Purpose : Returns the main Axis.
96 Position (me) returns Point from AIS;
97 ---Purpose : Returns the origine.
99 XYPlane (me) returns Plane from AIS;
100 ---Purpose : Returns the "XYPlane".
102 XZPlane (me) returns Plane from AIS;
103 ---Purpose : Returns the "XZPlane".
105 YZPlane (me) returns Plane from AIS;
106 ---Purpose : Returns the "YZPlane".
109 SetContext(me:mutable; aCtx : InteractiveContext from AIS)
111 ---Purpose: connection to <aCtx> default drawer implies a recomputation
112 -- of SubObjects values.
114 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
115 ---Purpose: Returns true if the display mode selected, aMode, is
116 -- valid for trihedron datums.
118 Compute(me : mutable;
119 aPresentationManager: PresentationManager3d from PrsMgr;
120 aPresentation : mutable Presentation from Prs3d;
121 aMode : Integer from Standard = 0)
122 is redefined static private;
125 aProjector: Projector from Prs3d;
126 aPresentation: mutable Presentation from Prs3d)
127 is redefined static private;
130 aPresentationManager: PresentationManager2d from PrsMgr;
131 aPresentation: mutable GraphicObject from Graphic2d;
132 aMode: Integer from Standard = 0)
133 is redefined static private;
135 Compute(me : mutable;
136 aProjector : Projector from Prs3d;
137 aTrsf : Transformation from Geom;
138 aPresentation : mutable Presentation from Prs3d)
140 ---Purpose: Computes the presentation according to a point of view
141 -- given by <aProjector>.
142 -- To be Used when the associated degenerated Presentations
143 -- have been transformed by <aTrsf> which is not a Pure
144 -- Translation. The HLR Prs can't be deducted automatically
145 -- WARNING :<aTrsf> must be applied
146 -- to the object to display before computation !!!
148 -- Methods from PresentableObject
150 SetLocation(me : mutable;
151 aLoc : Location from TopLoc)
154 -- Methods from SelectableObject
156 ComputeSelection(me : mutable;
157 aSelection : mutable Selection from SelectMgr;
158 aMode : Integer from Standard)is private;
160 -- Methods from InteractiveObject
162 Signature(me) returns Integer from Standard is redefined;
163 ---Purpose: Returns index 3, selection of the planes XOY, YOZ, XOZ.
164 Type(me) returns KindOfInteractive from AIS is redefined;
165 ---Purpose: Indicates that the type of Interactive Object is datum.
166 SetColor(me :mutable; aColor : NameOfColor from Quantity)
167 is redefined static ;
169 SetColor(me :mutable; aColor : Color from Quantity)
170 is redefined static ;
171 ---Purpose: Sets the color aColor for this trihedron object.
172 SetTextColor(me :mutable; aColor : NameOfColor from Quantity)
175 HasTextColor(me) returns Boolean from Standard
178 TextColor(me) returns NameOfColor from Quantity
181 SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
184 HasArrowColor(me) returns Boolean from Standard
187 ArrowColor(me) returns NameOfColor from Quantity
190 ExtremityPoints(me;TheExtrem : in out Array1OfPnt from TColgp);
191 ---Purpose: Returns the four extremities of the trihedron from the
192 -- array of points, TheExtrem.
195 UnsetColor(me:mutable) is redefined static;
196 ---Purpose: Removes the settings for color.
197 UnsetWidth(me:mutable) is redefined static;
198 ---Purpose: Removes the non-default settings for width set in SetWidth.
200 LoadSubObjects(me:mutable) is static private;
204 myComponent : Axis2Placement from Geom;
205 myShapes : InteractiveObject from AIS [7];
206 myHasOwnSize: Boolean from Standard;
207 myHasOwnTextColor : Boolean from Standard;
208 myOwnTextColor: NameOfColor from Quantity;
209 myHasOwnArrowColor : Boolean from Standard;
210 myOwnArrowColor: NameOfColor from Quantity;
212 end Trihedron from AIS;