1 -- File: AIS_LengthDimension.cdl
2 -- Created: Tue Dec 3 13:43:59 1996
3 -- Author: Arnaud BOUZY/Odile Olivier
4 -- <odl@sacadox.paris1.matra-dtv.fr>
5 ---Copyright: Matra Datavision 1996
7 class LengthDimension from AIS inherits Relation from AIS
9 ---Purpose: A framework to display lengths.
10 -- These can be lengths along a face or edge, or
11 -- between two faces or two edges.
12 -- The value of the length is given in a text figuring in this display.
14 uses Shape from TopoDS,
16 Presentation from Prs3d,
17 PresentationManager3d from PrsMgr,
18 Selection from SelectMgr,
22 Transformation from Geom,
23 PresentationManager2d from PrsMgr,
24 GraphicObject from Graphic2d,
25 ExtendedString from TCollection,
28 ArrowSide from DsgPrs,
29 KindOfDimension from AIS,
39 Create (aFirstFace : Face from TopoDS;
40 aSecondFace : Face from TopoDS;
41 aVal : Real from Standard; -- is defined while first compute, may be any Real
42 aText : ExtendedString from TCollection)
43 ---Purpose: Constructs a length display object defined by the first
44 -- face aFShape, the second face aSShape, the dimension aVal, and the text aText.
46 returns mutable LengthDimension from AIS;
48 Create (aFirstFace : Face from TopoDS;
49 aSecondFace : Face from TopoDS;
50 aVal : Real from Standard; -- is defined while first compute, may be any Real
51 aText : ExtendedString from TCollection;
52 aPosition : Pnt from gp;
53 aSymbolPrs : ArrowSide from DsgPrs;
54 anArrowSize : Real from Standard = 0.0)
55 ---Purpose: Constructs a length display object defined by the first
56 -- face aFShape, the second face aSShape, the
57 -- dimension aVal, the position aPosition, the arrow
58 -- aSymbolPrs with the size anArrowSize and the text aText.
59 returns mutable LengthDimension from AIS;
61 Create (Face : Face from TopoDS;
62 Edge : Edge from TopoDS;
63 Val : Real from Standard;
64 Text : ExtendedString from TCollection)
65 ---Purpose: Constructs a length display object defined by the first
66 -- edge or vertex aFShape, the second edge or vertex
67 -- aSShape, the dimension aVal,and the plane aPlane.
68 returns mutable LengthDimension from AIS;
70 Create (aFShape : Shape from TopoDS;
71 aSShape : Shape from TopoDS;
72 aPlane : Plane from Geom;
73 aVal : Real from Standard;
74 aText : ExtendedString from TCollection)
75 ---Purpose: -- Constructs a length display object defined by the first
76 -- edge or vertex aFShape, the second edge or vertex
77 -- aSShape, the dimension aVal,and the plane aPlane.
78 returns mutable LengthDimension from AIS;
80 Create (aFShape : Shape from TopoDS;
81 aSShape : Shape from TopoDS;
82 aPlane : Plane from Geom;
83 aVal : Real from Standard;
84 aText : ExtendedString from TCollection;
85 aPosition : Pnt from gp;
86 aSymbolPrs : ArrowSide from DsgPrs;
87 aTypeDist : TypeOfDist from AIS;
88 anArrowSize : Real from Standard = 0.0)
89 ---Purpose: Constructs a length display object defined by the first
90 -- edge or vertex aFShape, the second edge or vertex
91 -- aSShape, the dimension aVal, the position aPosition,
92 -- the type of distance aTypeDist, the type of arrow
93 -- aSymbolPrs with the size anArrowSize, and the plane aPlane.
94 returns mutable LengthDimension from AIS;
96 SetFirstShape( me: mutable; aFShape : Shape from TopoDS )
99 SetSecondShape( me: mutable; aSShape : Shape from TopoDS )
103 returns KindOfDimension from AIS
105 ---Purpose: Indicates that we are concerned with a length.
107 IsMovable(me) returns Boolean from Standard
109 ---Purpose: Returns true if the length dimension is movable.
114 -- Returns the type of distance of the length primitive.
115 returns TypeOfDist from AIS
118 SetTypeOfDist(me: mutable;aTypeDist: TypeOfDist from AIS)
121 -- Returns true if the length dimension is movable.
125 -- Methods from PresentableObject
127 Compute(me : mutable;
128 aPresentationManager : PresentationManager3d from PrsMgr;
129 aPresentation : mutable Presentation from Prs3d;
130 aMode : Integer from Standard= 0)
131 is redefined private;
133 Compute(me : mutable;
134 aProjector : Projector from Prs3d;
135 aPresentation : mutable Presentation from Prs3d)
136 is redefined static private;
139 aPresentationManager: PresentationManager2d from PrsMgr;
140 aPresentation: mutable GraphicObject from Graphic2d;
141 aMode: Integer from Standard = 0)
142 is redefined static private;
144 Compute(me : mutable;
145 aProjector : Projector from Prs3d;
146 aTrsf : Transformation from Geom;
147 aPresentation : mutable Presentation from Prs3d)
149 ---Purpose: computes the presentation according to a point of view
150 -- given by <aProjector>.
151 -- To be Used when the associated degenerated Presentations
152 -- have been transformed by <aTrsf> which is not a Pure
153 -- Translation. The HLR Prs can't be deducted automatically
154 -- WARNING :<aTrsf> must be applied
155 -- 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)
163 is redefined private;
167 -- Computation private methods
169 ComputeOneFaceLength(me : mutable;
170 aPresentation : mutable Presentation from Prs3d)
173 ComputeOneEdgeLength(me : mutable;
174 aPresentation : mutable Presentation from Prs3d)
177 ComputeTwoFacesLength(me: mutable;
178 aPresentation : mutable Presentation from Prs3d)
182 ComputeEdgeFaceLength (me: mutable;
183 aPresentation : mutable Presentation from Prs3d)
187 ComputeTwoEdgesLength (myclass;
188 aPresentation : mutable Presentation from Prs3d;
189 aDrawer : Drawer from AIS;
190 aText : ExtendedString from TCollection;
191 ArrowSize : Real from Standard;
192 FirstEdge : Edge from TopoDS;
193 SecondEdge : Edge from TopoDS;
194 Plane : Plane from Geom;
195 AutomaticPos : Boolean from Standard;
196 IsSetBndBox : Boolean from Standard;
197 BndBox : Box from Bnd;
198 ExtShape : out Integer from Standard;
199 Val : out Real from Standard;
200 DirAttach : out Dir from gp;
201 Position : out Pnt from gp;
202 FirstAttach : out Pnt from gp;
203 SecondAttach : out Pnt from gp;
204 SymbolPrs : out ArrowSide from DsgPrs );
206 ComputeOneEdgeOneVertexLength(myclass;
207 aPresentation : mutable Presentation from Prs3d;
208 aDrawer : Drawer from AIS;
209 aText : ExtendedString from TCollection;
210 ArrowSize : Real from Standard;
211 FirstShape : Shape from TopoDS;
212 SecondShape : Shape from TopoDS;
213 Plane : Plane from Geom;
214 AutomaticPos : Boolean from Standard;
215 IsSetBndBox : Boolean from Standard;
216 BndBox : Box from Bnd;
217 ExtShape : out Integer from Standard;
218 Val : out Real from Standard;
219 DirAttach : out Dir from gp;
220 Position : out Pnt from gp;
221 FirstAttach : out Pnt from gp;
222 SecondAttach : out Pnt from gp;
223 SymbolPrs : out ArrowSide from DsgPrs );
225 ComputeTwoVerticesLength(myclass;
226 aPresentation : mutable Presentation from Prs3d;
227 aDrawer : Drawer from AIS;
228 aText : ExtendedString from TCollection;
229 ArrowSize : Real from Standard;
230 FirstVertex : Vertex from TopoDS;
231 SecondVertex : Vertex from TopoDS;
232 Plane : Plane from Geom;
233 AutomaticPos : Boolean from Standard;
234 IsSetBndBox : Boolean from Standard;
235 BndBox : Box from Bnd;
236 TypeDist : TypeOfDist from AIS;
237 ExtShape : out Integer from Standard;
238 Val : out Real from Standard;
239 DirAttach : out Dir from gp;
240 Position : out Pnt from gp;
241 FirstAttach : out Pnt from gp;
242 SecondAttach : out Pnt from gp;
243 SymbolPrs : out ArrowSide from DsgPrs );
247 -- Computation Selection private methods
250 ComputeFaceSelection(me : mutable;
251 aSelection : mutable Selection from SelectMgr)
254 ComputeEdgeVertexSelection( me : mutable;
255 aSelection : mutable Selection from SelectMgr)
261 myNbShape : Integer from Standard;
262 myFAttach : Pnt from gp;
263 mySAttach : Pnt from gp;
264 myDirAttach: Dir from gp;
265 myTypeDist : TypeOfDist from AIS;