660f5505dd733e26c528320211d864f61cfe357c
[occt.git] / src / AIS / AIS_Trihedron.cdl
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
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
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.
22
23
24 class Trihedron from AIS inherits InteractiveObject from AIS
25
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.
33         -- Warning
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.
47
48 uses 
49     Axis2Placement        from Geom,
50     Presentation          from Prs3d,
51     PresentationManager3d from PrsMgr,
52     NameOfColor           from Quantity,
53     Color                         from Quantity,
54     Selection             from SelectMgr,
55     Projector             from Prs3d,
56     Transformation        from Geom,
57     Axis                  from AIS,
58     Point                 from AIS,
59     Plane                 from AIS,
60     KindOfInteractive     from AIS,
61     InteractiveContext    from AIS,
62     Array1OfPnt           from  TColgp,
63     Location              from TopLoc
64 is
65
66     Create(aComponent : Axis2Placement from Geom)
67     returns Trihedron from AIS;
68         --- Purpose: Initializes a trihedron entity.   
69     
70     Component(me) returns any Axis2Placement from Geom 
71     is static;
72         ---Purpose: Returns the right-handed coordinate system set in SetComponent.
73         ---C++: inline
74         ---C++: return const&
75     
76     SetComponent(me: mutable;aComponent : Axis2Placement from Geom)
77     is static;
78         ---Purpose: Constructs the right-handed coordinate system aComponent.
79
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.
83         ---C++: inline
84
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.
88
89     UnsetSize(me:mutable);
90         ---Purpose: Removes any non-default settings for size of this
91         -- trihedron object.
92     
93     Size(me) returns Real from Standard;
94     
95     
96     XAxis (me)   returns Axis from AIS;
97         ---Purpose : Returns the "XAxis". 
98  
99     YAxis (me)  returns Axis from AIS;
100         ---Purpose : Returns the "YAxis". 
101
102     Axis (me)  returns Axis from AIS;
103         ---Purpose : Returns the main Axis. 
104
105     Position (me)  returns Point from AIS;
106         ---Purpose : Returns the origine. 
107
108     XYPlane (me)   returns Plane from AIS;
109         ---Purpose : Returns the "XYPlane". 
110
111     XZPlane (me)   returns Plane from AIS;
112         ---Purpose : Returns the "XZPlane". 
113
114     YZPlane (me)   returns Plane from AIS;
115         ---Purpose : Returns the "YZPlane". 
116
117
118     SetContext(me:mutable; aCtx : InteractiveContext from AIS) 
119     is redefined;
120         ---Purpose: connection to <aCtx> default drawer implies a recomputation
121         --          of SubObjects values.
122
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.
126         
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;
132     
133     Compute(me:mutable;
134                 aProjector: Projector from Prs3d;
135                 aPresentation: Presentation from Prs3d)
136     is redefined static private;     
137
138
139
140     Compute(me            : mutable;
141             aProjector    : Projector from Prs3d;
142             aTrsf         : Transformation from Geom;
143             aPresentation : Presentation from Prs3d)
144     is redefined;
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  !!!
152
153 -- Methods from PresentableObject
154
155     SetLocation(me              : mutable;
156                 aLoc            : Location from TopLoc)
157     is redefined static;
158
159 -- Methods from SelectableObject
160
161     ComputeSelection(me         : mutable;
162                      aSelection : Selection from SelectMgr;
163                      aMode      : Integer from Standard)is private;
164
165 -- Methods from InteractiveObject
166
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 ;
173  
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)
178     is static ;
179
180     HasTextColor(me) returns Boolean from Standard 
181     is static ;
182  
183     TextColor(me) returns NameOfColor from Quantity
184     is static ;
185
186     SetArrowColor(me :mutable; aColor : NameOfColor from Quantity)
187     is static ;
188
189     HasArrowColor(me) returns Boolean from Standard 
190     is static ;
191  
192     ArrowColor(me) returns NameOfColor from Quantity
193     is static ;
194
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.
198             
199     
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.
204
205     LoadSubObjects(me:mutable) is static private;
206
207
208 fields
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;
216
217 end Trihedron from AIS;