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