1 -- File: IFSelect_SelectPointed.cdl
2 -- Created: Mon May 30 17:11:41 1994
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1994
8 class SelectPointed from IFSelect inherits SelectBase
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
14 -- It can also be used to provide a list as internal alternate
15 -- input : this use implies to clear the list once queried
17 uses AsciiString from TCollection, SequenceOfTransient, HSequenceOfTransient,
18 EntityIterator, Graph, CopyControl,
25 Create returns mutable SelectPointed;
26 ---Purpose : Creates a SelectPointed
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
33 IsSet (me) returns Boolean;
34 ---Purpose : Tells if the list has been set. Even if empty
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
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
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
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
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
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)
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
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
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.
74 Rank (me; item : any Transient) returns Integer;
75 ---Purpose : Returns the rank of an item in the selected list, or 0.
77 NbItems (me) returns Integer;
78 ---Purpose : Returns the count of selected items
80 Item (me; num : Integer) returns any Transient;
81 ---Purpose : Returns an item given its rank, or a Null Handle
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.
87 Update (me : mutable; trf : Transformer);
88 ---Purpose : Rebuilds the selected list, by querying a Transformer
89 -- (same principle as from a CopyControl)
91 -- Services to provide --
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
99 Label (me) returns AsciiString from TCollection;
100 ---Purpose : Returns a text which identifies the type of selection made.
101 -- It is "Pointed Entities"
106 theitems : SequenceOfTransient;