1 -- Created on: 1992-11-18
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 generic class SelectList from IFSelect (Entity as Transient)
27 ---Purpose : A SelectList kind Selection selects a part of an Entity, as
28 -- well as this Entity can be described as an ordered List.
29 -- That is to say, it must have two methods :
31 -- NbEntities (me) returns Integer;
32 -- Entity (me; num : Integer) returns Transient;
34 -- For each class of Entity for which we want to define a
35 -- SelectList, we will instanciate this class with the
36 -- desired class of Entity as definition parameter : the deferred
37 -- methods NbEntities and ListedEntity are now defined to call
38 -- the required methods from <Entity>
40 -- SelectList works as SelectInList, beeing a sub-class of it
42 uses AsciiString from TCollection, Transient, EntityIterator, IntParam
48 Create returns mutable SelectList;
49 ---Purpose : Creates a SelectList (with no limit);
51 KeepInputEntity (me; iter : in out EntityIterator);
52 ---Purpose : Keeps Input Entity, as having required type <Entity>
54 NbItems (me; ent : Transient) returns Integer;
55 ---Purpose : Returns count of Entities in the list in the Entity <ent>
56 -- by calling method NbEntity from parameter class Entity
58 ListedEntity (me; num : Integer; ent : Transient)
59 returns Transient raises OutOfRange;
60 ---Purpose : Returns an Entity of the list in the Entity <ent>, by calling
61 -- method Entity from parameter class Entity
62 -- Error if <ent> has not required type, or if <num> is not in
63 -- the right range (1,NbEntities),
65 ListLabel (me) returns AsciiString from TCollection;
66 ---Purpose : Returns the specific label for the list
67 -- then, following cases :
68 -- " From .. Until .." or "From .." or "Until .." or "Rank no .."
69 -- Warning : it is not possible to give a character constant to instantiate
70 -- a generic class, thus "List From Entity" is not adapted :
71 -- redefine Label if judged necessary