summaryrefslogtreecommitdiff
path: root/src/AIS/AIS_AngleDimension.cdl
blob: f5aa01af03c9add783235ddc7491ec5f2d69ba9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
-- File:	AIS_AngleDimension.cdl
-- Created:	Tue Dec  3 17:37:06 1996
-- Author:	Arnaud BOUZY/Odile Olivier
--		<odl@sacadox.paris1.matra-dtv.fr>
---Copyright:	 Matra Datavision 1996


class AngleDimension from AIS inherits Relation from AIS

      
	 ---Purpose: A framework to define display of angles.
    	 -- These displays are particularly useful in viewing draft prisms.
    	 -- The angle displayed may define an intersection
    	 -- can be between two edges or two faces of a shape
    	 -- or a plane. The display consists of arrows and text.

uses Shape                 from TopoDS,
     Presentation          from Prs3d,
     PresentationManager3d from PrsMgr,
     Selection             from SelectMgr,
     Pnt                   from gp,
     Dir                   from gp,
     Circ                  from gp,
     Line                  from Geom,
     Ax1                   from gp,
     Projector             from Prs3d,
    Transformation        from Geom,
     PresentationManager2d from PrsMgr,
     GraphicObject         from Graphic2d,
     Plane                 from Geom,
     Surface               from Geom,
     ExtendedString        from TCollection,
     ArrowSide             from DsgPrs,
     KindOfDimension       from AIS,   
     Edge                  from TopoDS,    
     Face                  from TopoDS	  
is

    Create (aFirstEdge       : Edge           from TopoDS;
    	    aSecondEdge      : Edge           from TopoDS;
	    aPlane           : Plane          from Geom;
	    aVal             : Real           from Standard;
	    aText            : ExtendedString from TCollection)    
	 ---Purpose:  Constructs the angle display object defined by the
    	 -- shapes aFShape, aSShape, the plane aPlane, the
    	 -- value aVal and the text aText.
    	 -- aFShape and aSShape are edges.
    returns mutable AngleDimension from AIS;
    
 
    Create (aFirstEdge       : Edge           from TopoDS;
    	    aSecondEdge      : Edge           from TopoDS;
	    aPlane           : Plane          from Geom;
	    aVal             : Real           from Standard;
	    aText            : ExtendedString from TCollection;    
	    aPosition        : Pnt            from gp;
	    aSymbolPrs       : ArrowSide      from DsgPrs;    
    	    anArrowSize      : Real           from Standard = 0.0)
	 ---Purpose: Constructs the angle display object defined by the
    	 -- shapes aFShape, aSShape, the plane aPlane, the
    	 -- value aVal, the text aText, the point aPosition, the
    	 -- type of arrow aSymbolPrs, and the arrow length anArrowSize.
    	 -- aFShape and aSShape are edges.
    returns mutable AngleDimension from AIS;

    Create (aCone       : Face           from TopoDS;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection)    
	 ---Purpose:  Angle of cone  
    returns mutable AngleDimension from AIS;
    
   
    Create (aCone            : Face           from TopoDS;
	    aVal             : Real           from Standard;
	    aText            : ExtendedString from TCollection;
            aPosition        : Pnt            from gp;
	    aSymbolPrs       : ArrowSide      from DsgPrs;    
    	    anArrowSize      : Real           from Standard = 0.01 )    
	 ---Purpose:  Angle of cone  
    returns mutable AngleDimension from AIS;
 --===================================================================       
    
    Create (aFirstFace  : Face           from TopoDS;
    	    aSecondFace : Face           from TopoDS;
	    anAxis      : Ax1            from gp;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection)    
	  ---Purpose:  TwoPlanarFaceAngle dimension
    returns mutable AngleDimension from AIS;

    Create (aFirstFace  : Face           from TopoDS;
    	    aSecondFace : Face           from TopoDS;
	    anAxis      : Ax1            from gp;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection;	    
	    aPosition   : Pnt            from gp;
	    aSymbolPrs  : ArrowSide      from DsgPrs;    
    	    anArrowSize : Real           from Standard = 0.0)
	  ---Purpose: TwoPlanarFacesAngle dimension  with   position
	  --           and text Face  can be Plane or Extrusion of line
	  --           or Offset of  those
    returns mutable AngleDimension from AIS;


    Create (aFFace      : Face           from TopoDS;
    	    aSFace      : Face           from TopoDS;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection)    
	  ---Purpose:  Angle dimension between two curvilinear faces
	  --           Warning:
	  --           Requaired 0 <= aVal < PI,
	  --                     aVal must be defined exactly.
    returns mutable AngleDimension from AIS;

    Create (aFFace      : Face           from TopoDS;
    	    aSFace      : Face           from TopoDS;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection;	    
	    aPosition   : Pnt            from gp;
	    aSymbolPrs  : ArrowSide      from DsgPrs;    
    	    anArrowSize : Real           from Standard = 0.001)
	 ---Purpose:  Angle dimension between two curvilinear faces
	 --           with position and text. Face can be Cone, Cylinder
	 --           Offset of Cone, Offset of Cylinder 
    returns mutable AngleDimension from AIS;


    Axis (me) 
	 ---Purpose:
	 -- Returns the axis set by the SetAxis method, which
	 -- serves to locate the angle between two faces.
	 ---C++: return const &
	 ---C++: inline 
    returns Ax1 from gp 
    is static;

    SetAxis(me: mutable;anAxis : Ax1 from gp)
	 ---C++: inline
	 ---Purpose:
	 -- Sets the axis, anAxis, which serves to locate the
	 -- angle between two faces.
    is static;

    SetConeFace( me: mutable; aConeFace : Face from TopoDS )
    is  static;

    SetFirstShape( me: mutable; aFShape : Shape from TopoDS )
    is redefined static;

    SetSecondShape( me: mutable; aSShape : Shape from TopoDS )
    is redefined static;


    KindOfDimension(me) 
	 ---Purpose: Returns PLANEANGLE as the kind of dimension.
	 ---C++: inline
    returns KindOfDimension from AIS 
    is redefined;

    IsMovable(me) returns Boolean from Standard 
	 ---C++: inline    
	 ---Purpose: Returns true if the angle dimension is movable.
        
    is redefined;
    
  -- Methods from PresentableObject

    Compute(me            : mutable;
            aPresentationManager: PresentationManager3d from PrsMgr;
    	    aPresentation : mutable Presentation from Prs3d;
    	    aMode         : Integer from Standard= 0) 
    is redefined static private;
    
    Compute(me:mutable;
    	        aProjector: Projector from Prs3d;
                aPresentation: mutable Presentation from Prs3d)
    is redefined static private;     

    Compute(me:mutable;
    	    aPresentationManager: PresentationManager2d from PrsMgr;
            aPresentation: mutable GraphicObject from Graphic2d;
            aMode: Integer from Standard = 0)
    is redefined static private;	
    
    Compute(me            : mutable;
    	    aProjector    : Projector from Prs3d;
    	    aTrsf         : Transformation from Geom;
	    aPresentation : mutable Presentation from Prs3d)
    is redefined;
	 ---Purpose: Computes the presentation according to a point of view
	 --          given by <aProjector>. 
	 --          This method should be used when the associated degenerated Presentations 
	 --          have been transformed by <aTrsf> which is not a Pure
	 --          Translation. The HLR Prs can't be deducted automatically
	 --          WARNING :<aTrsf> must be applied
	 --           to the object to display before computation  !!!

-- Methods from SelectableObject

    ComputeSelection(me         : mutable;
    	    	     aSelection : mutable Selection from SelectMgr;
    	    	     aMode      : Integer from Standard)
    is redefined private;

    
--
--     Computation private methods
--

    ComputeConeAngle(me: mutable; 
                        aPresentation : mutable Presentation from Prs3d)
    is private;

    ComputeTwoFacesAngle(me: mutable;
    	    	    	  aPresentation : mutable Presentation from Prs3d)
    is private;
    
    ComputeTwoPlanarFacesAngle(me: mutable;
    	    	    	  aPresentation : mutable Presentation from Prs3d)
    is private;
    
    ComputeTwoCurvilinearFacesAngle(me: mutable;
    	    	    	  aPresentation : mutable Presentation from Prs3d)
    is private;
    
    ComputeTwoEdgesAngle(me: mutable;
    	    	    	  aPresentation : mutable Presentation from Prs3d)
    is private;
    ComputeTwoEdgesNullAngle(me: mutable;
    	    	    	    aPresentation : mutable Presentation from Prs3d;  
			    l1    : Line from Geom;
			    l2    : Line from Geom;
			    ptat11 : Pnt from gp;
			    ptat12 : Pnt from gp;
                            ptat21 : Pnt from gp;
			    ptat22 : Pnt from gp;
 			    isInf1 : Boolean from Standard;
 			    isInf2 : Boolean from Standard )			    
    is private;
    
    ComputeTwoEdgesNotNullAngle(me: mutable;
    	    	    	    aPresentation : mutable Presentation from Prs3d;  
			    l1    : Line from Geom;
			    l2    : Line from Geom;
			    ptat11 : Pnt from gp;
			    ptat12 : Pnt from gp;
                            ptat21 : Pnt from gp;
			    ptat22 : Pnt from gp;
 			    isInf1 : Boolean from Standard;
 			    isInf2 : Boolean from Standard )			    
    is private;

    Compute3DSelection(me         : mutable;
    	    	       aSelection : mutable Selection from SelectMgr)
    is private;
    
    Compute2DSelection(me         : mutable;
    	    	       aSelection : mutable Selection from SelectMgr)
    is private;
    ComputeNull2DSelection(me         : mutable;
    	    	           aSelection : mutable Selection from SelectMgr; 
    	    	    	   distFS     : Real from Standard)
    is private;

    ComputeConeAngleSelection(me         : mutable;
    	    	    	      aSelection : mutable Selection from SelectMgr)
    is private;    

fields

    myNbShape  : Integer from Standard;
    myCenter   : Pnt     from gp;
    myFAttach  : Pnt     from gp;
    mySAttach  : Pnt     from gp;
    myFDir     : Dir     from gp;
    mySDir     : Dir     from gp;
    myAxis     : Ax1     from gp;
    myCone     : Face    from TopoDS;
   
end AngleDimension;