0022368: AIS_Trihedron's highlight presentation isn't updated on trihedron relocation
[occt.git] / src / AIS / AIS_Trihedron.cdl
1 -- File:        AIS_Trihedron.cdl
2 -- Created:     Mon Oct  9 16:23:38 1995
3 -- Author:      Arnaud BOUZY/Odile Olivier
4 --              <adn@houblon>
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.
10
11 ---Copyright:    Matra Datavision 1995
12
13 class Trihedron from AIS inherits InteractiveObject from AIS
14
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.
22         -- Warning
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.
36
37 uses 
38     Axis2Placement        from Geom,
39     Presentation          from Prs3d,
40     PresentationManager3d from PrsMgr,
41     NameOfColor           from Quantity,
42     Color                         from Quantity,
43     Selection             from SelectMgr,
44     Projector             from Prs3d,
45     Transformation        from Geom,
46     PresentationManager2d from PrsMgr,
47     GraphicObject         from Graphic2d,      
48     Axis                  from AIS,
49     Point                 from AIS,
50     Plane                 from AIS,
51     KindOfInteractive     from AIS,
52     InteractiveContext    from AIS,
53     Array1OfPnt           from  TColgp,
54     Location              from TopLoc
55 is
56
57     Create(aComponent : Axis2Placement from Geom)
58     returns mutable Trihedron from AIS;
59         --- Purpose: Initializes a trihedron entity.   
60     
61     Component(me) returns any Axis2Placement from Geom 
62     is static;
63         ---Purpose: Returns the right-handed coordinate system set in SetComponent.
64         ---C++: inline
65         ---C++: return const&
66     
67     SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
68     is static;
69         ---Purpose: Constructs the right-handed coordinate system aComponent.
70
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.
74         ---C++: inline
75
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.
79
80     UnsetSize(me:mutable);
81         ---Purpose: Removes any non-default settings for size of this
82         -- trihedron object.
83     
84     Size(me) returns Real from Standard;
85     
86     
87     XAxis (me)   returns Axis from AIS;
88         ---Purpose : Returns the "XAxis". 
89  
90     YAxis (me)  returns Axis from AIS;
91         ---Purpose : Returns the "YAxis". 
92
93     Axis (me)  returns Axis from AIS;
94         ---Purpose : Returns the main Axis. 
95
96     Position (me)  returns Point from AIS;
97         ---Purpose : Returns the origine. 
98
99     XYPlane (me)   returns Plane from AIS;
100         ---Purpose : Returns the "XYPlane". 
101
102     XZPlane (me)   returns Plane from AIS;
103         ---Purpose : Returns the "XZPlane". 
104
105     YZPlane (me)   returns Plane from AIS;
106         ---Purpose : Returns the "YZPlane". 
107
108
109     SetContext(me:mutable; aCtx : InteractiveContext from AIS) 
110     is redefined;
111         ---Purpose: connection to <aCtx> default drawer implies a recomputation
112         --          of SubObjects values.
113
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.
117         
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;
123     
124     Compute(me:mutable;
125                 aProjector: Projector from Prs3d;
126                 aPresentation: mutable Presentation from Prs3d)
127     is redefined static private;     
128
129     Compute(me:mutable;
130             aPresentationManager: PresentationManager2d from PrsMgr;
131             aPresentation: mutable GraphicObject from Graphic2d;
132             aMode: Integer from Standard = 0)
133     is redefined static private;        
134
135     Compute(me            : mutable;
136             aProjector    : Projector from Prs3d;
137             aTrsf         : Transformation from Geom;
138             aPresentation : mutable Presentation from Prs3d)
139     is redefined;
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  !!!
147
148 -- Methods from PresentableObject
149
150     SetLocation(me              : mutable;
151                 aLoc            : Location from TopLoc)
152     is redefined static;
153
154 -- Methods from SelectableObject
155
156     ComputeSelection(me         : mutable;
157                      aSelection : mutable Selection from SelectMgr;
158                      aMode      : Integer from Standard)is private;
159
160 -- Methods from InteractiveObject
161
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 ;
168  
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)
173     is static ;
174
175     HasTextColor(me) returns Boolean from Standard 
176     is static ;
177  
178     TextColor(me) returns NameOfColor from Quantity
179     is static ;
180
181     SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
182     is static ;
183
184     HasArrowColor(me) returns Boolean from Standard 
185     is static ;
186  
187     ArrowColor(me) returns NameOfColor from Quantity
188     is static ;
189
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.
193             
194     
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.
199
200     LoadSubObjects(me:mutable) is static private;
201
202
203 fields
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;
211
212 end Trihedron from AIS;