summaryrefslogtreecommitdiff
path: root/src/AIS/AIS_LengthDimension.cdl
blob: 355015e12bd902e619f9bac02d17a1cf16cc6dbe (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
-- File:	AIS_LengthDimension.cdl
-- Created:	Tue Dec  3 13:43:59 1996
-- Author:	Arnaud BOUZY/Odile Olivier
--		<odl@sacadox.paris1.matra-dtv.fr>
---Copyright:	 Matra Datavision 1996

class LengthDimension from AIS inherits Relation from AIS

	---Purpose: A framework to display lengths.
    	-- These can be lengths along a face or edge, or
    	-- between two faces or two edges.
    	-- The value of the length is given in a text figuring in this display.

uses Shape                 from TopoDS,
     Face                  from TopoDS,
     Presentation          from Prs3d,
     PresentationManager3d from PrsMgr,
     Selection             from SelectMgr,
     Dir                   from gp,
     Pnt                   from gp,
     Projector             from Prs3d,
    Transformation        from Geom,
     PresentationManager2d from PrsMgr,
     GraphicObject         from Graphic2d,
     ExtendedString        from TCollection,
     Plane                 from Geom,
     TypeOfDist            from AIS,
     ArrowSide             from DsgPrs,
     KindOfDimension       from AIS,
     Drawer                from Prs3d,
     Edge                  from TopoDS,
     Box                   from Bnd,
     Drawer                from AIS,
     Vertex                from TopoDS
is



    Create (aFirstFace  : Face           from TopoDS;
    	    aSecondFace : Face           from TopoDS;
	    aVal        : Real           from Standard; -- is defined while first compute, may be any Real
	    aText       : ExtendedString from TCollection)    
	    ---Purpose: Constructs a length display object defined by the first
    	    -- face aFShape, the second face aSShape, the dimension aVal, and the text aText.
        
    returns mutable LengthDimension from AIS;

    Create (aFirstFace  : Face           from TopoDS;
    	    aSecondFace : Face           from TopoDS;
	    aVal        : Real           from Standard; -- is defined while first compute, may be any Real
	    aText       : ExtendedString from TCollection;    
	    aPosition   : Pnt            from gp;
	    aSymbolPrs  : ArrowSide      from DsgPrs;    
    	    anArrowSize : Real           from Standard = 0.0)
	    ---Purpose: Constructs a length display object defined by the first
    	    -- face aFShape, the second face aSShape, the
    	    -- dimension aVal, the position aPosition, the arrow
    	    -- aSymbolPrs with the size anArrowSize and the text aText.
    returns mutable LengthDimension from AIS;

    Create (Face      : Face           from TopoDS;
    	    Edge      : Edge           from TopoDS;
	    Val       : Real           from Standard;
	    Text      : ExtendedString from TCollection)
	    ---Purpose: Constructs a length display object defined by the first
    	    -- edge or vertex aFShape, the second edge or vertex
    	    -- aSShape, the dimension aVal,and the plane aPlane.
    returns mutable LengthDimension from AIS;
     
    Create (aFShape     : Shape          from TopoDS;
    	    aSShape     : Shape          from TopoDS;
            aPlane      : Plane          from Geom;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection)  
	    ---Purpose: -- Constructs a length display object defined by the first
    	    -- edge or vertex aFShape, the second edge or vertex
    	    -- aSShape, the dimension aVal,and the plane aPlane.
    returns mutable LengthDimension from AIS;

    Create (aFShape     : Shape          from TopoDS;
    	    aSShape     : Shape          from TopoDS;
            aPlane      : Plane          from Geom;
	    aVal        : Real           from Standard;
	    aText       : ExtendedString from TCollection;    
	    aPosition   : Pnt            from gp;
	    aSymbolPrs  : ArrowSide      from DsgPrs;    
	    aTypeDist   : TypeOfDist     from AIS;    
    	    anArrowSize : Real           from Standard = 0.0)
	    ---Purpose: Constructs a length display object defined by the first
    	    -- edge or vertex aFShape, the second edge or vertex
    	    -- aSShape, the dimension aVal, the position aPosition,
    	    -- the type of distance aTypeDist, the type of arrow
    	    -- aSymbolPrs with the size anArrowSize, and the plane aPlane.
    returns mutable LengthDimension from AIS;

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

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

    KindOfDimension(me) 
    returns KindOfDimension from AIS 
    is redefined;
    	    ---Purpose: Indicates that we are concerned with a length.
        
    IsMovable(me) returns Boolean from Standard 
    is redefined;    
    	    ---Purpose: Returns true if the length dimension is movable.
   
     TypeOfDist (me) 
            ---C++: inline   
    	    --- Purpose:
    	    -- Returns the type of distance of the length primitive.
    returns TypeOfDist from AIS
    is static;

    SetTypeOfDist(me: mutable;aTypeDist: TypeOfDist from AIS)
	    ---C++: inline       
	    --- Purpose:
    	    -- Returns true if the length dimension is movable.
    is static;

     
    	-- Methods from PresentableObject

    Compute(me : mutable;
    	    aPresentationManager :         PresentationManager3d from PrsMgr;
    	    aPresentation        : mutable Presentation          from Prs3d;
    	    aMode                :         Integer               from Standard= 0) 
    is redefined 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>. 
    	--          To 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

    ComputeOneFaceLength(me : mutable; 
    	    	    	 aPresentation : mutable Presentation from Prs3d)
    is private;
    
    ComputeOneEdgeLength(me : mutable;
    	    	    	 aPresentation : mutable Presentation from Prs3d)
    is private;
    
    ComputeTwoFacesLength(me: mutable;
    	    	    	  aPresentation : mutable Presentation from Prs3d)
    is private;
    

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


    ComputeTwoEdgesLength (myclass;
    	    	    	   aPresentation : mutable Presentation   from Prs3d; 
			   aDrawer       :         Drawer         from AIS; 
			   aText         :         ExtendedString from TCollection; 
			   ArrowSize     :         Real           from Standard;
			   FirstEdge     :         Edge           from TopoDS;
			   SecondEdge    :         Edge           from TopoDS;
			   Plane         :         Plane          from Geom;
			   AutomaticPos  :         Boolean        from Standard;
			   IsSetBndBox   :         Boolean        from Standard;
			   BndBox        :         Box            from Bnd;
			   ExtShape      : out     Integer        from Standard;
			   Val           : out     Real           from Standard;
			   DirAttach     : out     Dir            from gp;
			   Position      : out     Pnt            from gp;
			   FirstAttach   : out     Pnt            from gp;
			   SecondAttach  : out     Pnt            from gp;
			   SymbolPrs     : out     ArrowSide      from DsgPrs );
    
    ComputeOneEdgeOneVertexLength(myclass; 
    	    	    	          aPresentation : mutable Presentation   from Prs3d;
			          aDrawer       :         Drawer         from AIS; 
			          aText         :         ExtendedString from TCollection; 
			          ArrowSize     :         Real           from Standard;
			          FirstShape    :         Shape          from TopoDS;
			          SecondShape   :         Shape          from TopoDS;
			          Plane         :         Plane          from Geom;
			          AutomaticPos  :         Boolean        from Standard;
			          IsSetBndBox   :         Boolean        from Standard;
			          BndBox        :         Box            from Bnd;
			          ExtShape      : out     Integer        from Standard;
			          Val           : out     Real           from Standard;
			          DirAttach     : out     Dir            from gp;
			          Position      : out     Pnt            from gp;
			          FirstAttach   : out     Pnt            from gp;
			          SecondAttach  : out     Pnt            from gp;
			          SymbolPrs     : out     ArrowSide      from DsgPrs );
    
    ComputeTwoVerticesLength(myclass; 
    	    	    	     aPresentation : mutable Presentation   from Prs3d;
			     aDrawer       :         Drawer         from AIS; 
			     aText         :         ExtendedString from TCollection; 
			     ArrowSize     :         Real           from Standard;
			     FirstVertex   :         Vertex         from TopoDS;
			     SecondVertex  :         Vertex         from TopoDS;
			     Plane         :         Plane          from Geom;
			     AutomaticPos  :         Boolean        from Standard;
			     IsSetBndBox   :         Boolean        from Standard;
			     BndBox        :         Box            from Bnd;
			     TypeDist      :         TypeOfDist     from AIS;
			     ExtShape      : out     Integer        from Standard;
			     Val           : out     Real           from Standard;
			     DirAttach     : out     Dir            from gp;
			     Position      : out     Pnt            from gp;
			     FirstAttach   : out     Pnt            from gp;
			     SecondAttach  : out     Pnt            from gp;
			     SymbolPrs     : out     ArrowSide      from DsgPrs );

    
--
--      Computation Selection private methods
--      

    ComputeFaceSelection(me         : mutable;
    	    	         aSelection : mutable Selection from SelectMgr) 
    is private;
    
    ComputeEdgeVertexSelection( me         : mutable;
    	    	     	        aSelection : mutable Selection from SelectMgr) 
    is private;
			 
    
fields

    myNbShape  : Integer from Standard;
    myFAttach  : Pnt     from gp;
    mySAttach  : Pnt     from gp;
    myDirAttach: Dir     from gp;       
    myTypeDist : TypeOfDist from AIS;
    
end LengthDimension;