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,
51 Presentation from Prs3d,
52 PresentationManager3d from PrsMgr,
53 NameOfColor from Quantity,
55 Selection from SelectMgr,
57 Transformation from Geom,
61 KindOfInteractive from AIS,
62 InteractiveContext from AIS,
63 Array1OfPnt from TColgp,
67 Create(aComponent : Axis2Placement from Geom)
68 returns Trihedron from AIS;
69 --- Purpose: Initializes a trihedron entity.
71 Component(me) returns any Axis2Placement from Geom
73 ---Purpose: Returns the right-handed coordinate system set in SetComponent.
77 SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
79 ---Purpose: Constructs the right-handed coordinate system aComponent.
81 HasOwnSize(me) returns Boolean from Standard;
82 ---Purpose: Returns true if the trihedron object has a size other
83 -- than the default size of 100 mm. along each axis.
86 SetSize(me:mutable;aValue : Real from Standard);
87 ---Purpose: Sets the size aValue for the trihedron object.
88 -- The default value is 100 mm.
90 UnsetSize(me:mutable);
91 ---Purpose: Removes any non-default settings for size of this
94 Size(me) returns Real from Standard;
97 XAxis (me) returns Axis from AIS;
98 ---Purpose : Returns the "XAxis".
100 YAxis (me) returns Axis from AIS;
101 ---Purpose : Returns the "YAxis".
103 Axis (me) returns Axis from AIS;
104 ---Purpose : Returns the main Axis.
106 Position (me) returns Point from AIS;
107 ---Purpose : Returns the origine.
109 XYPlane (me) returns Plane from AIS;
110 ---Purpose : Returns the "XYPlane".
112 XZPlane (me) returns Plane from AIS;
113 ---Purpose : Returns the "XZPlane".
115 YZPlane (me) returns Plane from AIS;
116 ---Purpose : Returns the "YZPlane".
119 SetContext(me:mutable; aCtx : InteractiveContext from AIS)
121 ---Purpose: connection to <aCtx> default drawer implies a recomputation
122 -- of SubObjects values.
124 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
125 ---Purpose: Returns true if the display mode selected, aMode, is
126 -- valid for trihedron datums.
128 Compute(me : mutable;
129 aPresentationManager: PresentationManager3d from PrsMgr;
130 aPresentation : Presentation from Prs3d;
131 aMode : Integer from Standard = 0)
132 is redefined static private;
135 aProjector: Projector from Prs3d;
136 aPresentation: Presentation from Prs3d)
137 is redefined static private;
141 Compute(me : mutable;
142 aProjector : Projector from Prs3d;
143 aTrsf : Transformation from Geom;
144 aPresentation : Presentation from Prs3d)
146 ---Purpose: Computes the presentation according to a point of view
147 -- given by <aProjector>.
148 -- To be Used when the associated degenerated Presentations
149 -- have been transformed by <aTrsf> which is not a Pure
150 -- Translation. The HLR Prs can't be deducted automatically
151 -- WARNING :<aTrsf> must be applied
152 -- to the object to display before computation !!!
154 -- Methods from PresentableObject
156 SetLocalTransformation(me:mutable; theTransformation:Trsf from gp) is redefined static;
158 -- Methods from SelectableObject
160 ComputeSelection(me : mutable;
161 aSelection : Selection from SelectMgr;
162 aMode : Integer from Standard)is private;
164 -- Methods from InteractiveObject
166 Signature(me) returns Integer from Standard is redefined;
167 ---Purpose: Returns index 3, selection of the planes XOY, YOZ, XOZ.
168 Type(me) returns KindOfInteractive from AIS is redefined;
169 ---Purpose: Indicates that the type of Interactive Object is datum.
170 SetColor(me :mutable; aColor : NameOfColor from Quantity)
171 is redefined static ;
173 SetColor(me :mutable; aColor : Color from Quantity)
174 is redefined static ;
175 ---Purpose: Sets the color aColor for this trihedron object.
176 SetTextColor(me :mutable; aColor : NameOfColor from Quantity)
179 HasTextColor(me) returns Boolean from Standard
182 TextColor(me) returns NameOfColor from Quantity
185 SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
188 HasArrowColor(me) returns Boolean from Standard
191 ArrowColor(me) returns NameOfColor from Quantity
194 ExtremityPoints(me;TheExtrem : in out Array1OfPnt from TColgp);
195 ---Purpose: Returns the four extremities of the trihedron from the
196 -- array of points, TheExtrem.
199 UnsetColor(me:mutable) is redefined static;
200 ---Purpose: Removes the settings for color.
201 UnsetWidth(me:mutable) is redefined static;
202 ---Purpose: Removes the non-default settings for width set in SetWidth.
204 LoadSubObjects(me:mutable) is static private;
208 myComponent : Axis2Placement from Geom;
209 myShapes : InteractiveObject from AIS [7];
210 myHasOwnSize: Boolean from Standard;
211 myHasOwnTextColor : Boolean from Standard;
212 myOwnTextColor: NameOfColor from Quantity;
213 myHasOwnArrowColor : Boolean from Standard;
214 myOwnArrowColor: NameOfColor from Quantity;
216 end Trihedron from AIS;