1 -- File: AIS_AngleDimension.cdl
2 -- Created: Tue Dec 3 17:37:06 1996
3 -- Author: Arnaud BOUZY/Odile Olivier
4 -- <odl@sacadox.paris1.matra-dtv.fr>
5 ---Copyright: Matra Datavision 1996
8 class AngleDimension from AIS inherits Relation from AIS
11 ---Purpose: A framework to define display of angles.
12 -- These displays are particularly useful in viewing draft prisms.
13 -- The angle displayed may define an intersection
14 -- can be between two edges or two faces of a shape
15 -- or a plane. The display consists of arrows and text.
17 uses Shape from TopoDS,
18 Presentation from Prs3d,
19 PresentationManager3d from PrsMgr,
20 Selection from SelectMgr,
27 Transformation from Geom,
28 PresentationManager2d from PrsMgr,
29 GraphicObject from Graphic2d,
32 ExtendedString from TCollection,
33 ArrowSide from DsgPrs,
34 KindOfDimension from AIS,
39 Create (aFirstEdge : Edge from TopoDS;
40 aSecondEdge : Edge from TopoDS;
41 aPlane : Plane from Geom;
42 aVal : Real from Standard;
43 aText : ExtendedString from TCollection)
44 ---Purpose: Constructs the angle display object defined by the
45 -- shapes aFShape, aSShape, the plane aPlane, the
46 -- value aVal and the text aText.
47 -- aFShape and aSShape are edges.
48 returns mutable AngleDimension from AIS;
51 Create (aFirstEdge : Edge from TopoDS;
52 aSecondEdge : Edge from TopoDS;
53 aPlane : Plane from Geom;
54 aVal : Real from Standard;
55 aText : ExtendedString from TCollection;
56 aPosition : Pnt from gp;
57 aSymbolPrs : ArrowSide from DsgPrs;
58 anArrowSize : Real from Standard = 0.0)
59 ---Purpose: Constructs the angle display object defined by the
60 -- shapes aFShape, aSShape, the plane aPlane, the
61 -- value aVal, the text aText, the point aPosition, the
62 -- type of arrow aSymbolPrs, and the arrow length anArrowSize.
63 -- aFShape and aSShape are edges.
64 returns mutable AngleDimension from AIS;
66 Create (aCone : Face from TopoDS;
67 aVal : Real from Standard;
68 aText : ExtendedString from TCollection)
69 ---Purpose: Angle of cone
70 returns mutable AngleDimension from AIS;
73 Create (aCone : Face from TopoDS;
74 aVal : Real from Standard;
75 aText : ExtendedString from TCollection;
76 aPosition : Pnt from gp;
77 aSymbolPrs : ArrowSide from DsgPrs;
78 anArrowSize : Real from Standard = 0.01 )
79 ---Purpose: Angle of cone
80 returns mutable AngleDimension from AIS;
81 --===================================================================
83 Create (aFirstFace : Face from TopoDS;
84 aSecondFace : Face from TopoDS;
86 aVal : Real from Standard;
87 aText : ExtendedString from TCollection)
88 ---Purpose: TwoPlanarFaceAngle dimension
89 returns mutable AngleDimension from AIS;
91 Create (aFirstFace : Face from TopoDS;
92 aSecondFace : Face from TopoDS;
94 aVal : Real from Standard;
95 aText : ExtendedString from TCollection;
96 aPosition : Pnt from gp;
97 aSymbolPrs : ArrowSide from DsgPrs;
98 anArrowSize : Real from Standard = 0.0)
99 ---Purpose: TwoPlanarFacesAngle dimension with position
100 -- and text Face can be Plane or Extrusion of line
101 -- or Offset of those
102 returns mutable AngleDimension from AIS;
105 Create (aFFace : Face from TopoDS;
106 aSFace : Face from TopoDS;
107 aVal : Real from Standard;
108 aText : ExtendedString from TCollection)
109 ---Purpose: Angle dimension between two curvilinear faces
111 -- Requaired 0 <= aVal < PI,
112 -- aVal must be defined exactly.
113 returns mutable AngleDimension from AIS;
115 Create (aFFace : Face from TopoDS;
116 aSFace : Face from TopoDS;
117 aVal : Real from Standard;
118 aText : ExtendedString from TCollection;
119 aPosition : Pnt from gp;
120 aSymbolPrs : ArrowSide from DsgPrs;
121 anArrowSize : Real from Standard = 0.001)
122 ---Purpose: Angle dimension between two curvilinear faces
123 -- with position and text. Face can be Cone, Cylinder
124 -- Offset of Cone, Offset of Cylinder
125 returns mutable AngleDimension from AIS;
130 -- Returns the axis set by the SetAxis method, which
131 -- serves to locate the angle between two faces.
132 ---C++: return const &
137 SetAxis(me: mutable;anAxis : Ax1 from gp)
140 -- Sets the axis, anAxis, which serves to locate the
141 -- angle between two faces.
144 SetConeFace( me: mutable; aConeFace : Face from TopoDS )
147 SetFirstShape( me: mutable; aFShape : Shape from TopoDS )
150 SetSecondShape( me: mutable; aSShape : Shape from TopoDS )
155 ---Purpose: Returns PLANEANGLE as the kind of dimension.
157 returns KindOfDimension from AIS
160 IsMovable(me) returns Boolean from Standard
162 ---Purpose: Returns true if the angle dimension is movable.
166 -- Methods from PresentableObject
168 Compute(me : mutable;
169 aPresentationManager: PresentationManager3d from PrsMgr;
170 aPresentation : mutable Presentation from Prs3d;
171 aMode : Integer from Standard= 0)
172 is redefined static private;
175 aProjector: Projector from Prs3d;
176 aPresentation: mutable Presentation from Prs3d)
177 is redefined static private;
180 aPresentationManager: PresentationManager2d from PrsMgr;
181 aPresentation: mutable GraphicObject from Graphic2d;
182 aMode: Integer from Standard = 0)
183 is redefined static private;
185 Compute(me : mutable;
186 aProjector : Projector from Prs3d;
187 aTrsf : Transformation from Geom;
188 aPresentation : mutable Presentation from Prs3d)
190 ---Purpose: Computes the presentation according to a point of view
191 -- given by <aProjector>.
192 -- This method should be used when the associated degenerated Presentations
193 -- have been transformed by <aTrsf> which is not a Pure
194 -- Translation. The HLR Prs can't be deducted automatically
195 -- WARNING :<aTrsf> must be applied
196 -- to the object to display before computation !!!
198 -- Methods from SelectableObject
200 ComputeSelection(me : mutable;
201 aSelection : mutable Selection from SelectMgr;
202 aMode : Integer from Standard)
203 is redefined private;
207 -- Computation private methods
210 ComputeConeAngle(me: mutable;
211 aPresentation : mutable Presentation from Prs3d)
214 ComputeTwoFacesAngle(me: mutable;
215 aPresentation : mutable Presentation from Prs3d)
218 ComputeTwoPlanarFacesAngle(me: mutable;
219 aPresentation : mutable Presentation from Prs3d)
222 ComputeTwoCurvilinearFacesAngle(me: mutable;
223 aPresentation : mutable Presentation from Prs3d)
226 ComputeTwoEdgesAngle(me: mutable;
227 aPresentation : mutable Presentation from Prs3d)
229 ComputeTwoEdgesNullAngle(me: mutable;
230 aPresentation : mutable Presentation from Prs3d;
233 ptat11 : Pnt from gp;
234 ptat12 : Pnt from gp;
235 ptat21 : Pnt from gp;
236 ptat22 : Pnt from gp;
237 isInf1 : Boolean from Standard;
238 isInf2 : Boolean from Standard )
241 ComputeTwoEdgesNotNullAngle(me: mutable;
242 aPresentation : mutable Presentation from Prs3d;
245 ptat11 : Pnt from gp;
246 ptat12 : Pnt from gp;
247 ptat21 : Pnt from gp;
248 ptat22 : Pnt from gp;
249 isInf1 : Boolean from Standard;
250 isInf2 : Boolean from Standard )
253 Compute3DSelection(me : mutable;
254 aSelection : mutable Selection from SelectMgr)
257 Compute2DSelection(me : mutable;
258 aSelection : mutable Selection from SelectMgr)
260 ComputeNull2DSelection(me : mutable;
261 aSelection : mutable Selection from SelectMgr;
262 distFS : Real from Standard)
265 ComputeConeAngleSelection(me : mutable;
266 aSelection : mutable Selection from SelectMgr)
271 myNbShape : Integer from Standard;
272 myCenter : Pnt from gp;
273 myFAttach : Pnt from gp;
274 mySAttach : Pnt from gp;
275 myFDir : Dir from gp;
276 mySDir : Dir from gp;
277 myAxis : Ax1 from gp;
278 myCone : Face from TopoDS;