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,
42 PresentationManager2d from PrsMgr,
43 GraphicObject from Graphic2d,
46 LineAspect from Prs3d,
48 Axis2Placement from Geom,
49 Axis1Placement from Geom,
50 KindOfInteractive from AIS
53 Create(aComponent : Line from Geom)
54 returns mutable Axis from AIS;
55 --- Purpose: Initializes the line aComponent
57 Create( aComponent : Axis2Placement from Geom;
58 anAxisType: TypeOfAxis from AIS)
59 ---Purpose: initializes the axis2 position
60 -- aComponent. The coordinate system used is right-handed.
61 returns mutable Axis from AIS;
63 Create(anAxis : Axis1Placement from Geom)
64 returns mutable Axis from AIS;
65 ---Purpose: Initializes the axis1 position anAxis.
69 -- Returns the axis entity aComponent and identifies it
70 -- as a component of a shape.
72 ---C++: return const &
73 returns any Line from Geom
76 SetComponent(me: mutable;aComponent : Line from Geom)
78 ---Purpose: Sets the coordinates of the lin aComponent.
82 ---C++: return const &
84 -- Returns the position of axis2 and positions it by
85 -- identifying it as the x, y, or z axis and giving its
86 -- direction in 3D space. The coordinate system used is right-handed.
87 returns any Axis2Placement from Geom
90 SetAxis2Placement(me: mutable;
91 aComponent : Axis2Placement from Geom;
92 anAxisType : TypeOfAxis from AIS)
95 -- Allows you to provide settings for aComponent:the
96 -- position and direction of an axis in 3D space. The
97 -- coordinate system used is right-handed.
99 SetAxis1Placement(me: mutable; anAxis : Axis1Placement from Geom)
101 ---Purpose: Constructs a new line to serve as the axis anAxis in 3D space.
105 ---Purpose: Returns the type of axis.
106 returns TypeOfAxis from AIS;
108 SetTypeOfAxis (me : mutable;aTypeAxis: TypeOfAxis from AIS)
111 -- Constructs the entity aTypeAxis to stock information
112 -- concerning type of axis.
118 -- Returns a signature of 2 for axis datums. When you
119 -- activate mode 2 by a signature, you pick AIS objects
121 returns Boolean from Standard;
123 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
124 ---Purpose: Returns true if the interactive object accepts the display mode aMode.
126 -- -- Methods from PresentableObject
128 Compute(me : mutable;
129 aPresentationManager: PresentationManager3d from PrsMgr;
130 aPresentation : mutable Presentation from Prs3d;
131 aMode : Integer from Standard = 0)
132 is redefined static private;
135 aProjector: Projector from Prs3d;
136 aPresentation: mutable Presentation from Prs3d)
137 is redefined static private;
140 aPresentationManager: PresentationManager2d from PrsMgr;
141 aPresentation: mutable GraphicObject from Graphic2d;
142 aMode: Integer from Standard = 0)
143 is redefined static private;
145 Compute(me : mutable;
146 aProjector : Projector from Prs3d;
147 aTrsf : Transformation from Geom;
148 aPresentation : mutable Presentation from Prs3d)
150 ---Purpose: computes the presentation according to a point of view
151 -- given by <aProjector>.
152 -- To be Used when the associated degenerated Presentations
153 -- have been transformed by <aTrsf> which is not a Pure
154 -- Translation. The HLR Prs can't be deducted automatically
155 -- WARNING :<aTrsf> must be applied
156 -- to the object to display before computation !!!
158 -- Methods from SelectableObject
160 ComputeSelection(me : mutable;
161 aSelection : mutable Selection from SelectMgr;
162 aMode : Integer from Standard)is private;
165 -- -- Methods from InteractiveObject
167 Signature(me) returns Integer from Standard is redefined;
170 Type(me) returns KindOfInteractive from AIS is redefined;
173 SetColor(me :mutable; aColor : NameOfColor from Quantity)
176 SetColor(me :mutable; aColor : Color from Quantity)
179 SetWidth(me:mutable; aValue:Real from Standard) is redefined static;
181 UnsetColor(me:mutable) is redefined static;
183 UnsetWidth(me:mutable) is redefined static;
186 ComputeFields(me: mutable)
191 myComponent : Line from Geom;
192 myAx2 : Axis2Placement from Geom;
193 myPfirst : Pnt from gp;
194 myPlast : Pnt from gp;
195 myTypeOfAxis : TypeOfAxis from AIS;
196 myIsXYZAxis : Boolean from Standard;
198 myVal : Real from Standard;
199 myText : CString from Standard;
200 myLineAspect : LineAspect from Prs3d;