e45a69f040796f9ae37af5e9b341ead6a4399ab2
[occt.git] / src / AIS / AIS_Line.cdl
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
21 --   GG  :  GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
22 --                                     the restricted NameOfColor.
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,
39     PresentationManager2d from PrsMgr,
40     GraphicObject         from Graphic2d,    
41     Line                  from AIS,
42     KindOfInteractive     from AIS
43
44 is
45     Create(aLine : Line from Geom) 
46     returns mutable Line from AIS;
47         ---Purpose: Initializes the line aLine.
48         
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. 
54  
55     Compute(me            : mutable;
56             aPresentationManager: PresentationManager3d from PrsMgr;
57             aPresentation : mutable Presentation from Prs3d;
58             aMode         : Integer from Standard = 0) 
59     is redefined static  private;
60     
61     Compute(me:mutable;
62                 aProjector: Projector from Prs3d;
63                 aPresentation: mutable Presentation from Prs3d)
64     is redefined static private;     
65
66     Compute(me:mutable;
67             aPresentationManager: PresentationManager2d from PrsMgr;
68             aPresentation: mutable GraphicObject from Graphic2d;
69             aMode: Integer from Standard = 0)
70     is redefined static private;        
71
72     Compute(me            : mutable;
73             aProjector    : Projector from Prs3d;
74             aTrsf         : Transformation from Geom;
75             aPresentation : mutable Presentation from Prs3d)
76     is redefined;
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  !!!
84
85 -- Methods from SelectableObject
86
87     ComputeSelection(me         : mutable;
88                      aSelection : mutable Selection from SelectMgr;
89                      aMode      : Integer from Standard)is private;
90
91  
92 -- Methods from InteractiveObject
93
94     Signature(me) returns Integer from Standard is redefined;
95         ---Purpose: Returns the signature 5.
96         ---C++: inline
97        
98  Type(me) returns KindOfInteractive from AIS is redefined;
99         ---Purpose: Returns the type Datum.
100         ---C++: inline
101       
102   Line(me) returns any Line from Geom;
103         ---C++: inline
104         ---C++: return const &
105         ---Purpose: Constructs an infinite line.
106   
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.
110         ---C++: inline
111         
112   SetLine(me:mutable;L : Line from Geom);
113         ---C++: inline
114         ---Purpose: instantiates an infinite line.
115          
116     SetPoints(me:mutable;P1,P2:Point from Geom);
117         --- Purpose:
118         -- Sets the starting point P1 and ending point P2 of the
119         -- infinite line to create a finite line segment.
120         ---C++: inline
121
122    SetColor(me :mutable; aColor : NameOfColor from Quantity)
123     is redefined static;
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) 
127     is redefined static;
128          
129     SetWidth(me:mutable; aValue:Real from Standard)
130     is redefined static; 
131         ---Purpose: Provides the new width setting aValue for the line in
132         -- the drawing tool, or "Drawer".
133     UnsetColor(me:mutable)
134     is redefined static; 
135         ---Purpose: Removes the color setting and returns the original color.    
136     UnsetWidth(me:mutable)    
137     is redefined static; 
138         ---Purpose: Removes the width setting and returns the original width.
139
140
141     ComputeInfiniteLine(me: mutable;
142                         aPresentation : mutable Presentation from Prs3d)
143     is private;
144      
145     ComputeSegmentLine(me: mutable;
146                        aPresentation : mutable Presentation from Prs3d)
147     is private;
148
149     ComputeInfiniteLineSelection(me: mutable;
150                                  aSelection : mutable Selection from SelectMgr)
151     is private;
152      
153     ComputeSegmentLineSelection(me: mutable;
154                                 aSelection : mutable Selection from SelectMgr)
155     is private;
156
157 fields
158
159
160     myComponent     : Line    from Geom;
161     myStartPoint    : Point   from Geom;
162     myEndPoint      : Point   from Geom;
163     myLineIsSegment : Boolean from Standard;
164     
165 end Line;