0023663: Removing 2D viewer library
[occt.git] / src / Graphic2d / Graphic2d_Segment.cdl
1 -- Created on: 1993-06-22
2 -- Created by: Jean Louis FRENKEL, Gerard GRAS
3 -- Copyright (c) 1993-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
22 -- Modified: TCL G002, 07-08-00, new inquire methods FirstPoint, SecondPoint
23
24
25 class Segment from Graphic2d inherits Line from Graphic2d
26
27         ---Version:
28
29         ---Purpose: The primitive Segment
30
31         ---Keywords: Primitive, Segment
32         ---Warning:
33         ---References:
34
35 uses
36         Drawer          from Graphic2d,
37         GraphicObject   from Graphic2d,
38         Length          from Quantity,
39         FStream         from Aspect,
40         IFStream        from Aspect
41
42 raises
43         SegmentDefinitionError  from Graphic2d
44
45 is
46         -------------------------------------
47         -- Category: Constructors
48         -------------------------------------
49
50         Create (aGraphicObject: GraphicObject from Graphic2d;
51                 X1, Y1, X2, Y2: Length from Quantity)
52         returns mutable Segment from Graphic2d
53         ---Level: Public
54         ---Purpose: Creates a segment in the graphic object <aGraphicObject>.
55         --          The first point is <X1>, <Y1>.
56         --          The second point is <X2>, <Y2>.
57         --  Warning: Raises SegmentDefinitionError if the
58         --          first point and the second point are identical.
59         raises SegmentDefinitionError from Graphic2d;
60
61         ----------------------------------------
62         -- Category: Inquire methods
63         ----------------------------------------
64
65         FirstPoint( me; X, Y: out Length from Quantity );  
66         ---Level: Public
67         ---Purpose: returns the coordinates of the first point of the segment
68         
69         SecondPoint( me; X, Y: out Length from Quantity );  
70         ---Level: Public
71         ---Purpose: returns the coordinates of the second point of the segment
72         
73         --------------------------------------
74         -- Category: Draw and Pick
75         --------------------------------------
76
77         Draw (me : mutable; aDrawer: Drawer from Graphic2d)
78         is static protected;
79         ---Level: Internal
80         ---Purpose: Draws the segment <me>.
81
82         DrawElement( me : mutable; aDrawer: Drawer from Graphic2d;
83                  anIndex: Integer from Standard)
84         is redefined protected;
85         ---Level: Internal
86         ---Purpose: Draws edge <anIndex> of the segment <me>.
87
88         DrawVertex( me : mutable; aDrawer: Drawer from Graphic2d;
89                 anIndex: Integer from Standard)
90         is redefined protected;
91         ---Level: Internal
92         ---Purpose: Draws vertex <anIndex> of the segment <me>.
93
94         Pick (me : mutable; X, Y: ShortReal from Standard;
95                 aPrecision: ShortReal from Standard;
96                 aDrawer: Drawer from Graphic2d)
97         returns Boolean from Standard
98         is static protected;
99         ---Level: Internal
100         ---Purpose: Returns Standard_True if the segment <me> is picked,
101         --          Standard_False if not.
102
103         ----------------------------------------------------------------------
104
105         Save(me; aFStream: in out FStream from Aspect) is virtual;
106         Retrieve(myclass; anIFStream: in out IFStream from Aspect;
107                 aGraphicObject: GraphicObject from Graphic2d);
108
109 fields
110
111         myX1:   ShortReal from Standard;
112         myY1:   ShortReal from Standard;
113         myX2:   ShortReal from Standard;
114         myY2:   ShortReal from Standard;
115
116 end Segment from Graphic2d;