1 -- Created on: 1998-10-19
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class SelectSuite from IFSelect inherits SelectDeduct from IFSelect
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"
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)
26 -- But each of these Selections used as items may be used
27 -- independently, it will then give its own result
29 -- Hence, SelectSuite gives a way of defining a new Selection
30 -- from existing ones, without having to do copies or saves
32 uses CString, AsciiString from TCollection,
33 SequenceOfTransient from TColStd,
34 Graph from Interface, EntityIterator from Interface,
35 Selection from IFSelect
41 Create returns SelectSuite;
42 ---Purpose : Creates an empty SelectSuite
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
51 AddPrevious (me : mutable; item : SelectDeduct);
52 ---Purpose : Adds a new first item (prepends to the list). The Input is not
54 -- If <item> is null, does nothing
56 AddNext (me : mutable; item : SelectDeduct);
57 ---Purpose : Adds a new last item (prepends to the list)
58 -- If <item> is null, does nothing
60 NbItems (me) returns Integer;
61 ---Purpose : Returns the count of Items
63 Item (me; num : Integer) returns SelectDeduct;
64 ---Purpose : Returns an item from its rank in the list
65 -- (the Input is always apart)
67 SetLabel (me : mutable; lab : CString);
68 ---Purpose : Sets a value for the Label
70 -- Definitions for Selecting
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...
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"
89 thesel : SequenceOfTransient;