0023510: Integration of test grid "vis" into the new testing system
[occt.git] / src / Graphic2d / Graphic2d_SetOfSegments.cdl
CommitLineData
b311480e 1-- Created on: 1993-04-13
2-- Created by: 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
7fd59977 21
7fd59977 22
7fd59977 23
24class SetOfSegments from Graphic2d inherits Line from Graphic2d
25
26 ---Version:
27
28 ---Purpose: The primitive SetOfSegments
29 -- Warning: This primitive must be use as possible for performance
30 -- improvment but is drawn with a global line attributes
31 -- for all the set.
32 -- But when the set contains a lot of contigous segments
33 -- with a line attrib different to the default,it's
34 -- more preferable to use a SetOfPolylines for to insure
35 -- a better quality.
36 -- NOTE: than the method PickedIndex() permits to known
37 -- the last picked segment in the set.
38 ---References:
39
40uses
41 Drawer from Graphic2d,
42 GraphicObject from Graphic2d,
43 Length from Quantity,
44 SequenceOfShortReal from TShort,
45 FStream from Aspect,
46 IFStream from Aspect
47
48raises
49 SegmentDefinitionError from Graphic2d,
50 OutOfRange from Standard
51
52is
53 -------------------------
54 -- Category: Constructors
55 -------------------------
56
57 Create (aGraphicObject: GraphicObject from Graphic2d)
58 returns mutable SetOfSegments from Graphic2d;
59 ---Level: Public
60 ---Purpose: Creates an empty set of segments in the graphic
61 -- object <aGraphicObject>.
62 ---Category: Constructors
63
64 Add(me : mutable; X1, Y1, X2, Y2: Length from Quantity)
65 ---Level: Public
66 ---Purpose: Add a segment in the set
67 -- The first point is <X1>, <Y1>.
68 -- The second point is <X2>, <Y2>.
69 -- Trigger: Raises SegmentDefinitionError if the
70 -- first point and the second point are identical.
71 raises SegmentDefinitionError from Graphic2d;
72 ---Category: Update method
73
74 Length(me) returns Integer from Standard;
75 ---Level: Public
76 ---Purpose: Returns the number of segments in the set.
77 ---Category: Inquiry method
78
79 Values( me;
80 aRank: Integer from Standard;
81 X1, Y1, X2, Y2: out Length from Quantity )
82 ---Level: Public
83 ---Purpose: Returns the segment of rank <aRank> from the set.
84 -- Trigger: Raises OutOfRange if <aRank> is <1 or >Length()
85 raises OutOfRange from Standard;
86 ---Category: Inquiry method
87
88 --------------------------
89 -- Category: Draw and Pick
90 --------------------------
91
92 Draw (me : mutable; aDrawer: Drawer from Graphic2d)
93 is static protected;
94 ---Level: Internal
95 ---Purpose: Draws the set of segments <me>.
96
97 DrawElement( me : mutable; aDrawer: Drawer from Graphic2d;
98 anIndex: Integer from Standard)
99 is redefined protected;
100 ---Level: Internal
101 ---Purpose: Draws element <anIndex> of the set <me>.
102
103 DrawVertex( me : mutable; aDrawer: Drawer from Graphic2d;
104 anIndex: Integer from Standard)
105 is redefined protected;
106 ---Level: Internal
107 ---Purpose: Draws vertex <anIndex> of the set <me>.
108
109 Pick (me : mutable; X, Y: ShortReal from Standard;
110 aPrecision: ShortReal from Standard;
111 aDrawer: Drawer from Graphic2d)
112 returns Boolean from Standard
113 is static protected;
114 ---Level: Internal
115 ---Purpose: Returns Standard_True if one segment of the set <me>
116 -- is picked, Standard_False if not.
117 -- Warning: The PickIndex() method returns the rank of the picked
118 -- segment if any.
119
120 ----------------------------------------------------------------------
121
122 Save( me; aFStream: in out FStream from Aspect ) is virtual;
123-- Retrieve( me; aIFStream: in out IFStream from AIS2D ) is virtual;
124
125fields
126
127 myX1: SequenceOfShortReal from TShort;
128 myY1: SequenceOfShortReal from TShort;
129 myX2: SequenceOfShortReal from TShort;
130 myY2: SequenceOfShortReal from TShort;
131
132end SetOfSegments from Graphic2d;