7fd59977 |
1 | -- File: AIS_Line.cdl |
2 | -- Created: Tue Jan 21 11:45:01 1997 |
3 | -- Author: Prestataire Christiane ARMAND |
4 | -- <car@chamalox.paris1.matra-dtv.fr> |
5 | -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead |
6 | -- the restricted NameOfColor. |
7 | ---Copyright: Matra Datavision 1997 |
8 | |
9 | class Line from AIS inherits InteractiveObject from AIS |
10 | |
11 | ---Purpose: Constructs line datums to be used in construction of |
12 | -- composite shapes. |
13 | |
14 | uses |
15 | Line from Geom, |
16 | Point from Geom, |
17 | Presentation from Prs3d, |
18 | PresentationManager3d from PrsMgr, |
19 | NameOfColor from Quantity, |
20 | Color from Quantity, |
21 | Selection from SelectMgr, |
22 | Projector from Prs3d, |
23 | Transformation from Geom, |
24 | PresentationManager2d from PrsMgr, |
25 | GraphicObject from Graphic2d, |
26 | Line from AIS, |
27 | KindOfInteractive from AIS |
28 | |
29 | is |
30 | Create(aLine : Line from Geom) |
31 | returns mutable Line from AIS; |
32 | ---Purpose: Initializes the line aLine. |
33 | |
34 | Create(aStartPoint : Point from Geom; |
35 | aEndPoint : Point from Geom) |
36 | returns mutable Line from AIS; |
37 | ---Purpose: Initializes a starting point aStartPoint |
38 | -- and a finishing point aEndPoint for the line. |
39 | |
40 | Compute(me : mutable; |
41 | aPresentationManager: PresentationManager3d from PrsMgr; |
42 | aPresentation : mutable Presentation from Prs3d; |
43 | aMode : Integer from Standard = 0) |
44 | is redefined static private; |
45 | |
46 | Compute(me:mutable; |
47 | aProjector: Projector from Prs3d; |
48 | aPresentation: mutable Presentation from Prs3d) |
49 | is redefined static private; |
50 | |
51 | Compute(me:mutable; |
52 | aPresentationManager: PresentationManager2d from PrsMgr; |
53 | aPresentation: mutable GraphicObject from Graphic2d; |
54 | aMode: Integer from Standard = 0) |
55 | is redefined static private; |
56 | |
57 | Compute(me : mutable; |
58 | aProjector : Projector from Prs3d; |
59 | aTrsf : Transformation from Geom; |
60 | aPresentation : mutable Presentation from Prs3d) |
61 | is redefined; |
62 | ---Purpose: computes the presentation according to a point of view |
63 | -- given by <aProjector>. |
64 | -- To be Used when the associated degenerated Presentations |
65 | -- have been transformed by <aTrsf> which is not a Pure |
66 | -- Translation. The HLR Prs can't be deducted automatically |
67 | -- WARNING :<aTrsf> must be applied |
68 | -- to the object to display before computation !!! |
69 | |
70 | -- Methods from SelectableObject |
71 | |
72 | ComputeSelection(me : mutable; |
73 | aSelection : mutable Selection from SelectMgr; |
74 | aMode : Integer from Standard)is private; |
75 | |
76 | |
77 | -- Methods from InteractiveObject |
78 | |
79 | Signature(me) returns Integer from Standard is redefined; |
80 | ---Purpose: Returns the signature 5. |
81 | ---C++: inline |
82 | |
83 | Type(me) returns KindOfInteractive from AIS is redefined; |
84 | ---Purpose: Returns the type Datum. |
85 | ---C++: inline |
86 | |
87 | Line(me) returns any Line from Geom; |
88 | ---C++: inline |
89 | ---C++: return const & |
90 | ---Purpose: Constructs an infinite line. |
91 | |
92 | Points(me;PStart,PEnd: out Point from Geom); |
93 | ---Purpose: Returns the starting point PStart and the end point |
94 | -- PEnd of the line set by SetPoints. |
95 | ---C++: inline |
96 | |
97 | SetLine(me:mutable;L : Line from Geom); |
98 | ---C++: inline |
99 | ---Purpose: instantiates an infinite line. |
100 | |
101 | SetPoints(me:mutable;P1,P2:Point from Geom); |
102 | --- Purpose: |
103 | -- Sets the starting point P1 and ending point P2 of the |
104 | -- infinite line to create a finite line segment. |
105 | ---C++: inline |
106 | |
107 | SetColor(me :mutable; aColor : NameOfColor from Quantity) |
108 | is redefined static; |
109 | ---Purpose: Provides a new color setting aColor for the line in the |
110 | -- drawing tool, or "Drawer". |
111 | SetColor(me :mutable; aColor : Color from Quantity) |
112 | is redefined static; |
113 | |
114 | SetWidth(me:mutable; aValue:Real from Standard) |
115 | is redefined static; |
116 | ---Purpose: Provides the new width setting aValue for the line in |
117 | -- the drawing tool, or "Drawer". |
118 | UnsetColor(me:mutable) |
119 | is redefined static; |
120 | ---Purpose: Removes the color setting and returns the original color. |
121 | UnsetWidth(me:mutable) |
122 | is redefined static; |
123 | ---Purpose: Removes the width setting and returns the original width. |
124 | |
125 | |
126 | ComputeInfiniteLine(me: mutable; |
127 | aPresentation : mutable Presentation from Prs3d) |
128 | is private; |
129 | |
130 | ComputeSegmentLine(me: mutable; |
131 | aPresentation : mutable Presentation from Prs3d) |
132 | is private; |
133 | |
134 | ComputeInfiniteLineSelection(me: mutable; |
135 | aSelection : mutable Selection from SelectMgr) |
136 | is private; |
137 | |
138 | ComputeSegmentLineSelection(me: mutable; |
139 | aSelection : mutable Selection from SelectMgr) |
140 | is private; |
141 | |
142 | fields |
143 | |
144 | |
145 | myComponent : Line from Geom; |
146 | myStartPoint : Point from Geom; |
147 | myEndPoint : Point from Geom; |
148 | myLineIsSegment : Boolean from Standard; |
149 | |
150 | end Line; |