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
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.
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.
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.
21 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
22 -- the restricted NameOfColor.
24 class Line from AIS inherits InteractiveObject from AIS
26 ---Purpose: Constructs line datums to be used in construction of
32 Presentation from Prs3d,
33 PresentationManager3d from PrsMgr,
34 NameOfColor from Quantity,
36 Selection from SelectMgr,
38 Transformation from Geom,
39 PresentationManager2d from PrsMgr,
40 GraphicObject from Graphic2d,
42 KindOfInteractive from AIS
45 Create(aLine : Line from Geom)
46 returns mutable Line from AIS;
47 ---Purpose: Initializes the line aLine.
49 Create(aStartPoint : Point from Geom;
50 aEndPoint : Point from Geom)
51 returns mutable Line from AIS;
52 ---Purpose: Initializes a starting point aStartPoint
53 -- and a finishing point aEndPoint for the line.
56 aPresentationManager: PresentationManager3d from PrsMgr;
57 aPresentation : mutable Presentation from Prs3d;
58 aMode : Integer from Standard = 0)
59 is redefined static private;
62 aProjector: Projector from Prs3d;
63 aPresentation: mutable Presentation from Prs3d)
64 is redefined static private;
67 aPresentationManager: PresentationManager2d from PrsMgr;
68 aPresentation: mutable GraphicObject from Graphic2d;
69 aMode: Integer from Standard = 0)
70 is redefined static private;
73 aProjector : Projector from Prs3d;
74 aTrsf : Transformation from Geom;
75 aPresentation : mutable Presentation from Prs3d)
77 ---Purpose: computes the presentation according to a point of view
78 -- given by <aProjector>.
79 -- To be Used when the associated degenerated Presentations
80 -- have been transformed by <aTrsf> which is not a Pure
81 -- Translation. The HLR Prs can't be deducted automatically
82 -- WARNING :<aTrsf> must be applied
83 -- to the object to display before computation !!!
85 -- Methods from SelectableObject
87 ComputeSelection(me : mutable;
88 aSelection : mutable Selection from SelectMgr;
89 aMode : Integer from Standard)is private;
92 -- Methods from InteractiveObject
94 Signature(me) returns Integer from Standard is redefined;
95 ---Purpose: Returns the signature 5.
98 Type(me) returns KindOfInteractive from AIS is redefined;
99 ---Purpose: Returns the type Datum.
102 Line(me) returns any Line from Geom;
104 ---C++: return const &
105 ---Purpose: Constructs an infinite line.
107 Points(me;PStart,PEnd: out Point from Geom);
108 ---Purpose: Returns the starting point PStart and the end point
109 -- PEnd of the line set by SetPoints.
112 SetLine(me:mutable;L : Line from Geom);
114 ---Purpose: instantiates an infinite line.
116 SetPoints(me:mutable;P1,P2:Point from Geom);
118 -- Sets the starting point P1 and ending point P2 of the
119 -- infinite line to create a finite line segment.
122 SetColor(me :mutable; aColor : NameOfColor from Quantity)
124 ---Purpose: Provides a new color setting aColor for the line in the
125 -- drawing tool, or "Drawer".
126 SetColor(me :mutable; aColor : Color from Quantity)
129 SetWidth(me:mutable; aValue:Real from Standard)
131 ---Purpose: Provides the new width setting aValue for the line in
132 -- the drawing tool, or "Drawer".
133 UnsetColor(me:mutable)
135 ---Purpose: Removes the color setting and returns the original color.
136 UnsetWidth(me:mutable)
138 ---Purpose: Removes the width setting and returns the original width.
141 ComputeInfiniteLine(me: mutable;
142 aPresentation : mutable Presentation from Prs3d)
145 ComputeSegmentLine(me: mutable;
146 aPresentation : mutable Presentation from Prs3d)
149 ComputeInfiniteLineSelection(me: mutable;
150 aSelection : mutable Selection from SelectMgr)
153 ComputeSegmentLineSelection(me: mutable;
154 aSelection : mutable Selection from SelectMgr)
160 myComponent : Line from Geom;
161 myStartPoint : Point from Geom;
162 myEndPoint : Point from Geom;
163 myLineIsSegment : Boolean from Standard;