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,
64 KindOfInteractive from AIS,
65 InteractiveContext from AIS,
66 Array1OfPnt from TColgp,
70 Create(aComponent : Axis2Placement from Geom)
71 returns mutable Trihedron from AIS;
72 --- Purpose: Initializes a trihedron entity.
74 Component(me) returns any Axis2Placement from Geom
76 ---Purpose: Returns the right-handed coordinate system set in SetComponent.
80 SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
82 ---Purpose: Constructs the right-handed coordinate system aComponent.
84 HasOwnSize(me) returns Boolean from Standard;
85 ---Purpose: Returns true if the trihedron object has a size other
86 -- than the default size of 100 mm. along each axis.
89 SetSize(me:mutable;aValue : Real from Standard);
90 ---Purpose: Sets the size aValue for the trihedron object.
91 -- The default value is 100 mm.
93 UnsetSize(me:mutable);
94 ---Purpose: Removes any non-default settings for size of this
97 Size(me) returns Real from Standard;
100 XAxis (me) returns Axis from AIS;
101 ---Purpose : Returns the "XAxis".
103 YAxis (me) returns Axis from AIS;
104 ---Purpose : Returns the "YAxis".
106 Axis (me) returns Axis from AIS;
107 ---Purpose : Returns the main Axis.
109 Position (me) returns Point from AIS;
110 ---Purpose : Returns the origine.
112 XYPlane (me) returns Plane from AIS;
113 ---Purpose : Returns the "XYPlane".
115 XZPlane (me) returns Plane from AIS;
116 ---Purpose : Returns the "XZPlane".
118 YZPlane (me) returns Plane from AIS;
119 ---Purpose : Returns the "YZPlane".
122 SetContext(me:mutable; aCtx : InteractiveContext from AIS)
124 ---Purpose: connection to <aCtx> default drawer implies a recomputation
125 -- of SubObjects values.
127 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
128 ---Purpose: Returns true if the display mode selected, aMode, is
129 -- valid for trihedron datums.
131 Compute(me : mutable;
132 aPresentationManager: PresentationManager3d from PrsMgr;
133 aPresentation : mutable Presentation from Prs3d;
134 aMode : Integer from Standard = 0)
135 is redefined static private;
138 aProjector: Projector from Prs3d;
139 aPresentation: mutable Presentation from Prs3d)
140 is redefined static private;
144 Compute(me : mutable;
145 aProjector : Projector from Prs3d;
146 aTrsf : Transformation from Geom;
147 aPresentation : mutable Presentation from Prs3d)
149 ---Purpose: Computes the presentation according to a point of view
150 -- given by <aProjector>.
151 -- To be Used when the associated degenerated Presentations
152 -- have been transformed by <aTrsf> which is not a Pure
153 -- Translation. The HLR Prs can't be deducted automatically
154 -- WARNING :<aTrsf> must be applied
155 -- to the object to display before computation !!!
157 -- Methods from PresentableObject
159 SetLocation(me : mutable;
160 aLoc : Location from TopLoc)
163 -- Methods from SelectableObject
165 ComputeSelection(me : mutable;
166 aSelection : mutable Selection from SelectMgr;
167 aMode : Integer from Standard)is private;
169 -- Methods from InteractiveObject
171 Signature(me) returns Integer from Standard is redefined;
172 ---Purpose: Returns index 3, selection of the planes XOY, YOZ, XOZ.
173 Type(me) returns KindOfInteractive from AIS is redefined;
174 ---Purpose: Indicates that the type of Interactive Object is datum.
175 SetColor(me :mutable; aColor : NameOfColor from Quantity)
176 is redefined static ;
178 SetColor(me :mutable; aColor : Color from Quantity)
179 is redefined static ;
180 ---Purpose: Sets the color aColor for this trihedron object.
181 SetTextColor(me :mutable; aColor : NameOfColor from Quantity)
184 HasTextColor(me) returns Boolean from Standard
187 TextColor(me) returns NameOfColor from Quantity
190 SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
193 HasArrowColor(me) returns Boolean from Standard
196 ArrowColor(me) returns NameOfColor from Quantity
199 ExtremityPoints(me;TheExtrem : in out Array1OfPnt from TColgp);
200 ---Purpose: Returns the four extremities of the trihedron from the
201 -- array of points, TheExtrem.
204 UnsetColor(me:mutable) is redefined static;
205 ---Purpose: Removes the settings for color.
206 UnsetWidth(me:mutable) is redefined static;
207 ---Purpose: Removes the non-default settings for width set in SetWidth.
209 LoadSubObjects(me:mutable) is static private;
213 myComponent : Axis2Placement from Geom;
214 myShapes : InteractiveObject from AIS [7];
215 myHasOwnSize: Boolean from Standard;
216 myHasOwnTextColor : Boolean from Standard;
217 myOwnTextColor: NameOfColor from Quantity;
218 myHasOwnArrowColor : Boolean from Standard;
219 myOwnArrowColor: NameOfColor from Quantity;
221 end Trihedron from AIS;