7fd59977 |
1 | -- File: AIS_Axis.cdl |
2 | -- Created: Wed Aug 9 16:28:13 1995 |
3 | -- Author: Arnaud BOUZY/Odile Olivier |
4 | -- <adn@houblon> |
5 | -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead |
6 | -- the restricted NameOfColor. |
7 | ---Copyright: Matra Datavision 1995 |
8 | |
9 | class Axis from AIS inherits InteractiveObject from AIS |
10 | |
11 | ---Purpose: Locates the x, y and z axes in an Interactive Object. |
12 | -- These are used to orient it correctly in presentations |
13 | -- from different viewpoints, or to construct a revolved |
14 | -- shape, for example, from one of the axes. Conversely, |
15 | -- an axis can be created to build a revolved shape and |
16 | -- then situated relative to one of the axes of the view. |
17 | |
18 | uses |
19 | Line from Geom, |
20 | Presentation from Prs3d, |
21 | PresentationManager3d from PrsMgr, |
22 | NameOfColor from Quantity, |
23 | Color from Quantity, |
24 | Selection from SelectMgr, |
25 | Projector from Prs3d, |
26 | Transformation from Geom, |
27 | PresentationManager2d from PrsMgr, |
28 | GraphicObject from Graphic2d, |
29 | Pnt from gp, |
30 | Dir from gp, |
31 | LineAspect from Prs3d, |
32 | TypeOfAxis from AIS, |
33 | Axis2Placement from Geom, |
34 | Axis1Placement from Geom, |
35 | KindOfInteractive from AIS |
36 | |
37 | is |
38 | Create(aComponent : Line from Geom) |
39 | returns mutable Axis from AIS; |
40 | --- Purpose: Initializes the line aComponent |
41 | |
42 | Create( aComponent : Axis2Placement from Geom; |
43 | anAxisType: TypeOfAxis from AIS) |
44 | ---Purpose: initializes the axis2 position |
45 | -- aComponent. The coordinate system used is right-handed. |
46 | returns mutable Axis from AIS; |
47 | |
48 | Create(anAxis : Axis1Placement from Geom) |
49 | returns mutable Axis from AIS; |
50 | ---Purpose: Initializes the axis1 position anAxis. |
51 | |
52 | Component(me) |
53 | ---Purpose: |
54 | -- Returns the axis entity aComponent and identifies it |
55 | -- as a component of a shape. |
56 | ---C++: inline |
57 | ---C++: return const & |
58 | returns any Line from Geom |
59 | is static; |
60 | |
61 | SetComponent(me: mutable;aComponent : Line from Geom) |
62 | is static; |
63 | ---Purpose: Sets the coordinates of the lin aComponent. |
64 | |
65 | Axis2Placement(me) |
66 | ---C++: inline |
67 | ---C++: return const & |
68 | ---Purpose: |
69 | -- Returns the position of axis2 and positions it by |
70 | -- identifying it as the x, y, or z axis and giving its |
71 | -- direction in 3D space. The coordinate system used is right-handed. |
72 | returns any Axis2Placement from Geom |
73 | is static; |
74 | |
75 | SetAxis2Placement(me: mutable; |
76 | aComponent : Axis2Placement from Geom; |
77 | anAxisType : TypeOfAxis from AIS) |
78 | is static; |
79 | ---Purpose: |
80 | -- Allows you to provide settings for aComponent:the |
81 | -- position and direction of an axis in 3D space. The |
82 | -- coordinate system used is right-handed. |
83 | |
84 | SetAxis1Placement(me: mutable; anAxis : Axis1Placement from Geom) |
85 | is static; |
86 | ---Purpose: Constructs a new line to serve as the axis anAxis in 3D space. |
87 | |
88 | TypeOfAxis (me) |
89 | ---C++: inline |
90 | ---Purpose: Returns the type of axis. |
91 | returns TypeOfAxis from AIS; |
92 | |
93 | SetTypeOfAxis (me : mutable;aTypeAxis: TypeOfAxis from AIS) |
94 | ---C++: inline |
95 | ---Purpose: |
96 | -- Constructs the entity aTypeAxis to stock information |
97 | -- concerning type of axis. |
98 | is static; |
99 | |
100 | IsXYZAxis (me) |
101 | ---C++: inline |
102 | ---Purpose: |
103 | -- Returns a signature of 2 for axis datums. When you |
104 | -- activate mode 2 by a signature, you pick AIS objects |
105 | -- of type AIS_Axis. |
106 | returns Boolean from Standard; |
107 | |
108 | AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static; |
109 | ---Purpose: Returns true if the interactive object accepts the display mode aMode. |
110 | |
111 | -- -- Methods from PresentableObject |
112 | |
113 | Compute(me : mutable; |
114 | aPresentationManager: PresentationManager3d from PrsMgr; |
115 | aPresentation : mutable Presentation from Prs3d; |
116 | aMode : Integer from Standard = 0) |
117 | is redefined static private; |
118 | |
119 | Compute(me:mutable; |
120 | aProjector: Projector from Prs3d; |
121 | aPresentation: mutable Presentation from Prs3d) |
122 | is redefined static private; |
123 | |
124 | Compute(me:mutable; |
125 | aPresentationManager: PresentationManager2d from PrsMgr; |
126 | aPresentation: mutable GraphicObject from Graphic2d; |
127 | aMode: Integer from Standard = 0) |
128 | is redefined static private; |
129 | |
130 | Compute(me : mutable; |
131 | aProjector : Projector from Prs3d; |
132 | aTrsf : Transformation from Geom; |
133 | aPresentation : mutable Presentation from Prs3d) |
134 | is redefined; |
135 | ---Purpose: computes the presentation according to a point of view |
136 | -- given by <aProjector>. |
137 | -- To be Used when the associated degenerated Presentations |
138 | -- have been transformed by <aTrsf> which is not a Pure |
139 | -- Translation. The HLR Prs can't be deducted automatically |
140 | -- WARNING :<aTrsf> must be applied |
141 | -- to the object to display before computation !!! |
142 | |
143 | -- Methods from SelectableObject |
144 | |
145 | ComputeSelection(me : mutable; |
146 | aSelection : mutable Selection from SelectMgr; |
147 | aMode : Integer from Standard)is private; |
148 | |
149 | |
150 | -- -- Methods from InteractiveObject |
151 | |
152 | Signature(me) returns Integer from Standard is redefined; |
153 | ---C++: inline |
154 | |
155 | Type(me) returns KindOfInteractive from AIS is redefined; |
156 | ---C++: inline |
157 | |
158 | SetColor(me :mutable; aColor : NameOfColor from Quantity) |
159 | is redefined static; |
160 | |
161 | SetColor(me :mutable; aColor : Color from Quantity) |
162 | is redefined static; |
163 | |
164 | SetWidth(me:mutable; aValue:Real from Standard) is redefined static; |
165 | |
166 | UnsetColor(me:mutable) is redefined static; |
167 | |
168 | UnsetWidth(me:mutable) is redefined static; |
169 | |
170 | |
171 | ComputeFields(me: mutable) |
172 | is private; |
173 | |
174 | fields |
175 | |
176 | myComponent : Line from Geom; |
177 | myAx2 : Axis2Placement from Geom; |
178 | myPfirst : Pnt from gp; |
179 | myPlast : Pnt from gp; |
180 | myTypeOfAxis : TypeOfAxis from AIS; |
181 | myIsXYZAxis : Boolean from Standard; |
182 | myDir : Dir from gp; |
183 | myVal : Real from Standard; |
184 | myText : CString from Standard; |
185 | myLineAspect : LineAspect from Prs3d; |
186 | |
187 | end Axis; |