1 -- Created on: 1995-10-09
2 -- Created by: Arnaud BOUZY/Odile Olivier
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 -- Modified by: rob Wed Feb 11 -> Size of Trihedron
18 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
19 -- the restricted NameOfColor.
20 -- GG : IMP120100 Add SetTextColor() methods.
21 -- SetArrowColor() methods.
24 class Trihedron from AIS inherits InteractiveObject from AIS
26 ---Purpose: Create a selectable trihedron
27 -- there are 4 modes of selection :
28 -- mode = 0 to select triedron ,priority = 1
29 -- mode = 1 to select its origine ,priority = 5
30 -- mode = 2 to select its axis ,priority = 3
31 -- mode = 3 to select its planes ,priority = 2
32 -- a trihedron has 1 origine,3 axes,3 planes.
34 -- For the presentation of trihedra, the default unit of
35 -- length is the millimetre, and the default value for the
36 -- representation of the axes is 100. If you modify these
37 -- dimensions, you must temporarily recover the Drawer.
38 -- From inside it, you take the aspect in which the values
39 -- for length are stocked. For trihedra, this is
40 -- AIS_Drawer_FirstAxisAspect. You change the
41 -- values inside this Aspect and recalculate the presentation.
42 -- If you want to use extended selection modes, different than 0,
43 -- you should take care of removing of the shapes from the interactive
44 -- context that has been computed for selection; it might be necessary
45 -- when you change selection mode. You can use methods Axis, Point,
46 -- Plane to retrieve the shapes.
49 Axis2Placement from Geom,
50 Presentation from Prs3d,
51 PresentationManager3d from PrsMgr,
52 NameOfColor from Quantity,
54 Selection from SelectMgr,
56 Transformation from Geom,
60 KindOfInteractive from AIS,
61 InteractiveContext from AIS,
62 Array1OfPnt from TColgp,
66 Create(aComponent : Axis2Placement from Geom)
67 returns Trihedron from AIS;
68 --- Purpose: Initializes a trihedron entity.
70 Component(me) returns any Axis2Placement from Geom
72 ---Purpose: Returns the right-handed coordinate system set in SetComponent.
76 SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
78 ---Purpose: Constructs the right-handed coordinate system aComponent.
80 HasOwnSize(me) returns Boolean from Standard;
81 ---Purpose: Returns true if the trihedron object has a size other
82 -- than the default size of 100 mm. along each axis.
85 SetSize(me:mutable;aValue : Real from Standard);
86 ---Purpose: Sets the size aValue for the trihedron object.
87 -- The default value is 100 mm.
89 UnsetSize(me:mutable);
90 ---Purpose: Removes any non-default settings for size of this
93 Size(me) returns Real from Standard;
96 XAxis (me) returns Axis from AIS;
97 ---Purpose : Returns the "XAxis".
99 YAxis (me) returns Axis from AIS;
100 ---Purpose : Returns the "YAxis".
102 Axis (me) returns Axis from AIS;
103 ---Purpose : Returns the main Axis.
105 Position (me) returns Point from AIS;
106 ---Purpose : Returns the origine.
108 XYPlane (me) returns Plane from AIS;
109 ---Purpose : Returns the "XYPlane".
111 XZPlane (me) returns Plane from AIS;
112 ---Purpose : Returns the "XZPlane".
114 YZPlane (me) returns Plane from AIS;
115 ---Purpose : Returns the "YZPlane".
118 SetContext(me:mutable; aCtx : InteractiveContext from AIS)
120 ---Purpose: connection to <aCtx> default drawer implies a recomputation
121 -- of SubObjects values.
123 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
124 ---Purpose: Returns true if the display mode selected, aMode, is
125 -- valid for trihedron datums.
127 Compute(me : mutable;
128 aPresentationManager: PresentationManager3d from PrsMgr;
129 aPresentation : Presentation from Prs3d;
130 aMode : Integer from Standard = 0)
131 is redefined static private;
134 aProjector: Projector from Prs3d;
135 aPresentation: Presentation from Prs3d)
136 is redefined static private;
140 Compute(me : mutable;
141 aProjector : Projector from Prs3d;
142 aTrsf : Transformation from Geom;
143 aPresentation : Presentation from Prs3d)
145 ---Purpose: Computes the presentation according to a point of view
146 -- given by <aProjector>.
147 -- To be Used when the associated degenerated Presentations
148 -- have been transformed by <aTrsf> which is not a Pure
149 -- Translation. The HLR Prs can't be deducted automatically
150 -- WARNING :<aTrsf> must be applied
151 -- to the object to display before computation !!!
153 -- Methods from PresentableObject
155 SetLocation(me : mutable;
156 aLoc : Location from TopLoc)
159 -- Methods from SelectableObject
161 ComputeSelection(me : mutable;
162 aSelection : Selection from SelectMgr;
163 aMode : Integer from Standard)is private;
165 -- Methods from InteractiveObject
167 Signature(me) returns Integer from Standard is redefined;
168 ---Purpose: Returns index 3, selection of the planes XOY, YOZ, XOZ.
169 Type(me) returns KindOfInteractive from AIS is redefined;
170 ---Purpose: Indicates that the type of Interactive Object is datum.
171 SetColor(me :mutable; aColor : NameOfColor from Quantity)
172 is redefined static ;
174 SetColor(me :mutable; aColor : Color from Quantity)
175 is redefined static ;
176 ---Purpose: Sets the color aColor for this trihedron object.
177 SetTextColor(me :mutable; aColor : NameOfColor from Quantity)
180 HasTextColor(me) returns Boolean from Standard
183 TextColor(me) returns NameOfColor from Quantity
186 SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
189 HasArrowColor(me) returns Boolean from Standard
192 ArrowColor(me) returns NameOfColor from Quantity
195 ExtremityPoints(me;TheExtrem : in out Array1OfPnt from TColgp);
196 ---Purpose: Returns the four extremities of the trihedron from the
197 -- array of points, TheExtrem.
200 UnsetColor(me:mutable) is redefined static;
201 ---Purpose: Removes the settings for color.
202 UnsetWidth(me:mutable) is redefined static;
203 ---Purpose: Removes the non-default settings for width set in SetWidth.
205 LoadSubObjects(me:mutable) is static private;
209 myComponent : Axis2Placement from Geom;
210 myShapes : InteractiveObject from AIS [7];
211 myHasOwnSize: Boolean from Standard;
212 myHasOwnTextColor : Boolean from Standard;
213 myOwnTextColor: NameOfColor from Quantity;
214 myHasOwnArrowColor : Boolean from Standard;
215 myOwnArrowColor: NameOfColor from Quantity;
217 end Trihedron from AIS;