7fd59977 |
1 | -- File: IFSelect_SelectPointed.cdl |
2 | -- Created: Mon May 30 17:11:41 1994 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@bravox> |
5 | ---Copyright: Matra Datavision 1994 |
6 | |
7 | |
8 | class SelectPointed from IFSelect inherits SelectBase |
9 | |
10 | ---Purpose : This type of Selection is intended to describe a direct |
11 | -- selection without an explicit criterium, for instance the |
12 | -- result of picking viewed entities on a graphic screen |
13 | -- |
14 | -- It can also be used to provide a list as internal alternate |
15 | -- input : this use implies to clear the list once queried |
16 | |
17 | uses AsciiString from TCollection, SequenceOfTransient, HSequenceOfTransient, |
18 | EntityIterator, Graph, CopyControl, |
19 | Transformer |
20 | |
21 | raises InterfaceError |
22 | |
23 | is |
24 | |
25 | Create returns mutable SelectPointed; |
26 | ---Purpose : Creates a SelectPointed |
27 | |
28 | Clear (me : mutable); |
29 | ---Purpose : Clears the list of selected items |
30 | -- Also says the list is unset |
31 | -- All Add* methods and SetList say the list is set |
32 | |
33 | IsSet (me) returns Boolean; |
34 | ---Purpose : Tells if the list has been set. Even if empty |
35 | |
36 | SetEntity (me : mutable; item : any Transient); |
37 | ---Purpose : As SetList but with only one entity |
38 | -- If <ent> is Null, the list is said as being set but is empty |
39 | |
40 | SetList (me : mutable; list : HSequenceOfTransient); |
41 | ---Purpose : Sets a given list to define the list of selected items |
42 | -- <list> can be empty or null : in this case, the list is said |
43 | -- as being set, but it is empty |
44 | -- |
45 | -- To use it as an alternate input, one shot : |
46 | -- - SetList or SetEntity to define the input list |
47 | -- - RootResult to get it |
48 | -- - then Clear to drop it |
49 | |
50 | Add (me : mutable; item : any Transient) returns Boolean; |
51 | ---Purpose : Adds an item. Returns True if Done, False if <item> is already |
52 | -- in the selected list |
53 | |
54 | Remove (me : mutable; item : any Transient) returns Boolean; |
55 | ---Purpose : Removes an item. Returns True if Done, False if <item> was not |
56 | -- in the selected list |
57 | |
58 | Toggle (me : mutable; item : any Transient) returns Boolean; |
59 | ---Purpose : Toggles status of an item : adds it if not pointed or removes |
60 | -- it if already pointed. Returns the new status (Pointed or not) |
61 | |
62 | AddList (me : mutable; list : HSequenceOfTransient) returns Boolean; |
63 | ---Purpose : Adds all the items defined in a list. Returns True if at least |
64 | -- one item has been added, False else |
65 | |
66 | RemoveList (me : mutable; list : HSequenceOfTransient) returns Boolean; |
67 | ---Purpose : Removes all the items defined in a list. Returns True if at |
68 | -- least one item has been removed, False else |
69 | |
70 | ToggleList (me : mutable; list : HSequenceOfTransient) returns Boolean; |
71 | ---Purpose : Toggles status of all the items defined in a list : adds it if |
72 | -- not pointed or removes it if already pointed. |
73 | |
74 | Rank (me; item : any Transient) returns Integer; |
75 | ---Purpose : Returns the rank of an item in the selected list, or 0. |
76 | |
77 | NbItems (me) returns Integer; |
78 | ---Purpose : Returns the count of selected items |
79 | |
80 | Item (me; num : Integer) returns any Transient; |
81 | ---Purpose : Returns an item given its rank, or a Null Handle |
82 | |
83 | Update (me : mutable; control : CopyControl); |
84 | ---Purpose : Rebuilds the selected list. Any selected entity which has a |
85 | -- bound result is replaced by this result, else it is removed. |
86 | |
87 | Update (me : mutable; trf : Transformer); |
88 | ---Purpose : Rebuilds the selected list, by querying a Transformer |
89 | -- (same principle as from a CopyControl) |
90 | |
91 | -- Services to provide -- |
92 | |
93 | RootResult (me; G : Graph) returns EntityIterator |
94 | raises InterfaceError; |
95 | ---Purpose : Returns the list of selected items. Only the selected entities |
96 | -- which are present in the graph are given (this result assures |
97 | -- uniqueness). |
98 | |
99 | Label (me) returns AsciiString from TCollection; |
100 | ---Purpose : Returns a text which identifies the type of selection made. |
101 | -- It is "Pointed Entities" |
102 | |
103 | fields |
104 | |
105 | theset : Boolean; |
106 | theitems : SequenceOfTransient; |
107 | |
108 | end SelectPointed; |