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