1 -- Created on: 1995-10-09
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 -- Modified by: rob Wed Feb 11 -> Size of Trihedron
22 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
23 -- the restricted NameOfColor.
24 -- GG : IMP120100 Add SetTextColor() methods.
25 -- SetArrowColor() methods.
28 class Trihedron from AIS inherits InteractiveObject from AIS
30 ---Purpose: Create a selectable trihedron
31 -- there are 4 modes of selection :
32 -- mode = 0 to select triedron ,priority = 1
33 -- mode = 1 to select its origine ,priority = 5
34 -- mode = 2 to select its axis ,priority = 3
35 -- mode = 3 to select its planes ,priority = 2
36 -- a trihedron has 1 origine,3 axes,3 planes.
38 -- For the presentation of trihedra, the default unit of
39 -- length is the millimetre, and the default value for the
40 -- representation of the axes is 100. If you modify these
41 -- dimensions, you must temporarily recover the Drawer.
42 -- From inside it, you take the aspect in which the values
43 -- for length are stocked. For trihedra, this is
44 -- AIS_Drawer_FirstAxisAspect. You change the
45 -- values inside this Aspect and recalculate the presentation.
46 -- If you want to use extended selection modes, different than 0,
47 -- you should take care of removing of the shapes from the interactive
48 -- context that has been computed for selection; it might be necessary
49 -- when you change selection mode. You can use methods Axis, Point,
50 -- Plane to retrieve the shapes.
53 Axis2Placement from Geom,
54 Presentation from Prs3d,
55 PresentationManager3d from PrsMgr,
56 NameOfColor from Quantity,
58 Selection from SelectMgr,
60 Transformation from Geom,
61 PresentationManager2d from PrsMgr,
62 GraphicObject from Graphic2d,
66 KindOfInteractive from AIS,
67 InteractiveContext from AIS,
68 Array1OfPnt from TColgp,
72 Create(aComponent : Axis2Placement from Geom)
73 returns mutable Trihedron from AIS;
74 --- Purpose: Initializes a trihedron entity.
76 Component(me) returns any Axis2Placement from Geom
78 ---Purpose: Returns the right-handed coordinate system set in SetComponent.
82 SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
84 ---Purpose: Constructs the right-handed coordinate system aComponent.
86 HasOwnSize(me) returns Boolean from Standard;
87 ---Purpose: Returns true if the trihedron object has a size other
88 -- than the default size of 100 mm. along each axis.
91 SetSize(me:mutable;aValue : Real from Standard);
92 ---Purpose: Sets the size aValue for the trihedron object.
93 -- The default value is 100 mm.
95 UnsetSize(me:mutable);
96 ---Purpose: Removes any non-default settings for size of this
99 Size(me) returns Real from Standard;
102 XAxis (me) returns Axis from AIS;
103 ---Purpose : Returns the "XAxis".
105 YAxis (me) returns Axis from AIS;
106 ---Purpose : Returns the "YAxis".
108 Axis (me) returns Axis from AIS;
109 ---Purpose : Returns the main Axis.
111 Position (me) returns Point from AIS;
112 ---Purpose : Returns the origine.
114 XYPlane (me) returns Plane from AIS;
115 ---Purpose : Returns the "XYPlane".
117 XZPlane (me) returns Plane from AIS;
118 ---Purpose : Returns the "XZPlane".
120 YZPlane (me) returns Plane from AIS;
121 ---Purpose : Returns the "YZPlane".
124 SetContext(me:mutable; aCtx : InteractiveContext from AIS)
126 ---Purpose: connection to <aCtx> default drawer implies a recomputation
127 -- of SubObjects values.
129 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
130 ---Purpose: Returns true if the display mode selected, aMode, is
131 -- valid for trihedron datums.
133 Compute(me : mutable;
134 aPresentationManager: PresentationManager3d from PrsMgr;
135 aPresentation : mutable Presentation from Prs3d;
136 aMode : Integer from Standard = 0)
137 is redefined static private;
140 aProjector: Projector from Prs3d;
141 aPresentation: mutable Presentation from Prs3d)
142 is redefined static private;
145 aPresentationManager: PresentationManager2d from PrsMgr;
146 aPresentation: mutable GraphicObject from Graphic2d;
147 aMode: Integer from Standard = 0)
148 is redefined static private;
150 Compute(me : mutable;
151 aProjector : Projector from Prs3d;
152 aTrsf : Transformation from Geom;
153 aPresentation : mutable Presentation from Prs3d)
155 ---Purpose: Computes the presentation according to a point of view
156 -- given by <aProjector>.
157 -- To be Used when the associated degenerated Presentations
158 -- have been transformed by <aTrsf> which is not a Pure
159 -- Translation. The HLR Prs can't be deducted automatically
160 -- WARNING :<aTrsf> must be applied
161 -- to the object to display before computation !!!
163 -- Methods from PresentableObject
165 SetLocation(me : mutable;
166 aLoc : Location from TopLoc)
169 -- Methods from SelectableObject
171 ComputeSelection(me : mutable;
172 aSelection : mutable Selection from SelectMgr;
173 aMode : Integer from Standard)is private;
175 -- Methods from InteractiveObject
177 Signature(me) returns Integer from Standard is redefined;
178 ---Purpose: Returns index 3, selection of the planes XOY, YOZ, XOZ.
179 Type(me) returns KindOfInteractive from AIS is redefined;
180 ---Purpose: Indicates that the type of Interactive Object is datum.
181 SetColor(me :mutable; aColor : NameOfColor from Quantity)
182 is redefined static ;
184 SetColor(me :mutable; aColor : Color from Quantity)
185 is redefined static ;
186 ---Purpose: Sets the color aColor for this trihedron object.
187 SetTextColor(me :mutable; aColor : NameOfColor from Quantity)
190 HasTextColor(me) returns Boolean from Standard
193 TextColor(me) returns NameOfColor from Quantity
196 SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
199 HasArrowColor(me) returns Boolean from Standard
202 ArrowColor(me) returns NameOfColor from Quantity
205 ExtremityPoints(me;TheExtrem : in out Array1OfPnt from TColgp);
206 ---Purpose: Returns the four extremities of the trihedron from the
207 -- array of points, TheExtrem.
210 UnsetColor(me:mutable) is redefined static;
211 ---Purpose: Removes the settings for color.
212 UnsetWidth(me:mutable) is redefined static;
213 ---Purpose: Removes the non-default settings for width set in SetWidth.
215 LoadSubObjects(me:mutable) is static private;
219 myComponent : Axis2Placement from Geom;
220 myShapes : InteractiveObject from AIS [7];
221 myHasOwnSize: Boolean from Standard;
222 myHasOwnTextColor : Boolean from Standard;
223 myOwnTextColor: NameOfColor from Quantity;
224 myHasOwnArrowColor : Boolean from Standard;
225 myOwnArrowColor: NameOfColor from Quantity;
227 end Trihedron from AIS;