1 -- Created on: 1992-12-09
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 deferred class SelectAnyList from IFSelect inherits SelectDeduct
20 ---Purpose : A SelectAnyList kind Selection selects a List of an Entity, as
21 -- well as this Entity contains some. A List contains sub-entities
22 -- as one per Item, or several (for instance if an Entity binds
23 -- couples of sub-entities, each item is one of these couples).
24 -- Remark that only Entities are taken into account (neither
25 -- Reals, nor Strings, etc...)
27 -- To define the list on which to work, SelectAnyList has two
28 -- deferred methods : NbItems (which gives the length of the
29 -- list), FillResult (which fills an EntityIterator). They are
30 -- intended to get a List in an Entity of the required Type (and
31 -- consider that list is empty if Entity has not required Type)
33 -- In addition, remark that some types of Entity define more than
34 -- one list in each instance : a given sub-class of SelectAnyList
35 -- must be attached to one list
37 -- SelectAnyList keeps or rejects a sub-set of the list,
38 -- that is the Items of which rank in the list is in a given
39 -- range (for instance form 2nd to 6th, etc...)
40 -- Range is defined by two Integer values. In order to allow
41 -- external control of them, these values are not directly
42 -- defined as fields, but accessed through IntParams, that is,
43 -- referenced as Transient (Handle) objects
45 -- Warning : the Input can be any kind of Selection, BUT its
46 -- RootResult must have zero (empty) or one Entity maximum
48 uses AsciiString from TCollection, Transient, EntityIterator, Graph, IntParam
50 raises OutOfRange, InterfaceError
54 KeepInputEntity (me; iter : in out EntityIterator) is deferred;
55 ---Purpose : Keeps Input Entity, as having required type. It works by
56 -- keeping in <iter>, only suitable Entities (SelectType can be
57 -- used). Called by RootResult (which waits for ONE ENTITY MAX)
59 NbItems (me; ent : Transient) returns Integer is deferred;
60 ---Purpose : Returns count of Items in the list in the Entity <ent>
61 -- If <ent> has not required type, returned value must be Zero
64 SetRange (me : mutable; rankfrom, rankto : mutable IntParam);
65 ---Purpose : Sets a Range for numbers, with a lower and a upper limits
67 SetOne (me : mutable; rank : mutable IntParam);
68 ---Purpose : Sets a unique number (only one Entity will be sorted as True)
70 SetFrom (me : mutable; rankfrom : mutable IntParam);
71 ---Purpose : Sets a Lower limit but no upper limit
73 SetUntil (me : mutable; rankto : mutable IntParam);
74 ---Purpose : Sets an Upper limit but no lower limit (equivalent to lower 1)
76 HasLower (me) returns Boolean;
77 ---Purpose : Returns True if a Lower limit is defined
79 Lower (me) returns mutable IntParam;
80 ---Purpose : Returns Lower limit (if there is; else, value is senseless)
82 LowerValue (me) returns Integer;
83 ---Purpose : Returns Integer Value of Lower Limit (0 if none)
85 HasUpper (me) returns Boolean;
86 ---Purpose : Returns True if a Lower limit is defined
88 Upper (me) returns mutable IntParam;
89 ---Purpose : Returns Upper limit (if there is; else, value is senseless)
91 UpperValue (me) returns Integer;
92 ---Purpose : Returns Integer Value of Upper Limit (0 if none)
95 RootResult (me; G : Graph) returns EntityIterator raises InterfaceError;
96 ---Purpose : Returns the list of selected entities (list of entities
97 -- complying with rank criterium)
98 -- Error if the input list has more than one Item
100 FillResult (me; n1,n2 : Integer; ent : Transient;
101 res : in out EntityIterator) is deferred;
102 ---Purpose : Puts into <res>, the sub-entities of the list, from n1 to
103 -- n2 included. Remark that adequation with Entity's type and
104 -- length of list has already been made at this stage
105 -- Called by RootResult
108 Label (me) returns AsciiString from TCollection;
109 ---Purpose : Returns a text defining the criterium : "Componants of List "
110 -- then Specific List Label, then, following cases :
111 -- " From .. Until .." or "From .." or "Until .." or "Rank no .."
112 -- Specific type is given by deferred method ListLabel
114 ListLabel (me) returns AsciiString from TCollection is deferred;
115 ---Purpose : Returns the specific label for the list, which is included as