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
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.
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.
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.
21 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
22 -- the restricted NameOfColor.
24 class Axis from AIS inherits InteractiveObject from AIS
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.
35 Presentation from Prs3d,
36 PresentationManager3d from PrsMgr,
37 NameOfColor from Quantity,
39 Selection from SelectMgr,
41 Transformation from Geom,
44 LineAspect from Prs3d,
46 Axis2Placement from Geom,
47 Axis1Placement from Geom,
48 KindOfInteractive from AIS
51 Create(aComponent : Line from Geom)
52 returns mutable Axis from AIS;
53 --- Purpose: Initializes the line aComponent
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;
61 Create(anAxis : Axis1Placement from Geom)
62 returns mutable Axis from AIS;
63 ---Purpose: Initializes the axis1 position anAxis.
67 -- Returns the axis entity aComponent and identifies it
68 -- as a component of a shape.
70 ---C++: return const &
71 returns any Line from Geom
74 SetComponent(me: mutable;aComponent : Line from Geom)
76 ---Purpose: Sets the coordinates of the lin aComponent.
80 ---C++: return const &
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
88 SetAxis2Placement(me: mutable;
89 aComponent : Axis2Placement from Geom;
90 anAxisType : TypeOfAxis from AIS)
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.
97 SetAxis1Placement(me: mutable; anAxis : Axis1Placement from Geom)
99 ---Purpose: Constructs a new line to serve as the axis anAxis in 3D space.
103 ---Purpose: Returns the type of axis.
104 returns TypeOfAxis from AIS;
106 SetTypeOfAxis (me : mutable;aTypeAxis: TypeOfAxis from AIS)
109 -- Constructs the entity aTypeAxis to stock information
110 -- concerning type of axis.
116 -- Returns a signature of 2 for axis datums. When you
117 -- activate mode 2 by a signature, you pick AIS objects
119 returns Boolean from Standard;
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.
124 -- -- Methods from PresentableObject
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;
133 aProjector: Projector from Prs3d;
134 aPresentation: mutable Presentation from Prs3d)
135 is redefined static private;
137 Compute(me : mutable;
138 aProjector : Projector from Prs3d;
139 aTrsf : Transformation from Geom;
140 aPresentation : mutable Presentation from Prs3d)
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 !!!
150 -- Methods from SelectableObject
152 ComputeSelection(me : mutable;
153 aSelection : mutable Selection from SelectMgr;
154 aMode : Integer from Standard)is private;
157 -- -- Methods from InteractiveObject
159 Signature(me) returns Integer from Standard is redefined;
162 Type(me) returns KindOfInteractive from AIS is redefined;
165 SetColor(me :mutable; aColor : NameOfColor from Quantity)
168 SetColor(me :mutable; aColor : Color from Quantity)
171 SetWidth(me:mutable; aValue:Real from Standard) is redefined static;
173 UnsetColor(me:mutable) is redefined static;
175 UnsetWidth(me:mutable) is redefined static;
178 ComputeFields(me: mutable)
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;
190 myVal : Real from Standard;
191 myText : CString from Standard;
192 myLineAspect : LineAspect from Prs3d;