b311480e |
1 | -- Created on: 1998-10-19 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class SelectSuite from IFSelect inherits SelectDeduct from IFSelect |
18 | |
19 | ---Purpose : A SelectSuite can describe a suite of SelectDeduct as a unique |
20 | -- one : in other words, it can be seen as a "macro selection" |
21 | -- |
22 | -- It works by applying each of its items (which is a |
23 | -- SelectDeduct) on the result computed by the previous one |
24 | -- (by using Alternate Input) |
25 | -- |
26 | -- But each of these Selections used as items may be used |
27 | -- independently, it will then give its own result |
28 | -- |
29 | -- Hence, SelectSuite gives a way of defining a new Selection |
30 | -- from existing ones, without having to do copies or saves |
31 | |
32 | uses CString, AsciiString from TCollection, |
33 | SequenceOfTransient from TColStd, |
34 | Graph from Interface, EntityIterator from Interface, |
35 | Selection from IFSelect |
36 | |
37 | raises InterfaceError |
38 | |
39 | is |
40 | |
41 | Create returns SelectSuite; |
42 | ---Purpose : Creates an empty SelectSuite |
43 | |
44 | AddInput (me : mutable; item : Selection) returns Boolean; |
45 | ---Purpose : Adds an input selection. I.E. : |
46 | -- If <item> is a SelectDeduct, adds it as Previous, not as Input |
47 | -- Else, sets it as Input |
48 | -- Returns True when done |
49 | -- Returns False and refuses to work if Input is already defined |
50 | |
51 | AddPrevious (me : mutable; item : SelectDeduct); |
52 | ---Purpose : Adds a new first item (prepends to the list). The Input is not |
53 | -- touched |
54 | -- If <item> is null, does nothing |
55 | |
56 | AddNext (me : mutable; item : SelectDeduct); |
57 | ---Purpose : Adds a new last item (prepends to the list) |
58 | -- If <item> is null, does nothing |
59 | |
60 | NbItems (me) returns Integer; |
61 | ---Purpose : Returns the count of Items |
62 | |
63 | Item (me; num : Integer) returns SelectDeduct; |
64 | ---Purpose : Returns an item from its rank in the list |
65 | -- (the Input is always apart) |
66 | |
67 | SetLabel (me : mutable; lab : CString); |
68 | ---Purpose : Sets a value for the Label |
69 | |
70 | -- Definitions for Selecting |
71 | |
72 | RootResult (me; G : Graph) returns EntityIterator |
73 | raises InterfaceError; |
74 | ---Purpose : Returns the list of selected entities |
75 | -- To do this, once InputResult has been taken (if Input or |
76 | -- Alternate has been defined, else the first Item gives it) : |
77 | -- this result is set as alternate input for the first item, |
78 | -- which computes its result : this result is set as alternate |
79 | -- input for the second item, etc... |
80 | |
81 | Label (me) returns AsciiString from TCollection; |
82 | ---Purpose : Returns the Label |
83 | -- Either it has been defined by SetLabel, or it will give |
84 | -- "Suite of nn Selections" |
85 | |
86 | fields |
87 | |
88 | thelab : AsciiString; |
89 | thesel : SequenceOfTransient; |
90 | |
91 | end SelectSuite; |