0025991: Cyclic dependency in OCCT detected by WOK compiler
[occt.git] / src / SelectBasics / SelectBasics_SortAlgo.cdl
1 -- Created on: 1995-01-23
2 -- Created by: Didier Piffault
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 --              Full Copy of Select_Rectangle (Didier Piffault 94)
18
19
20 class SortAlgo from SelectBasics 
21
22         ---Purpose: Quickly selection of a rectangle in a set of rectangles
23         --          Sort algorithm for 2D rectangles.
24
25
26 uses    Integer from Standard,
27         Real    from Standard,
28         MapIteratorOfMapOfInteger from TColStd,
29         MapOfInteger from TColStd,
30         ListIteratorOfListOfInteger from TColStd,
31         Box2d          from Bnd,
32         HArray1OfBox2d from Bnd,
33         BoundSortBox2d from Bnd
34
35
36 is      Create 
37         ---Purpose: Empty rectangle selector.
38             returns SortAlgo from SelectBasics;
39
40         Create     (ClippingRectangle    : Box2d from Bnd;
41                     sizeOfSensitiveArea  : Real from Standard;
42                     theRectangles        : HArray1OfBox2d from Bnd)
43         ---Purpose: Creates a initialized selector.
44             returns SortAlgo from SelectBasics;
45
46         Initialize (me                   : in out;
47                     ClippingRectangle    : Box2d from Bnd;
48                     sizeOfSensitiveArea  : Real from Standard;
49                     theRectangles        : HArray1OfBox2d from Bnd)
50         ---Purpose: Clears and initializes the selector.
51             is static;
52
53
54         InitSelect (me    : in out;
55                     x, y  : Real from Standard) 
56         ---Purpose: Searchs the items on this position.
57             is static;
58
59
60         InitSelect (me    : in out;
61                     rect  : Box2d from Bnd) 
62         ---Purpose: Searchs the items in this rectangle.
63             is static;
64
65
66
67         More(me)
68         ---Purpose: Returns true if there is something selected.
69             returns Boolean from Standard is static;
70
71         Next(me : in out) 
72         ---Purpose: Sets value on the next selected item.
73             is static;
74
75         Value(me)
76         ---Purpose: Returns the index of the selected rectangle.
77             returns Integer from Standard is static;
78
79
80 fields  clipRect   : Box2d            from Bnd;
81         sizeArea   : Real             from Standard;
82         sortedRect : BoundSortBox2d   from Bnd;
83         myMap      : MapOfInteger     from TColStd;
84         curResult  : MapIteratorOfMapOfInteger from TColStd;
85
86 end SortAlgo;
87
88
89