1 -- File: IFSelect_AppliedModifiers.cdl
2 -- Created: Mon May 2 18:34:11 1994
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1994
8 class AppliedModifiers from IFSelect inherits TShared
10 ---Purpose : This class allows to memorize and access to the modifiers
11 -- which are to be applied to a file. To each modifier, is bound
12 -- a list of integers (optionnal) : if this list is absent, the
13 -- modifier applies to all the file. Else, it applies to the
14 -- entities designated by these numbers in the produced file.
16 -- To record a modifier, and a possible list of entity numbers
18 -- AddModif (amodifier);
19 -- loop on AddNum (anumber);
21 -- To query it, Count gives the count of recorded modifiers,
22 -- then for each one :
23 -- Item (numodif, amodifier, entcount);
24 -- IsForAll () -> can be called, if True, applies on the whole file
26 -- for (i = 1; i <= entcount; i ++)
27 -- nument = ItemNum (i); -> return an entity number
29 uses GeneralModifier, SequenceOfGeneralModifier,
30 HSequenceOfInteger from TColStd, IntList
34 Create (nbmax,nbent : Integer) returns mutable AppliedModifiers;
35 ---Purpose : Creates an AppliedModifiers, ready to record up to <nbmax>
36 -- modifiers, on a model of <nbent> entities
38 AddModif (me : mutable; modif : mutable GeneralModifier) returns Boolean;
39 ---Purpose : Records a modifier. By default, it is to apply on all a
40 -- produced file. Further calls to AddNum will restrict this.
41 -- Returns True if done, False if too many modifiers are already
44 AddNum (me : mutable; nument : Integer) returns Boolean;
45 ---Purpose : Adds a number of entity of the output file to be applied on.
46 -- If a sequence of AddNum is called after AddModif, this
47 -- Modifier will be applied on the list of designated entities.
48 -- Else, it will be applied on all the file
49 -- Returns True if done, False if no modifier has yet been added
51 Count (me) returns Integer;
52 ---Purpose : Returns the count of recorded modifiers
54 Item (me : mutable; num : Integer;
55 modif : out mutable GeneralModifier; entcount : out Integer)
57 ---Purpose : Returns the description for applied modifier n0 <num> :
58 -- the modifier itself, and the count of entities to be applied
59 -- on. If no specific list of number has been defined, returns
60 -- the total count of entities of the file
61 -- If this count is zero, then the modifier applies to all
62 -- the file (see below). Else, the numbers are then queried by
63 -- calls to ItemNum between 1 and <entcount>
64 -- Returns True if OK, False if <num> is out of range
66 ItemNum (me; nument : Integer) returns Integer;
67 ---Purpose : Returns a numero of entity to be applied on, given its rank
68 -- in the list. If no list is defined (i.e. for all the file),
69 -- returns <nument> itself, to give all the entities of the file
70 -- Returns 0 if <nument> out of range
72 ItemList (me) returns HSequenceOfInteger;
73 ---Purpose : Returns the list of entities to be applied on (see Item)
74 -- as a HSequence (IsForAll produces the complete list of all
75 -- the entity numbers of the file
77 IsForAll (me) returns Boolean;
78 ---Purpose : Returns True if the applied modifier queried by last call to
79 -- Item is to be applied to all the produced file.
80 -- Else, <entcount> returned by Item gives the count of entity
81 -- numbers, each one is queried by ItemNum
85 themodifs : SequenceOfGeneralModifier;