b311480e |
1 | -- Created on: 1996-12-05 |
2 | -- Created by: Flore Lantheaume/Odile Olivier |
3 | -- Copyright (c) 1996-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class Chamf2dDimension from AIS inherits Relation from AIS |
24 | |
25 | ---Purpose: A framework to define display of 2D chamfers. |
26 | -- A chamfer is displayed with arrows and text. The text |
27 | -- gives the length of the chamfer if it is a symmetrical |
28 | -- chamfer, or the angle if it is not. |
29 | |
30 | |
31 | uses |
32 | |
33 | PresentationManager3d from PrsMgr, |
34 | Presentation from Prs3d, |
35 | Selection from SelectMgr, |
36 | Shape from TopoDS, |
37 | Pnt from gp, |
38 | Plane from Geom, |
39 | Dir from gp, |
40 | Projector from Prs3d, |
41 | Transformation from Geom, |
7fd59977 |
42 | ExtendedString from TCollection, |
43 | ArrowSide from DsgPrs, |
44 | KindOfDimension from AIS |
45 | |
46 | is |
47 | Create (aFShape : Shape from TopoDS; |
48 | aPlane : Plane from Geom; |
49 | aVal : Real from Standard; |
50 | aText : ExtendedString from TCollection) |
51 | ---Purpose: Constructs the display object for 2D chamfers. |
52 | -- This object is defined by the face aFShape, the |
53 | -- dimension aVal, the plane aPlane and the text aText. |
54 | |
55 | returns mutable Chamf2dDimension from AIS; |
56 | |
57 | Create (aFShape : Shape from TopoDS; |
58 | aPlane : Plane from Geom; |
59 | aVal : Real from Standard; |
60 | aText : ExtendedString from TCollection; |
61 | aPosition : Pnt from gp; |
62 | aSymbolPrs : ArrowSide from DsgPrs; |
63 | anArrowSize : Real from Standard = 0.0) |
64 | ---Purpose: Constructs the display object for 2D chamfers. |
65 | -- This object is defined by the face aFShape, the plane |
66 | -- aPlane, the dimension aVal, the position aPosition, |
67 | -- the type of arrow aSymbolPrs with the size |
68 | -- anArrowSize, and the text aText. |
69 | returns mutable Chamf2dDimension from AIS; |
70 | |
71 | KindOfDimension(me) |
72 | ---Purpose: Indicates that we are concerned with a 2d length. |
73 | ---C++: inline |
74 | returns KindOfDimension from AIS |
75 | is redefined; |
76 | |
77 | IsMovable(me) returns Boolean from Standard |
78 | ---Purpose: Returns true if the 2d chamfer dimension is movable. |
79 | ---C++: inline |
80 | is redefined; |
81 | |
82 | -- Methods from PresentableObject |
83 | |
84 | Compute(me : mutable; |
85 | aPresentationManager: PresentationManager3d from PrsMgr; |
86 | aPresentation : mutable Presentation from Prs3d; |
87 | aMode : Integer from Standard= 0) |
88 | is redefined static private; |
89 | |
90 | Compute(me:mutable; |
91 | aProjector: Projector from Prs3d; |
92 | aPresentation: mutable Presentation from Prs3d) |
93 | is redefined static private; |
94 | |
7fd59977 |
95 | Compute(me : mutable; |
96 | aProjector : Projector from Prs3d; |
97 | aTrsf : Transformation from Geom; |
98 | aPresentation : mutable Presentation from Prs3d) |
99 | is redefined; |
100 | ---Purpose: computes the presentation according to a point of view |
101 | -- given by <aProjector>. |
102 | -- To be Used when the associated degenerated Presentations |
103 | -- have been transformed by <aTrsf> which is not a Pure |
104 | -- Translation. The HLR Prs can't be deducted automatically |
105 | -- WARNING :<aTrsf> must be applied |
106 | -- to the object to display before computation !!! |
107 | |
108 | ComputeSelection(me : mutable; |
109 | aSelection : mutable Selection from SelectMgr; |
110 | aMode : Integer from Standard) |
111 | is redefined private; |
112 | |
113 | |
114 | |
115 | fields |
116 | |
117 | myPntAttach : Pnt from gp; |
118 | myDir : Dir from gp; |
119 | |
120 | end Chamf2dDimension; |